Posts

Showing posts from August, 2011

mysql - SQL mass insert based off of data pulled from another table -

i don't know if worded correctly, i'll try explain want. table 1 - x id | name | blah table 2 - y id | xid | configkey | configval what want is, create row in table 2 in table 1, corresponding id table 1 goes column xid in table 2. i'm java background , not keen on sql, not sure how this. there lot of rows in table 1, why script out. i pretty want this: table1 (the object table) 1 test1 2 test3 b 3 testn n run query populate this table 2 (the config table) ...exisitng rows 59 1 dosomething true 60 2 dosomething true 61 3 dosomething true so, pretty want add in config row (all same values) except id corresponds (column 2 in table 2 should col 1 table 1) thanks to use fixed values 'dosomething' , 'true' inserted records: insert table2 (xid, configkey, configval) select id, 'dosomething', 'true' table1

internet explorer - Selenium / WatiN - Automating Embedded IE inside Desktop Application -

i trying automate functional test of web application launches in embedded ie. using white automation framework reach point till application opens web app in embedded ie. looking way hook embedded ie , can drive workflow. how do that? know not possible thru selenium /watin out of box , let me know other ways it. thanks j try autoit. has pretty functional tool called "window info".

Facebook SDK and Android - Feed post succeeds with error -

i'm doing feed post through facebook sdk on android. it working fine before, since changed fb app id, post works sdk throws null facebookerror exception. tracing little more, can see fb request returns false, though correctly completes post! if use former app_id, works without hitch. if use new app_id, error, means has nothing code, app setting. however, don't know setting is. just in case, here code. pretty straight out of example: private class sampledialoglistener extends fbbasedialoglistener { public void oncomplete(bundle values) { final string postid = values.getstring("post_id"); if (postid != null) { //post id valid here _app.fb.getasynchrunner().request(postid, new wallpostrequestlistener()); } else { showchallenge.this.runonuithread(new runnable() { public void run() { string errormsg = getresources().getstring(r.string.errorunabletopostfeed...

What version of Javascript is supported in node.js -

i'm getting started node.js , i'm having hard time figuring out version of javascript supported node makes difficult figuring out features can use. here's know. node uses v8 v8 implements ecmascript specified in ecma-262, 3rd edition ecma-262, 3rd edition javascript 1.5 given this, assume can use javascript 1.5 compatible code in node. however, turns out can use array.foreach , among other constructs, though according mdc isn't available until javascript 1.6 -- ecma-262, 5th edition. where going wrong? there document somewhere details available language features? this matrix (v8 follows webkit column closely) seems pretty answer question "what features can use?" can't find canonical answer "what version of javascript supported?" far can tell, best answer this: ecma-262 3rd edition supported, many features of 5th edition supported. there's explanation of why v8 follows webkit , javascriptcore functionality on this ...

Transforming an image to gray-scale in Java -

i want display gray scale image (16 bits per pixel). far, have this: datainputstream afile = new datainputstream(new fileinputstream("filename.raw")); bufferedimage abufferedimage = new bufferedimage(2000, 2000, bufferedimage.type_ushort_gray); writableraster araster = abufferedimage.getraster(); byte[] arow = new byte[2000*2]; afile.readfully(arow, 0, 2000*2); now, question how set 16-bit intensity values arow abufferedimage ? based on http://java.itags.org/java-tech/17212/ , convert byte array int or double array (to have 1 array cell per pixel), , use writableraster.setsamples() or writableraster.setpixels() . avoid doing byte-to-ushort conversion yourself, can use datainputstream.readunsignedshort() .

javascript - How to get selected text/caret position of an input that doesn't have focus? -

is possible (reliably) selected text/caret position in input text box if field doesn't have focus? if not, what's best way , retain data? basically, when user clicks button want insert text @ caret position. however, user clicks button, field loses focus , lose caret position. the following script hold caret position , button click insert text @ stored position: javascript: <script type="text/javascript"> //gets position of cursor function getcaret(el) { if (el.selectionstart) { return el.selectionstart; } else if (document.selection) { el.focus(); var r = document.selection.createrange(); if (r == null) { return 0; } var re = el.createtextrange(), rc = re.duplicate(); re.movetobookmark(r.getbookmark()); rc.setendpoint('endtostart', re); return rc.text.length; } return 0; } function inserttext() { var textarea = document.getelementbyid('txtarea...

visual studio 2010 - How can I prevent a .vdproj compile from updating the PackageCode on every compile? -

i have visual studio 2010 solution web application contains of projects make web application, plus .vdproj file builds installer. of files under configuration management. whenever compile solution no changes in source code, visual studio check out .vdproj file , make changes. @ minimum, packagecode changed a different guid. @ other times change order of hierarchy within "deployproject" section of .vdproj file in addition updating packagecode. this not happen of our other .vdproj files. 1 thing makes .vdproj unique in addition containing primary output other projects in solution, contains on 50 additional .iso, .kml, .jpg files not originate visual studio project. these causing packagecode change in way? the package code should changed each time "release" msi, see http://msdn.microsoft.com/en-us/library/aa370568 . since vs doesn't know whether distribute msi or not, plays safe , modifies package code. visual studio should able handle in combina...

c# - Can I copy this array any faster? -

is absolute fastest possibly copy bitmap byte[] in c# ? if there speedier way dying know! const int width = /* width */; const int height = /* height */; bitmap bitmap = new bitmap(width, height, pixelformat.format32bpprgb); byte[] bytes = new byte[width * height * 4]; bitmaptobytearray(bitmap, bytes); private unsafe void bitmaptobytearray(bitmap bitmap, byte[] bytes) { bitmapdata bitmapdata = bitmap.lockbits(new rectangle(0, 0, width, height), imagelockmode.readonly, pixelformat.format32bpprgb); fixed(byte* pbytes = &bytes[0]) { movememory(pbytes, bitmapdata.scan0.topointer(), width * height * 4); } bitmap.unlockbits(bitmapdata); } [dllimport("kernel32.dll", entrypoint = "rtlmovememory", setlasterror = false)] private static unsafe extern void movememory(void* dest, void* src, int size); well, using marshal.copy() wiser here, @ least cuts out on (one time) cost of looking dll export. that's it, both...

c# - Single Controller for multiple pages -

i have url structures this /home /about /contact /terms i dont want create separate controller foreach page. how work using single home controller? if make in single controller show url like /home /home/about /home/contact /home/terms your global.asax responsible configuring routes, via registerroutes . can edit explicitly add own patterns or individual mappings. example: routes.maproute( "default", "{action}", new { controller = "home", action = "index" } );

android - how to change images on imageView after some interval -

i have problem want paste images on imageview in android , images periodically changed after interval. means 1 one images shown in imageview. doing of thread in java got problem thread not attached , something. please review code given below , tell me exact error , how remove error or give me diffrent way doing this. package com.ex.thread; import com.ex.thread.r; import android.app.activity; import android.os.bundle; import android.util.log; import android.widget.imageview; public class thread extends activity implements runnable{ /** called when activity first created. */ public static integer[] mthumbids = { r.drawable.al1,r.drawable.al2,r.drawable.al3,r.drawable.al4, }; thread th; imageview iv; public void run() { for(int i=0;i<3;i++) { iv.setimageresource(mthumbids[i]); system.out.println("sanat pandey"); try{ thread.sleep(3000); }catch(exception e) { system.out.println(e); } ...

c# - Thread Apartment State -

all, i have been using threads while in c# still bit confused thread's apartment state means. know winforms must use sta apartment state (as opposed mta) still not clear apartment states about. com had lofty goals. 1 of them threading programming detail hard right , should managed support libraries. unlike .net entirely use classes not thread-safe in thread-safe manner. this works through registry, com coclass publishes threadingmodel registry key says kind of threading supports. far of them use "apartment", unclear way "i don't support multi-threading". signal com make sure of methods called in thread-safe manner. if program calls method worker thread com takes care of marshaling call worker thread created instance. automatically ensuring server used in thread-safe manner. not unlike way control.invoke , dispatcher.invoke works, automatically. this wonderful magic of course, program have co-operate bit. com cannot marshal calls wi...

asp.net - Can I modify an MVC route outside of Global.asax? -

is possible modify the routes (and routetable) outside of global.asax file, maybe in controller? advisable? my reason asking has iis 6 , integrated mode not allowing request context calls. i'm implementing internationalization site , keeping track of culture in url. culture read .config file , loaded route default. file read ends throwing error (another few steps stack). based off method described here . you can access routing table pretty anywhere system.web.routing.routetable.routes, have tested controller , worked fine.

Split Entity mapping producing unexpected results with oracle database -

i using following mapping map split entity , producing unexpeted results trying map table public class testresultmap : entitytypeconfiguration { public testresultmap() { #region property => column mapping //test table property(e => e.id) .hascolumnname("test_number"); property(e => e.analysis) .hascolumnname("analysis"); property(e => e.componentlist) .hascolumnname("component_list"); property(e => e.status) .hascolumnname("status"); //result table property(e => e.maximum) .hascolumnname("maximum"); property(e => e.minimum) .hascolumnname("minimum"); property(e => e.outofrange) .hascolumnname("out_of_range"); property(e => e.name) .hascolumnname("name"); property(e => e.text) .hascolumnname("text"); property(e => e.typica...

mercurial - Best way to manage Source Control for slightly different versions of the same codebase -

i've seen question asked several different ways , each time, answers workarounds or ways not have maintain 2 or more different versions. however, don't think there workarounds given environment (visual foxpro). maintain 2 different repositories: live - code in production proof - identical live testing ground of number of new features staging area changes live i don't see way handle situation branches because proof spends (if not all) of it's time looking more fork. example, there large section of code drastically different live we've been toying around year now. there's 10 minor features different live in various stages of approval. there lots of days when i'm diff'ing , merging between 2 repositories ask myself, why can't branches of same codebase. don't see how that's possible. proof living breathing thing of it's own need able compile , maintain separately live (though realize there's nothing in last statement preclu...

iframe opacity with input type=range (slider) not recognizing 1.0 -

i'm building internal tool here @ work back-end developers match front-end comps. i'm doing giving developers little toolbar in browser overlay iframe , load comp depending on checkbox click. can toggle on , off adjust opacity of iframe. i'm running problem where, slider, doesn't seem recognize '1.0' opacity. when first load up, iframe @ 100% opacity. if use slider go down in value, iframe reduces opacity. when use slider go in value, opacity increases until end, max value of 10. works 9, there no change 9 10. here's form element/slider: <input id="range" size="1" type="range" min="0" max="10" step="1" value="10"> <label id="range_label" for="range">comp opacity:</label> and event handler: $('#range').change(function() { var val = this.value; console.log(val); if (val == 10) { iframe.style.opactiy = ...

jquery - Load a partial page with class identifier -

i want load content page hosted on site. the problem target page doesn't has id, class name. so built sample proxy in php html content using get_file_contents . but next? example: <body> <span class="news">news today</span> </body> i want content inside .news if did you, you're trying print out/load part of returned string, in case .news. try following in php <?php echo file_get_contents("http://your.news/news.php"); ?> and in jquery $("#test").load('get.php .news'); try working demo

ruby on rails - Displaying div tags conditionally -

i have view lists item, reviews may/may not have. issue there arbitrary (possibly 0) number of reviews. format each review in own div element, i'll have display 'n' div elements. how can done? edit, sample element contents: <div id="promo_item"> promotion: <br> <br> <table> #rows item name, price, list-date #rows values of item name, price, list-date </table> #comment goes here </div> this example, won't implement this, know there has table values. <% @post.reviews.each |r| %> <div>stuf here <%= r.user.name #etc.... %></div> <% end %>

iphone - Core Data: Returning to a Previously Inserted Managed Object -

i have following model: doctor <-->> case <->> report a doctor has many cases case has 1 doctor. case can has many reports i generated classes representing model, , inserted 1 doctor, 1 case 1 report. how can return doctor , associate case , same report? any example one-to-many core data insertion , display. best regards when insert managed object pointer object back. assuming have nsmanagedobject subclass of doctor, create new doctor object this: doctor *newdoc=[nsentitydescription insertnewobjectforentityforname:@"doctor" inmanagedobjectcontext:mymanagedobjectcontext]; newdoc pointer doctor object , can treat other object. can retain reference way e.g. instance attribute, array, set etc. can retrieve , add new case object so: [newdoc addcaseobject:anewcase]; ...and same add report case. these methods defined in autogenerated subclasses.

drop down menu - How can I use multilanguage in Socialengine 4.x dropdown custom field -

i have site installed socialengine 4.1.2 , want add custom field has few values in , displayed drop-down. how can add custom field , able translate values in different languages. best regards you can create custom fields example in profile (manage -> profile questions) can create many language packs need under layout -> language manager. it create empty csv file in application -> languages (folders on server) find in english file text of drop down, copy in targeted languages , translate right column (in excel) or items after ";" in text editor/ide you can find custom field through language administration in backend of se sam

How to convert datetime to GMT in php -

alright, i'm not sure if im converting user input time gmt properly. having users across several timezones entering "events" , have able see "how long untill" or "how long since" current time(); this how planning convert time input. start 07/21/2011 01:30 am then, echo gmdate('y-m-d h:i:s',strtotime('07/21/2011 01:30 am')); gives me 2011-07-21 08:30:00 so planning take value of gmdate('y-m-d h:i:s',strtotime('07/21/2011 01:30 am')); take time() , display "how long until event" users. seems there 10 hours added onto result, if if scheduling event 30 min 10 hours 30 min now. so, im thinking im not converting local time correctly or something. what missing? maybe dont understand gmt. how can make sure times involved gmt times universal users on website? other info if helps: server timezone america/los_angeles edit: after everyones suggestions i've tried setting @ top of php code: date_de...

way to pin point failed item in a chunk during write in spring batch -

what ways log exact item failed during writing chunk of 10 items size ? is there way catch in onwriteerror method of itemwritelistener ? possible know extending itemwriter interface ? thanks , regards, nik you configure skip logic integer.max_value = 2.147.483.647 <step id="step1"> <tasklet> <chunk reader="flatfileitemreader" writer="itemwriter" commit-interval="10" skip-limit="2147483647"> <skippable-exception-classes> <include class="org.springframework.batch.item.file.flatfileparseexception"/> </skippable-exception-classes> </chunk> </tasklet> <listeners> <listener ref="customskiplistener" /> </listeners> </step> and use skip listener (see annotations there too) log bad items during writing if writer custom implementation, extended listener re...

Connecting to Java process running as a Windows service: How does JProfiler does it? -

how can connect trace tool jvisualvm - not using jmx - java process running windows service? the jvm running service strted when start jvisualvm, not 'see' jvm running service: there unanswered question regarding here , here . found useful tips in blog post , not work. jprofiler has magic button 'show services' solves problem: know how it? how can same connect using jvisualvm?

amazon s3 - Server Side Include on S3 -

amazon s3 has static website hosting, not support tags like: <!--#include virtual="i/header.htm" --> <!--#echo var="i/header.htm" --> <!--#include file="i/header.htm" --> is there anyway mimic functionality without having sort of javascript/ajax content request header on every page on s3? you use javascript assemble page in client browser. jquery: $('#header').load('header.html'); this has serious seo drawback-- search engines google won't see final page. you embed content in page iframe.

java - Priority Queue with a complex enum? -

i writing agent in java receives requests services various other objects in program. restriction 1 process can done @ once, means priorityqueue best way represent requests services. unfortunately, these processes stored enum many different states. there easy way write comparator order these states in way want? is, public enum agentprocess { action1, action2, action3, action4, action20 } with comparator public class processcomparator<process> { public int compare(process a, process b) { //some arbitrary ordering of processes, e.g., action3 > action19 > action4... } } i'm stuck doing like public static int getvalue(process p) { switch(p) case action1: return 5; case action2: return 29; case action3: return 18; //etc } is there way rewrite enum naturally ordered, without having define weights or switch each? three solutions come mind: you specify enum constants in order ...

Read iframe content using Webbrowser C# -

i know can access iframes using following properties of webbrowser: string html = webbrowser1.document.window.frames[0].windowframeelement.innertext; but i'm struggling cross-domain restriction.. document url www.subdomain1.sport.com/... , iframes url www.subdimain2.sport.com/... how access iframes content , put text input tag there? i think must refer following url content of iframe exists on cross domain. http://codecentrix.blogspot.com/2008/02/when-ihtmlwindow2document-throws.html

objective c - iPhone memory management -

i have been using instruments check leaks , other memory issues in program. though leaks found instruments extremely small , don't matter, have found physical memory free keeps going down while use program. i use memory monitor determine how memory app using , allocations determine happening. make sure release every time alloc or retain, , seeing how there barely leaks, i'm assuming memory management fine. does know can fix issue or reccomend way bottom of it? even tho release objects dont need, doesn't matter. allocating things , keeping them reason. can try check out: http://macdevelopertips.com/objective-c/objective-c-memory-management.html http://akosma.com/2009/01/28/10-iphone-memory-management-tips/ i advise check alloc , keep life of application , see if can make same thing without using memory. edit: have agree mark , kongress, every leak matters sake of app's life.

plsql - Using ExtractValue and XMLType in MAterialized view -

i'm trying create materialized view present tabular view on xml data contained in table. hoping use auto refresh option ensure mv date. some background: oracle 10.2 table def: create table agreementextensiondata ( agreementextensiondataid number(18) not null, extensiondata nclob, agreementid number(18) not null) example of extensiondata: <extensions> <extensiondata id="2" name="includeportfolio" type="4">true</extensiondata> </extensions> i have create log on table: create materialized view log on agreementextensiondata nocache logging noparallel primary key including new values; i trying create following mv: create materialized view mv_extagreements refresh fast on commit enable query rewrite select agreementextensiondataid, agreementid, extractvalue(xmltype(extensiondata), '/extensions/extensiondata[@id=''1'']...

java - Eclipse - Show generated class files -

Image
how can show folder (bin) class files placed after build project in eclipse? want directory show in package explorer. searched forums, can't seem find answer you can view the bin folders in navigator ( window --> show view ---> navigator ) or in project explorer ( window --> show view ---> project explorer ) . don't think can view bin folders in package explorer for viewing bin folders in project explorer , can click customize view ---> filters --> not click java output folders

How to work with Hibernate Named query and Criteria object together -

i defined hibernate named query,so getting query using criteria.getnamedquery(), here want integrate criteria object,so put constraints. any hints please. regards, raju you shouldn't add clauses pre-built named query, can create query want sqlquery class. you change named query , add clause. session.getnamedquery("findstuff").setstring("likewhat", value); where query be select * sometable somevalue :likewhat edit: you like query q = session.getnamedquery("findstuff"); string query = q.getquerystring(); // sql statement query += " , findstuff :likewhat"; // add clause q = session.createquery(query); q.setparameter("likewhat", value); but think that's hacky.

Java HashMap and underlying values() collection -

i wondering if collection view of values contained in hashmap kept ordered when hashmap changes. for example if have hashmap values() method returns l={a, b, c} happened l if add new element "d" map? added @ end, i.e. if iterate through elements, it's order kept? in particular, if addition of new element "d" causes rehash, order kept in l? many thanks! i wondering if collection view of values contained in hashmap kept ordered when hashmap changes. no, there no such guarantee. if case, following program output , ordered sequence 1-100 hashmap<integer, integer> map = new hashmap<integer, integer>(); (int = 0; < 100; i++) map.put(i, i); system.out.println(map.values()); ( and doesn't) . there class precisely you're asking for, , linkedhashmap : hash table , linked list implementation of map interface, predictable iteration order. implementation differs hashmap in maintains doubly-linked list running...

.net - What workflow framework to use in C# -

i have create workflow in c# capable of moving object (persisted database record) through approval workflow people required perform sort of action or validation. we looked @ windows workflow foundation shied away because seemed infrastructure-heavy (and besides don't microsoft products). looked @ objectflow because it's lightweight, i'm having trouble figuring out how persist & resume workflow states. seems it's lightweight. does have particular favorite framework doing workflow? i'm open ideas (even wwf, if can explain why it's favorite). as question @gsharp linked says, wf 4 isn't entirely easy use. however, objectflow has easy fluent interface light , built solid design principles. given apparent lack of decent workflow frameworks, decided pitch in , extend objectflow istatefulworkflow contains .yield() method capable of yielding workflow processing calling method it's state can persisted. the end result of work new release @ ...

c++ - Using fread/fwrite for STL string. Is it correct? -

i have structure, contain string. that: struct chunk { int a; string b; int c; }; so, suppose, cannot write , read structure file using fread , fwrite functions. because string may reserve different memory capacity. such code works correctly. chunk var; fwrite(&var, sizeof(chunk), 1, file); fread(&var, sizeof(chunk), 1, file); is there problems in it? you justified in doubting this. should stream pod types fwrite , fread , string not pod .

How do I structure my blog engine's database for multiple post types like Tumblr? -

i'm building blog engine has multiple post types, e.g.: text, image, link, quote. the way see it, have 2 options: option 1: single posts table columns, of inevitably null post table ========== * post_id * created_at * updated_at * user_id * post_type * text * image_url * link_url * quote_source option 2: separate tables each post type post table ========== * post_id * created_at * updated_at * user_id * post_type text table ========== * post_id * text image table =========== * post_id * image_url i think hint. pros/cons of each approach? does know tumblr does? (it's not clear api docs.) avoid using multiple tables entities (in case "posts"). have no idea how tumblr it, it's more similar first post, fields null in each row, , executable code evaluates post_type value determine how handle it. multiple tables become nightmare you're pulling data several tables handle "one" request. example, if wanted select posts, of ty...

jquery - Set height of content inside google maps info window -

when instantiate google maps info window, doesn't resize window match content's height. instead, adds scrollbar. in fact, doesn't seem use available height of window itself, instead instituting arbitrary size. idea how manually resize itself? can see issue here, clicking on "contact", , clicking on 1 of markers. http://presentations.superfaddev.com/ifad/v2/ifad.html turns out there's better way handle infowindows, use infobox extension, hosted here: http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/ and documented here: http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/ which solves , many other problems google's infowindow.

Adding Older iOS SDKs to Xcode 4.1 in Lion -

i installed lion , xcode 4.1. how add older sdks can build , run in 4.1 or 4.2 in iphone/ipad simulator? xcode 4.1 comes ios 4.3 sdk. does lion have sort of minimum sdk builds? thanks, actually is possible add older sdks long can still hands on older version of xcode older sdk. it's useful sometimes: when find out unsupported constants , methods may using during compile rather @ runtime. here's how it. get hold of older version of xcode older sdk. apple ios dev center lists 4.3 sdk xcode 3.2.6 download. mount dmg , open packages folder hidden within dmg via terminal: open /volumes/xcode\ and\ ios\ sdk/packages/ double click pkg file sdk version want. looking iphonesdk4_3.pkg but, in addition 4.3, found packages old iphonesdk3_0.pkg. perhaps older sdks may still packaged app store download if know find (i didn't). let install in it's own folder of choice since won't able force install in applications/xcode.app/contents/developer (which devel...

perl - Code not printing last element of array when using using CTRL+Z to end the STDIN input -

i seem have run peculiar problem. here code #read list of strings , print in 20-character column print "enter strings:\n"; chomp(@list = <stdin>); foreach $_ (@list){ printf "\n%20s", $_; } the code doesn't print last element of array if don't press enter before invoking end of file ctrl+z on windows. edit: here's sample output enter strings: v b v here pressed ctrl-z after entering b , before pressing enter, , didn't print b. if had pressed enter ctrl-z, have printed b. stdout line-buffered when going terminal; data doesn't shown until add newline. try: print "enter strings:\n"; chomp(@list = <stdin>); print "\n"; foreach $_ (@list){ printf "%20s\n", $_; } or adding $| = 1; before loop.

vb.net - Alpha Transparent PNG Form too slow -

i have problems transparent form, can help? :) problem slow :( example if click on button should switch panel control takes 3-4 seconds because of redrawing class: http://pastesite.com/22086 on form: http://pastesite.com/22087 so @ form load called redraw() , if click on button , panel switched again call redraw() form load 6 second switching panels 3-4 seconds thank you lol have answer questions! :d ok found way adding form on :)

opencv - JavaCV giving java.lang.UnsatisfiedLinkError -

alright, may "use google search this, there millions of them". however, spent day run following code every since tried got java.lang.unsatisfiedlinkerror: c:\users\hp\appdata\local\temp\jniopencv_core2477828805078034839.dll: can't find dependent libraries error drives me mad. i found javacv-bin folder includes javacpp.jar, javacv.jar, javacv-windows-x86.jar, javacv-windows-x86_64.jar . in netbeans, opened project properties , added them libraries i found opencv2.3 folder, copied , pasted c:\ directory. added c:\opencv2.3\build\bin; c:\opencv2.3\build\x86\vc10\bin; c:\opencv2.3\build\x64\vc10\bin; in path. , believe nothing left. however, every since tried got same error. i'm exhausted please me. and last say, have both 32-bit , 64-bit jdks tried both compilers it's no use. import static com.googlecode.javacv.cpp.opencv_core.*; import static com.googlecode.javacv.cpp.opencv_imgproc.*; import static com.googlecode.javacv.cpp.opencv_highgu...

Is there a way to use a function on a Microsoft SQL Server Query without using "dbo." before the function? -

is there way call user defined function without using "dbo." before function name , parameters? using: select userfunction(param1, param2, param3, paramn) instead of: select dbo.userfunction(param1, param2, param3, paramn) this isn't possible select syntax. bol states: " scalar-valued functions must invoked using @ least two-part name of function " this syntax works however. create function userfunction (@p int) returns int begin return (2) end go declare @rc int exec @rc = userfunction 1 select @rc it best practice schema qualify objects referencing anyway though avoid overhead resolving schema (and think plan cache reasons also)

mysql - Optimizing of database with multiple JOINs -

first, details website , database structure - with website can learn english words, , can insert on each word sentence, association, image, in addition - each word has category, sub category, group... my database includes 20 tables. user registers website 'add' users table 4000 rows - number of words on website. have serious problem while user filtering words (somthing 'search' word according char/s & category/s & group/s etc.. have 9 joins in sql query, , takes 1 min display results.. the target of joins - inside table users (where each user has 4000 rows / each row = word) there joins on style: $this->db->join('users', 'sentences.id = users.sentence_id' ,'left'); the same thing associations, groups, images, binds between words etc.. users table includes id of sentences, associations, groups.. , join there connection. i don't know do.. takes time. maybe problem structure of database? multiple joins? maybe using...

Silverlight, connecting service.cs and XAML.cs for database -

i've found sample showing how connect sql server (a local mdf), uses databinding, how can use sql in normal way (insert, select, update, delete..., sqldatareader, without binding), think sql staff should performed in service.cs, how can use sql xaml.cs? here service code: and here service.cs: public class servicecustomer : iservicecustomer { public clscustomer getcustomer(int intcustomer) { sqlconnection objconnection = new sqlconnection(); dataset objdataset = new dataset(); sqldataadapter objadapater = new sqldataadapter(); sqlcommand objcommand = new sqlcommand("select * customer customerid=" + intcustomer.tostring()); objconnection.connectionstring = system.configuration.configurationmanager.connectionstrings["connstr"].tostring(); objconnection.open(); objcommand.connection = objconnection; objadapater.selectcommand = objcommand; objadapater.fill(objdataset); cls...

ruby - Strange Behavior with mongoid date range query. - Rails 3 -

i running in strange date range query problem. when use datetime.now.utc option query database, query date datetime.now different current datetime.now(i.e. 1 that's returned on console.) my mogoid.yml uses- use_utc: true i have named scope - scope :running_auctions, { :where => { :end_time.gt => datetime.now.utc }, :order_by => [:end_time, "asc"] } and on console can - loading development environment (rails 3.0.7) irb(main):001:0> auction.running_auctions => #<mongoid::criteria selector: {:end_time=>{"$gt"=>fri jul 22 00:42:38 utc 2011}}, options: {:sort=>[:end_time, "asc"]}, class: auction, embedded: false> notice date here fri jul 22 00:42:38 utc 2011 irb(main):002:0> datetime.now => fri, 22 jul 2011 11:42:56 +0530 irb(main):003:0> datetime.now.utc => fri, 22 jul 2011 06:12:59 +0000 notice here datetime fri, 22 jul 2011 06:12:59 +0000 what making query date older ...

How to find file types in objective c -

i have done lot of research on , haven't found useful. want making simple program in objective c personal use opens files , gives information them. problem have encountered cannot find file of file opening. without looking @ extension, there way find full file format of file in objective c? if possible, able save file in different format. information on subject important application. appreciated. mac os x has type information attached each file specifies type of file supposed be. information given application last saved file, not correct. also, new versions of os x ignore information , go entirely off of file extension. however, information still stored , can retrieved using nsfilemanager's attributesofitematpath:error: method. as mentioned quixoto above, os x maps extensions utis. uti of file can retrieved using nsworkspace, can tell uti means. code localized description of file @ /full/path/to/file : nsworkspace *ws = [nsworkspace sharedworkspace]; nsstrin...

javascript - jQuery $.ajax to pass multidimensional array to PHP -

i using jquery , php write json data server. i'm processing decent amount of repeating numeric data (~.75kb), want pass data php in form of multidimensional array. at moment cannot manage data php in form can recognize. i've tried various combinations of sending/receiving arrays , objects no success. the best case scenario 1 in pass array php , php converts readable form. i'd rather not use associative arrays or serializing on part of javascript. code... giving me 500 internal server error, no longer occurs if omit passed data variable. (i'm not yet using $data in php file yet because know it's not working.) function generatedata() { // code here return [ one[ sub_one[], sub_two[] ], two[], three[], four[] /* etc... */ ] } function savedata() { $.ajax({ url: "scripts/save.php", data: { "area":"testing", "location":"testing", "name":...

php - Select from database and store in an array -

i want select data db , store in array. suppose have column "keyword" in db table. want select rows keyword column "nature". i trying following code: <? $term= "nature"; $arr = array(); $sql = "select keyword keywords keyword '%$term%'"; $result = mysql_query($sql) or die(mysql_error()); $rows = mysql_fetch_array($result); foreach ($rows $row){ array_push($arr, $row['keyword']); } print_r($arr); //output: array ( [0] => n [1] => n ) ?> so result db should return 1 keyword 'nature' need store in array. why storing same string 2 times? there no other row in db similar term nature. why storing first letter in array? shouln't store "nature" instead of "n"? please me fixing this. should like $term = "nature"; $arr = array(); $sql = "select keyword keywords keyword '%$term%...

php - If I learn Codeigniter, can I use it with Drupal or is that a bad idea and I should use Expression Engine? -

will learning codeigniter (or framework matter such cakephp or zend) development in drupal or 2 separate systems won't benefit other when have knowledge in one? i know expression engine cms developed codeigniter in mind, drupal has larger community , hoping i'd still able stick drupal , see if me knowing codeigniter (currently i'm studying, haven't gotten drupal yet) of use developing in drupal. drupal & codeigniter different php frameworks (drupal considered cms became framework). work/learning in codeigniter undoubtedly give perspective when working drupal , grow coding skills, wont learn drupal core api's , methodologies. i recommend getting drupal cause it's hawt (in demand), once head around assumptions & common patterns helps build things fast, community huge , cool kids doing it. if learning codeigniter , want leverage learning in ee, makes perfect sense...and if that's you/your clients want, rock on. to start drupal recomme...

php 5.2 - Calculating how many 'Midnights' is one date past another in PHP? -

i have start/end times calculation i'm trying , having problem seeing if end time before 12am day after start time. also, need calculate how many days past start time is. what have: start date, end date what need: - how many 'midnights' end date past start date? has done this? this uses php 5.3, if have earlier version may need use unix timestamps figure out difference. number of midnights should number of days difference assuming both start , end times have same time. setting both midnight of current day settime(0,0) , should make calculation correct. using datetime objects. $start = new datetime('2011-03-07 12:23:45'); $end = new datetime('2011-03-08 1:23:45'); $start->settime(0,0); $end->settime(0,0); $midnights = $start->diff($end)->days; without using settime() calls, result in 0, because there less 24 hours between start , end. settime() results in 1 because difference 24 hours. the diff() function introduce...

Parsing word list in python -

i have wlist.txt file of 58k words of english language, small excerpt of looks : aardvark aardwolf aaron aback abacus abaft abalone abandon abandoned abandonment abandons abase abased abasement what have program search through list , see if word contained in list, , if print word. issue code have written return no, word not in list, when know sure is. code looks this, notice bugs? match = 'aardvark' f = 'wlist.txt' success = false try: word in open(f): if word == match: success = true break except ioerror: print f, "not found!" if success: print "the word has been found value of", word else: print "word not found" thanks in advance everyone!! as others have said, problem stems fact newline characters part of words reading in. best way rid of these use strip() method of str . in addition, code accomplish simple task. need build set word list , occurrence of word in set....

exception - super statement in C# -

i'm creating class manage exception in c#, , i'd create constructor methods recalls superclass; definition of class: class datasourcenotfoundexception: system.exception but since in c# there no super method supposed call constructor methods of system.exception ? you call parent constructor using base before body of constructor: public class fooexception : exception { public fooexception(string message) : base(message) { } } obviously don't have pass parameter own constructor argument base constructor: public class fooexception : exception { public fooexception(int x) : base("hello") { // x } } the equivalent chain constructor in current class use this instead of base . note constructor chaining works very differently in c# compared java, respect when instance variable initializers run. see article on c# constructors more details.

c++ - Writing a function using a macro with variable number of arguments -

how write macro variable number of arguments define function? suppose define class class1 2 parameters , class class2 3 parameters. class class1 { public: int arg1; int arg2; class1(int x1, int x2): arg1(x1), arg2(x2) {} }; class class2 { public: int arg1; int arg2; int arg3; class1(int x1, int x2, int x3): arg1(x1), arg2(x2), arg3(x3) {} }; for each class define or classes have been defined before want write following: template<> inline void writeinfo<class1>(const class1& obj, file* fp) { writeamount(2, fp); writename("arg1", fp); writeinfo(obj.arg1, fp); writename("arg2", fp); writeinfo(obj.arg2, fp); } template<> inline void writeinfo<class2>(const class2& obj, file* fp) { writeamount(3, fp); writename("arg1", fp); writeinfo(obj.arg1, fp); writename("arg2", fp); writeinfo(obj.arg2, fp); writename("arg3", fp); writeinfo(ob...

How can my Perl code catch Ctrl+D? -

chomp($input = <>); how know whether $input ctrl + d ? you know have reached eof when undef <> , in case chomp hiddening it. the usual perl idiom read until eof follows: while(<>) { chomp; # whatever want line in $_ # ... }

javascript - jquery plugin development pattern -

that how implement plugins: (function($){ $.fn.plugingname = function(insettings){ //code extands settings default return this.each(function(){ new pluginclass($(this), settings); }); } pluginclass = function(jelem, settings){ //here put variable , function in such way compose better var events = { onmouseup : function(){ //some actions }, onmousemove : function(event){ //some actions }, //etc. }, draw = { drawgrid : function(){//some actions}, //etc. }, //etc. /***************************** * place of question ****************************/ } })(jquery); i want know if there pattern separate algorithm declaration part described above. thing put algorithm part inside function main(){ }(); if there better approach distinguish main part of...

css - How can i set thickness of horizontal rule in html -

how can set thickness of horizontal rule in html/css you use size property: <hr size="3" /> please note deprecated. should use styles resolve this. hr { height: 3px; }

groovy - java code to instantiate another java file -

i want write program dynamically invoke method inside java class (uncompiled) file name location given. i've used following code wasn't working. //folder location of java file loaded string url = "c:/temp/testcases/test.java"; //name of java file loaded string classname = "test.java"; this.class.classloader.rootloader.addurl(new url(url+str)); class.forname(str).newinstance(); the above instance unable invoke method inside java file want load dynamically. error in it? the class loader able load compiled classes. it's not able open java source files, compile them on fly, , load class. moreover, class name not same file name.

Android: different components for different screens -

i need create application similar file browser - opportunity move through files tree , looking files. what want - make 1 app both phone , tablet. on tablet want "split view based application" on ipad on phone want have button shows activity files tree (which on left on tablet) is possible? need have tablet-only-oriented activity 2 groups (left 1 - files tree, right - file preview) i read "supporting multiple screens" on android dev. speak different layouts of same components on different types of screen - want add there few "tablet-only" , "phone-only" components... or it's dead-end? it possible. recommend fragments task. introduced honeycomb , kind of reusable ui parts have in mind. there compatibility lib lower android versions (i believe down 1.6.) inside android-sdk/extras/android/compatibility.

c# - Back to List Previous Next control in .NET issue -

i need because didn't find out solution project using mvvm. in 1 hand have default.aspx contains updatepanel 2 user controls. first control filtercontrol fields filter. second control gridview allows pagination , populates data database when press button search in filtercontrol. let's query returns 100 records. if set pagesize 20 results have 5 pages in gridview ok? on other hand have details page formview recieves id parameter of item gridview , shows information it. above of asp:formview code have user control gets data filtered gridview in session variable throught corresponding viewmodel, , calculates items should next , previous have 1 "back list" link , "previous" , "next" links. previous , next links loads correctly. linkbuttons onclick event makes response.redirect(prevlink); example, prevlink link page redirects ~/details.aspx?id=5). i controlling navigation asynchronously throughout eventhandler , historyeventargs when press but...

c# - How can I add 2 autonumber columns in MS Access -

i coding webpage asp .net c# i need add 2 autonumber fields in ms access don't let me it. did this: field size = replication id sequential= yes, without replication but column (it calls unique_id ) had value ={bbeb19c8-9c6d-4a1d-b966-a409a849d417} . result, want add second autonumber field ms access database. how can this? a "replication id" guid. has in order form of replication work. also, can't have 2 auto number columns in same table. it's kind of pointless. just give idea on why there's no reason this, consider following hypothetical table definition. cars id : autonumber otherid : autonumber name : varchar(100) if insert record name value of "ford" you'll have record looks like: 1, 1, ford when insert second record, chevy, like: 2, 2, chevy note how both id fields have same value? now, let's modified table definition seed "otherid" starting @ value 100. doing same inserts yield: 1, 1...

silverlight - Expand a control to fill grid column -

i'm having problem getting panelbar expand it's width match grid column occupies. offending code second appearance of panelbar item header named "operators". can set width explicitly fill column, show correctly specific resolution , not solution i'm looking for. stretch on it's own. code snippet below. <telerik:radtabcontrol telerik:stylemanager.theme="windows7" grid.column="2"> <telerik:radtabitem header="add/edit"> <grid showgridlines="true"> <grid.rowdefinitions> <rowdefinition height="auto"></rowdefinition> <rowdefinition height="auto"></rowdefinition> <rowdefinition height="*"></rowdefinition> </grid.rowdefinitions> ...

c# - Debugging a Windows Service -

i making windows service , want debug it. this error when try debug it: cannot start service command line or debugger. windows service must first installed , started server explorer, windows services administrative toll or net start command. i have installed service using installutil , still facing problems. also, when try attach process, service goes running mode, never starts debugging. edit: have reinstall windows service everytime make change or building suffice? in onstart use this: #if debug if(!system.diagnostics.debugger.isattached) system.diagnostics.debugger.launch(); #endif

java - JScrollPane problem high position -

i have problem jscrollpane can not switch high position, tried everything: setvalue(0); setcaretposition(0); getviewport().setviewposition(new point(0,0)); finally ... one thing works putting use of showmessagedialog, prefer avoid ... that's part of code: public class fenetre_departement { private static final long serialversionuid = 1l; private jpanel container = new jpanel(); private vector<component> sous_titrecomp = new vector<component>(); public jpanel getcontainer() { return container; } public void setcontainer(jpanel container) { this.container = container; } private imageicon icon; private imageicon icon2; private imageicon icon3; private jtextarea titre = new jtextarea(""); private jtextarea texte = new jtextarea(""); private jtextarea titre2 = new jtextarea(""); private jtextarea texte2 = new jtextarea(""); private jtextarea ...