Posts

Showing posts from May, 2015

android - Populating a list view from SQLite Database -

i'm new android. i'm trying populate listview sqlite database.i know how using arrays. can me doing this? know there away adapt following code , using populating listview using sqlite don't know how it. public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.list_item); final listview lt = (listview)findviewbyid(r.id.listview01); list<string> w= new arraylist<string>(); arrayadapter<string> aa; w.add("waka"); w.add("weka"); w.add("woka"); aa = new arrayadapter<string>(this, r.layout.listw, w); lt.setadapter(aa); lt.settextfilterenabled(true); lt.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> a, view v, int position, long id) { final string aux= (string) lt.getitematposition(position); ...

xamarin.android - Async web service call in custom list adapter -

i have problem when calling web service asynchronously in monodroid. call seems work correctly, application crashes everytime when process response. program behaves differently when run in emulator , when run on phone (samsung galaxy s w 2.2.1 froyo.xwjs8). thinking of creting threads myself, don't know if solves problem. same code works fine when used in windows phone 7 application. the code async method call (note: in reality showmessage calls write android.util.log.debug) private void callws(string _input) { messagebox.getinstance().showmessage("search async started, input: " + _input); m_waitingrequest = new requeststatus() { waiting = true, newestinput = _input, originalinput = _input }; connectormobile.userinformation ui = new connectormobile.userinformation() { username = m_appsettings.getvalue<string>(appsettings.ws_username_name), password = m_appsettings.getvalue<string>(appsettings.ws_password_name) }; messagebo...

ruby - Is it possible to ask Factory Girl what associations a given factory has? -

factory girl incredibly useful functional testing, has 1 annoying property makes harder use in unit tests, don't want rely on test database. use factory.build create factory can pass around or assign activerecord.find call using flexmock : require 'test_helper' require 'flexmock' class somemixintest < activesupport::testcase include flexmock::testcase def setup @foo = factory.build(:foo, :id => 123, :bar => factory.build(:bar, :id => 456, :baz => factory.build(:baz, :id => 789) ) ) flexmock foo, :find => @foo end def test_find_by_reverse_id assert_equal @foo, foo.find_by_reverse_id(321) end end this pattern nice, since cares not presence of database, , runs faster if objects had persisted. however, bit annoying have build associated objects manually. if don't, associated objects are created in database build call, if had used create instead. assert_equal [], foo.all fo...

asp.net web service error "messages includes expiry but clocks are not synchronized" -

i got error: messages includes expiry clocks not synchronized while calling web service. when fiddle .net generated soap request see expired timespan node in soap header. how can remove or modify .net generated expired timespan?

tortoisesvn - Generate history of changes on a file in svn -

is possible generate file, includes summary(what, when, whom ) of changes made on file? used have such option in vss(i think called "history"), , great going , tracking made change , when. btw, i'm using tortoisesvn thank in advance right click on file in explorer, "tortoisesvn", "show log". uncheck "hide unrelated changed paths" uncheck "stop on copy/rename" check "include merged revisions" click "show all" now, in top pane list of revisions username, date , log. click on revision you're interested in , can see full log in second pane. third pane shows every file changed in chosen revision. double-click on file in pane , can see changes made in file. as remarked previously, tortoise has "blame" functionality insightful can show recent edit on each line of source. , if has deleted lines, don't see change @ all. edit: if you're willing go command-line tool , bas...

linq - How to convert varBinary into image or video when retrieved from database in C# -

i using visual studio 2010, (desktop application) , using linq sql save image/video or audio files databse in datatype varbinary (max). can do... problem is, can't them , display them in xaml because can't converting part correct. here have far (though not working); private void bt_click (object sender, routedeventargs e) { databasedatacontext context = new databasedatacontext(); var imagevalue = s in context.images s.imageid == 2 select s.imagefile; value = imagevalue.single().tostring(); //convert string , taking down next method converted in image } public string value { get; set; } public object imagesource //taking http://stackoverflow.com/ { { bitmapimage image = new bitmapimage(); try { image.begininit(); image.cacheoption = bitmapcacheoption.onload; ...

Excel (.xlsx) to PDF using Java -

is possible .xlsx pdf conversions using docx4j? if so, provide me samples please? if isn't possible, alternatives suggest? i don't think can use docx4j convert xlsx pdf. can use docx4j manipulate excel xlsx, not pdf. need java lib manipulating pdf, recommond itext

serialization - Should iOS app's plist be compressed for optimization purposes? -

the app have under development utilizing lot of plist that's taking lot of space. considering zipping plist files. @ runtime, app unzip them nsdata , deserialize them nsdictionary using nspropertylistserialization eventual use. is there risky approach? or useless if property list output encoding set binary. if getting point you're considering zipping property lists save on space, think it's time move different format. property lists storing few defaults or settings, they're not replacement database. my recommendation @ moving data core data database. if trying embed large digital files elements in property list, @ storing separate resources in application bundle or in application's /documents directory. core data allow lazy-load items need them, saving on load times , memory, , sqlite base provide fast read / write times.

mysql - primary key with multiple column lookup -

i new databases. if make primary key 2 columns, userid , dayofweek . how can search primary key? (dayofweek int 1 = monday, 2 = tuesday, etc.) would use: select * userid = 1 , dayofweek = 4 would scan entire database or use information provided primary key? there more appropriate query use? a primary key index internally other index, except you're explicitly saying this key uniquely identifies record. it's index "must unique" constraint imposed on it. whether db uses composite primary key depends on how specify key fields in query. given pk(userid, dayofweek), then select * mytable (userid = 1); select * mytable (userid = 1) , (dayofweek = 4); would both use primary key index, because you've used fields in order they're specified within key. however, select * mytable (dayofweek = 4) will not, because userid not specified, , userid comes before dayofweek in key definition.

computer vision - C++ with OpenCv OR C# with aforge.net -

now have project sign language recognition , accomplish project need program image processing,detection,tracking,recognition phases....etc i know best use: vc++ opencv or vc# aforge.net ? thanks in advance :) the short answer is, know. things consider: operational: know? know c++ , c# equally well? feel comfortable in? based on windows? application run on windows? engineering: have work in real time? how important it works in real time? how many man hours have project? scientific: methods plan use? sure these methods work or there trial , error required? as can see, there no "best" in type of things tradeoff, balance between many competing needs.

xcode4 - Error: No executable file specified -

suddenly program runs , compiles without error not open executable. error dialog: error starting executable... no executable file specified. use file or exec-file command i think may have started when created "workspace" of same name. did searches error found nothing made sense. i hate have copy work on new project because of this. help! could bug? if using gdb default debugger (verify under product-edit scheme menu) must specify executable path contained under app folder (executable.app/contents/macos/executable).

Login with Android using Ksoap -

i trying make login android application using ksoap. here code: @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); this.login = (button) this.findviewbyid(r.id.btn_sign_in); this.login.setonclicklistener(new onclicklistener() { @override // action of button public void onclick(view v) { username= (edittext)findviewbyid(r.id.txt_username); password= (edittext)findviewbyid(r.id.txt_password); string username = username.gettext().tostring(); string password = password.gettext().tostring(); soapobject loginrequest = new soapobject(namespace, method_name); loginrequest.addproperty("username", username); loginrequest.addproperty("password", password); soapserializationenvelope soapenvelope = new soapserializationenvelope(soapenvelope.ver11); soapenvelope.dotnet=true; soapenvelope.setoutputsoapobject(loginr...

alerts - Minor Javascript Puzzle -

in bit of javascript, idea count forward clicks, until reach '5'; should go back. count=0; function remote(w) { count++; if (count < 5 ) { (var i=1;i<=5;i++) { var g = document.getelementbyid("searchme").value = w+count; } }else if (count > 4) { (var i=5;i > 0;i--) { //alert(i); var q = document.getelementbyid("searchme").value = w+count; } } } however, works if there alert. how 'i' value form, or so? oh, quick response, all. prompted me work out something: var f = 0; var s = 0; function updown() { if (s < 5 && f==0){ countup('no.'); if (s==5){f=1} }else if(s > 0 && f==1){ countdown('no.'); if (s==0){f=0} } } function countup(w) { s++; var el = document.getelementbyid('box03').innerhtml = w+s; } function countdown(w) { s--; var el= docum...

sql - Separation of JOIN and WHERE clauses -

i have written same join 2 different ways: select one.first, two.second, three.third onetable 1 inner join twotable 2 on one.twokey = two.onekey inner join threetable 3 on two.twokey = three.twokey , one.onekey = three.onekey 1=1 , one.firstnamefield in ('first name', 'second name', 'third name') , two.secondnamefield not in ('last name', 'sirname', 'family name') , three.thirdnamefield = ('nick name', 'pen name', 'handle') and select one.first, two.second, three.third onetable 1 inner join twotable 2 on one.twokey = two.onekey , one.firstnamefield in ('first name', 'second name', 'third name') , two.secondnamefield not in ('last name', 'sirname', 'family name') inner join threetable 3 on two.twokey = three.twokey , one.onekey = th...

php - Tank_Auth on IE7 -- login redirects to 404 error -

i using ci 2.0 , tank_auth. on ie7 (win xp), there weirdest behavior. fill out login page info, , when click on "login", takes me 404 error on page: http://example.com/auth/index.html my ci error logs show this error - 2011-04-11 13:00:49 --> 404 page not found --> auth/index.html needless say, not happen on other browser, including ff, cr, saf and ie8 . i have read several issues re cookies ie7, have made changes cookie names (removing underscores) , duration no avail. wonder if has cookies @ all. does have suggestion how should troubleshoot this? i've been trying issue @ ci forums, no solution. any roadmap or advice appreciated. this sound weird. controller/method login form posting to? have tried making simple form not using tankauth see if problem recreated? first troubleshooting without tankauth , see how on, gradually building functionality troubleshoot.

c++ - Using a class function in int main() -

i having problems calling functions main program. these functions have in class. how access them int main()? #include <iostream> #include <stdio.h> #include <pthread.h> #include <stdlib.h> #include <math.h> #include <sys/types.h> #include <semaphore.h> #include <synch.h> using namespace std; class mycountingsemaphoreusingbinarysemaphore { public: void waitsemaphore(pthread_mutex_t *thread) { pthread_mutex_lock(*thread);// makes value 1 (not available) } void signalsemaphore(pthread_mutex_t *thread) { pthread_mutex_unlock(*thread); // makes value 0 (available) } void deletesemaphore(pthread_mutex_t *thread) { pthread_mutex_destroy(*thread);// deletes } }; int readercount; int database = (rand() / 100); // number less 1000 void reader_writer(void); int main(int argc, char *argv[]) { mycountingsemaphoreusingbinarysemapho...

Simple Ruby Regex for JSON string -

i have following simple json string: {\"exclude\"=>[4, 5, 6, 10], \"include\"=>[]} and i'd extract each number in array following "exclude". in other words, i'd expect 0th match numbers, first match 4, second 5, , on. many thanks. maybe not single neat regex might hope for: s = '{\"exclude\"=>[4, 5, 6, 10], \"include\"=>[]}' all_numbers = s[/\[[\d,\s]+\]/] # => "[4, 5, 6, 10]" all_numbers.scan(/\d+/).map { |m| m.to_i } # => [4, 5, 6, 10] # depends how trust regex grabs result all_numbers. eval(all_numbers) # => [4, 5, 6, 10] # one-liner. s[/\[[\d,\s]+\]/].scan(/\d+/).map { |m| m.to_i } # => [4, 5, 6, 10]

internet explorer - IE displaying form showing extra text -

i have form on www.circlestarpetresort.com shows correctly in except ie. ie has "3 4" showing above "check availabilty" submit button. i've looked through html , can not figure out ie getting "3 4". these last 2 options in pets select box. should add doctype beginning of html such as: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> this should clear up

asp.net - Save a file locally -

i want save xml file using xml serialization on server , restore object value xml. the problem xml file keeps disappearing if rebuild. how should save file , ensure remain there? you should review using system.io in asp.net starting point. a safe store files app_data , mentioned earlier.

c# - Pressing a Key in a game which will make my program click 'Start' -

i doing program announce , countdown example lets 5 minutes, when press start button count down 5 minutes 0, the thing have this: if in full-screen game, example world of warcraft , league of legends, or game full screen graphics , press numpad 8 , want program click start on button 1 . this should possible since i've seen before don't know how it. it may solve problem http://www.codeproject.com/kb/cs/globalhook.aspx

jquery - Autosize div height after inner html has been changed by javascript -

here's site located: http://pwnage.me/ javascript located here: {site}/scripts/main.js i'm using jquery dynamically load content #container div on main page. when click link on main page (eg. "test project 1"), loads content ajax.php , sticks new html in #container div. i've tried tons of different solutions can't height fit new content. ends extending past end of div. however, if go http://pwnage.me/projects/test , works intended. tried same way use on page load, doesn't work: $('#container').html(d); var h = $('#container').height(); $('#container').html(load_html); // load_html predefined var holds html of loading image $('#container').animate({ height: h, opacity: 0 }, 300); // open new height , fade out loading image settimeout("$('#container').html(d);", 300); // d saved in global var works settimeout("$('#container').animate({ opacity: 1 }, 300);", 300); so should: ge...

c# - EF 4.0 Self-Tracking Entities, intended updates are being translated into inserts -

let's assume below method lives in wcf service. ui retrieved instance of status object, , makes subsequent call service using method. instead of assigning status user expect, attempts insert status. doing wrong? void method(status status) { //not sure if needed, status never changed context.statuses.applychanges(status); //get first user database user user = context.users.where(u => u.id = 1).first(); //set user status existing status user.status = status; //this throws exception due ef trying insert new entry //into status table, rather updating user.statusid column. context.savechanges(); } the problem working attached user. when ste attached context behaves in same way other entity. more on self tracking mechanism not activated. must attach status context before set user or tracked new entity has inserted: void method(status status) { user user = context.users.where(u => u.id = 1).first(); context.attach(s...

How to find if a file contains a given string using dos command line -

i trying create batch (.bat) file windows xp following: if (file.txt contains string 'searchstring') (echo found it!) else(echo not found) so far, have found way search strings inside file using find command returns line in file finds string, unable conditional check on it. for example, doesn't work. if find "searchstring" file.txt echo found it! nor this: if find "searchstring" file.txt=='' echo not found any ideas on how can done? watch post . accepted solution seems right 1 too.

osx - Why is the android sdk failing to install? -

i setting android development environment using these instructions: http://developer.android.com/sdk/installing.html when step 4, , type 'android' following error: /users/user1/programming/android\ development/android-sdk-linux_x86/tools/android ; exit; user1-macbook-pro:~ user1$ /users/user1/programming/android\ development/android-sdk-linux_x86/tools/android ; exit; starting android sdk , avd manager no command line parameters provided, launching ui. see 'android --help' operations command line. exception in thread "main" java.lang.unsatisfiedlinkerror: no swt-gtk-3550 or swt-gtk in swt.library.path, java.library.path or jar file @ org.eclipse.swt.internal.library.loadlibrary(unknown source) @ org.eclipse.swt.internal.library.loadlibrary(unknown source) @ org.eclipse.swt.internal.c.<clinit>(unknown source) @ org.eclipse.swt.internal.converter.wcstombcs(unknown source) @ org.eclipse.swt.internal.converter.wcstombcs(unknown so...

enterprise library - Logging Application Block - Priority, Category values -

i looking best practices regarding usage of enterprise library's logging application block , priority, category , severity values 1 should use. when comes severity, answer quite simple: use 1 of system.diagnostics.traceeventtype enums. but priority int , category array of strings. not sure best practice when comes these 2 values.... here 2 schemes have come when comes category: use class name category use predefined category different types of messages except application (eg: exception, information, etc...). advantage of 1: allows give great control on classes want logging @ given point. (specify class name , severity control logged , logged). disadvantage of 1: can unwieldy, may have 100s of categories , there no easy way setup configuration capture exceptions in application. advantage of 2: exact opposite of 1, makes real easy specify want exception messages go , allows turn off logging of unnecessary information. disadvantage of 2: not configurable (1...

Visual Studio Output Window Error - C++ -

using visual studio 2008, keep seeing error in output window: _crtdbgreport: string long or io error i have lot of trace macros scattered throughout code used dump information error conditions: file path, line number, error, etc. need trace down source of error because may information trying dump output window long. maximum length of string trace macro can accept? here example of how typically use macro: trace(_t("createnotifywindow : failed create handle notify window thread.\r\n\terror: %d\r\n\tfile: %s\r\n\tline: %d\r\n"), ::getlasterror(), _t(__file__), __line__); any thoughts appreciated. thanks. ultimately i'll bet problem passing object string instead of string.c_str() macro. trace uses variadic argument passing to, ultimately, calls in vsnprintf() family %s processing. cannot deal objects because c can not. the maximum length outputdebugstring 4k bytes minus fraction , due implementation.

visual studio - How easy is it to roll back a file that has been checked in in TFS -

i've (apparantly) checked in (added) file shouldn't have been added branch. since 20 or changesets have been added repository , our guy leads team chewing ear off telling me it's 'pain in ass' revert out. i'm used working subversion , it's few clicks , it's out. how easy in tfs? office politics going on , guy arsehole, i've got feeling he's making far bigger issue earn brownie points, or make me i've made kind of major stuff up. appreciate if tell me it's breeze. :) tfs pita in general (personal , biased opinion). here's article on how proceed revert changes back (warning: more few clicks away).

cakephp - I'm not specifying the form action but it (automatically) gives different values in some cases -

i'm creating form using form helper, action of form specified automatically.... this form used editing post.. so, url has structure: mywebsite.com/posts/edit/id , form's action should automatically generated posts/edit/id but problem is, in cases, open html code , find form's action posts/edit without id causes update fail... i spent lot of time figure out situation brings wrong action: i'm generating fields dynamically (using javascript & ajax) depending on post's category.. when value of 1 of dynamically generated fields invalid, generated action becomes posts/edit !! i need help, cuz don't know why happening !!! , don't wanna waste more time digging core of cakephp... so, if of cakephp experts has idea this, plz me !! thank in advance ! use url parameter, allows explicitly define url form: echo $form->create('post', array('url' => $html->url(array('action'=>'edit', $id)))...

android - Java Threading Error IllegalThreadState thread already started -

whenever start thread check. did not find anywhere called start on thread without doing check below if (!mythread.isalive()) mythread.start(); nevertheless, end illegalthreadstateexception : thread started. crashes app (android). there other check need before starting thread? you should check if thread has started using getstate() , start if state new , otherwise create new thread (if needed).

how to make java starter? -

after having jar, how make starter program (for example, in windows, exe file) can start jar? try launch4j . works building java launchers project of mine.

javascript - Add event listener to all objects except for a few selected? -

i wonder how add event listener elements except few selected? prefer not use jquery, because it's harder debug on chrome's developer tools. (you can see handler attached in each object chrome's developer tools if you're not using jquery) you can use link: https://developer.mozilla.org/en/dom/element.addeventlistener it has examples , tells captures , bubbling

What's wrong with this JavaScript code? -

var allhtmlelements = document.body.getelementsbytagname("*"); (var = 0; < allhtmlelements.length; i++) { if (allhtmlelements[i].getattribute("group") && allhtmlelements[i].getattribute("index")) continue; allhtmlelements[i].style.color = "red"; } <div group="mygroup">hello</div> <div>hello</div> <div index="d534">hello</div> all divs turn red , ones group , index not stay default color. middle should turn red doesn't. the problem you're using && when should using || if (allhtmlelements[i].getattribute("group") || allhtmlelements[i].getattribute("index")) continue;

c++ - glu.h PROBLEMS! -

ok im setting visual studios c++ 10 on windows 7 can run sample progams book "opengl superbible 5th edition" i'm having major issues, in getting gltools , freeglut wok: here's how set far......................... fist followed these steps got online: first youl want download glut or freeglut, unzip ofc. - got zip file @ http://www.starstonesoftware.com/opengl/ in freeglut folder there should folder called visualstudio2008, go this. there should vs project file called freeglut, run , click finish if conversion window comes up. compile it, if when done says unable start, ok. now in same folder there should new folder called debug, have compiled freeglut :). inside find freeglut.dll. needs go system32 folder, or syswow64 respectivily. aswell there file called freeglut, type object file library. needs go lib folder in visual studio. now go main freeglut folder. there should folder called include. , inside folder called gl , 2 files. these n...

opengl - Setting transparency color on sprite bitmap makes my non-sprite quads vanish! -

writing simple game learn opengl. in current version, render method draws geometry quads code defined colors , renders sprites. far, normal , working intended. sprites have background color auqua i've been meaning set transparent, haven't yet. moment game looks normal except fact sprites appear bounded color blue. i'm @ point want blue vanish , instead transparent, modify onload method be: ... bitmap bitmap = new bitmap("rocktexture.bmp"); // existing line bitmap.maketransparent(color.aqua); // new line ... however, when run game geometry quads vanish screen! sprites remain , appear appropriately transparent. i'm not sure why happening. here render method: protected override void onrenderframe(frameeventargs e) { base.onrenderframe(e); gl.clear(clearbuffermask.colorbufferbit); gl.begin(beginmode.quads); color prevcolor = default(color); foreach (var quad in _view.geomitrylist) { ...

iphone - Using A UI Picker To Controller 2 Different Labels -

Image
i have ui issue. wanted have 2 pickers populate 2 different labels. problem using 2 pickers on ui take space on window , cannot resize pickers. i realized since using same data in each of pickers should able away using 1 picker control. except little confusing user if focus of control isnt done properly. i work kinda keyboard coming in textbox. so have simple ui get data 1: textbox1 data 2: textbox2 a picker when user clicks inside textbox1 picker appears instead instead of keyboard , populates textbox selected data off picker. same happens textbox2. can give me sample of how maybe accomplished, or better way approach this? how guys handle having have 2 dropdown menus on same window? a picker 2 components , 2 labels (or textfields) solution if text isn't long. edited add here's picker 2 components whipped together. further edited add here's code show how it's done: set components - (nsinteger)numberofcomponentsinpickerview:(u...

vb6 - VB 6 How to make Custom Collection Class to support For Each -

Image
i've been placed on project client front end written in vb 6, ack! i'm trying develop custom collection class supports for...each syntax. possible in vb 6? or stuck using for..next counter identify index. thanks help! the key part adding custom collection class... public function newenum() iunknown set newenum = m_employees.[_newenum] end function and in procedure attributes, set procedure id -4, so: ref: http://www.vb-helper.com/howto_custom_collection_with_for_each.html

.net - NServiceBus property not injecting -

i'm running nservicebus 2.0 , trying create service receive forwarded messages , drop them in (ravendb) database. admit don't have firm grasp on how nservicebus works ioc containers (nor have used spring before), may doing wrong. in iwanttorunonstartup class, i'm getting null reference exception call store.initialize(). hooking singleton correctly? there need in config files? here code: public class endpointconfig : iconfigurethisendpoint, asa_server, iwantcustominitialization { private imessagerepository _store; public void init() { _store = new ravenmessagerepository(); configure.with() .defaultbuilder() .xmlserializer() .unicastbus(); configure.instance.configurer.registersingleton<imessagerepository>(_store); } } public class startupconfig : iwanttorunatstartup { public imessagerepository store; public void run() { store.initialize(); } public v...

Secure Options for storing Openssl password on a server (Linux, Python, CherryPy) -

i've implemented http server (cherrypy , python) receives encrypted file client (android). i'm using openssl decrypt uploaded file. i'm using openssl -enc -pass file:password.txt -in encryptedfile -out decryptedfile perform decryption on server side. can see password used openssl stored in plain text file (password.txt). is there more secure way store openssl password? thanks. pass through higher fd, , use fd in command line. note you'll need use preexec_fn argument set fd before process gets run. subprocess.popen(['openssl', ..., 'file:/dev/fd/12', ...], ..., preexec_fn=passtofd12(password), ...)

iphone - What is the difference between -viewWillAppear: and -viewDidAppear:? -

what difference between -[uiviewcontroller viewwillappear:] , -[uiviewcontroller viewdidappear:] ? in general, do: 1) viewdidload - whenever i'm adding controls view should appear view, right away, put in viewdidload method. method called whenever view loaded memory. example, if view form 3 labels, add labels here; view never exist without forms. 2) viewwillappear : use viewwillappear update data on form. so, example above, use load data domain form. creation of uiviews expensive, , should avoid as possible doing on viewwillappear method, becuase when gets called, means iphone ready show uiview user, , heavy here impact performance in visible manner (like animations being delayed, etc). 3) viewdidappear : finally, use viewdidappear start off new threads things take long time execute, example doing webservice call data form above.the thing because view exists , being displayed user, can show nice "waiting" message user while data.

Android window title bar icon is causing background for list view items -

Image
programmatic setting window title bar icon causing every list view item has tile bar icon background. setfeaturedrawableresource(window.feature_left_icon, r.drawable.ball); how can remove listview background image or set window title bar icon other way programmatic? with window title icon set with out window title icon --update <?xml version="1.0" encoding="utf-8"?> <!-- sets text styles --> <resources> <style name="customwindowtitletext" parent="android:textappearance.windowtitle"> <item name="android:textsize">24dip</item> <item name="android:textcolor">#ffffff</item> <item name="android:textstyle">bold</item> <item name="android:typeface">normal</item> </style> <!-- changes background color of title bar --> <style name="customwindowti...

android - canvas.drawBitmap() only honors alpha layer when it is 0 -

i loading png resources bitmapfactory.decoderesource , drawing them on canvas using drawbitmap() . i draw different layers 1 @ time transparent objects should occlude supposed to, when have alpha levels in pngs above 0 seem ignored. places alpha 0 aren't rendered correct, alpha less 255 instead of blending color existing color @ pixel draws without alpha blending @ all. how can draw bitmap on canvas proper blending based on source images' alpha channel? pertinent code snippets follow: bitmapfactory.options opt = new bitmapfactory.options(); opt.inpreferredconfig = config.argb_8888; ... decorationtextures[1] = new texturestatic(bitmapfactory.decoderesource(resources, r.drawable.ice_1, opt)); decorationtextures[2] = new texturestatic(bitmapfactory.decoderesource(resources, r.drawable.ice_2, opt)); ... if(mtexture != null && minplay) { if(mzone != null) canvas.drawbitmap(mtexture.getbitmap(), mscreenx + mzone.get...

How to compare Rails Form Parameters? -

so making program has script "set of steps complete task" can applicable stores or select few. stores option boolean value gets stored script. when select "yes" stores should remove stores associated script if there any. script , store tables have habtm relationship. question how check inside parameter see if value of all_stores true? have tried few things , seems ignore if statement compare stores parameter true script controller def update params[:script][:store_ids] ||= [] if params[:script][:all_stores] == true params[:script][:store_ids] = [] end @script = script.find(params[:id]) if @script.update_attributes(params[:script]) flash[:notice] = 'script updated' redirect_to :action => 'index' else @categories = category_search render :action => 'edit' end end script edit view <%= form_for(:script, :url => {:action => 'update', :id =>@script.i...

c# - Dragdrop from listbox to listbox in silverlight -

i using listbox bind data coming database, once binding done there listbox have drag , drop contents of first listbox. able drag , drop nothing visible in 2nd listbox(but content moving 1st 2nd listbox). same thing tried hardcoding items in 1st listbox , worked fine. if has experienced similar kind of problem, please help. make sure you're using observablecollection when dragging , dropping between sources. if used list, listboxes not notified of change in collection.

PHP array to postgres array -

now php can't work directly wit postgresql array. example, php taking postgresql array '{"foo","bar"}' i need simple php function create multidimensional postgresql array php array. i think experimental pg_convert() isn't optimal because needs of data form simple array string database output, maybe misunderstood idea of function. for example, need convert $from=array( array( "par_1_1","par_1_2" ), array( "array_2_1", "array_2_2" ) ); $to='{{"par_1_1","par_1_2"},{"par_2_1","par_2_2"}}'; can use array_walk_recursive() convert deepest elements of array? here's simple function converting php array pg array. function to_pg_array($set) { settype($set, 'array'); // can called scalar or array $result = array(); foreach ($set $t) { if (is_array($t)) { $result[] = to_pg_array($t); } else { ...

c# - developin web app using .net need Info about Local System -

we devoloping web application using c#.net,asp.net 3.5,in need know infomation of local system installed printers? there way data using scripting languages? plz let me know if body knows answer. thanks in advance prasad we devoloping web application using c#.net,asp.net 3.5,in need know infomation of local system installed printers? are you? why formulate question. not sure doing? is there way data using scripting languages? maybe, maybe not. irrelevant, though, asp.net not using scripting langauges on server anyway. server sidel ogic ni c# or vb.net (or other .net langauge) , means not scripting langauge. if yuo talk of client side (i.e. browser: no way, , have no busienss knowing. internet not friendly place. whatever rights think want can abused bad person. , be. plz let me know if body knows answer. yes, knows answer. answers yoru question. note: did not ask answer, asked whether knows answer. now, real: yes, can. wmi friend. main pr...

c# - Input parameters validation and response -

i want validate operation parameters sent client (using iparameterinspector) in service , in case of wrong parameter input send response code part of response object instead of throwing fault exception. please let me know how can achieve this. update : if not possible iparameterinspector, other options suggest ? inspector intercepts calls service operations , performs logic validating parameters passed operation. if parameters found invalid actual service operation never gets executed, , way notify client exception (better part of faultcontract).

javascript - How to check whether Java plugins are installed or not in a browser using Code .? -

how check whether java plugins installed or not in browser using java or javascript or jsp code .? java/sun/oracle provides a deployment toolkit script in form of javascript file lets achieve need. you invoke getjres() function returns array of currently-installed jre version strings. you can install particular jre version if need to, via installjre(requestversion) function.

WAMP - PHP loads too many Extensions -

i using wamp 2.1 with apache version : 2.2.17 php version : 5.3.3 mysql version : 5.5.8 by default wamp loads these extensions core, bcmath, calendar, com_dotnet, ctype, date, ereg, filter, tp, hash, iconv, json, mcrypt, session, odbc, pcre, reflection, standard, spl, mysqlnd, tokenizer, zip, zlib, libxml, dom, pdo, phar, simplexml, wddx, xml, xmlreader, xmlwriter, apache2handler, gd, mbstring, mysql, mysqli, mhash i dont need these ! opened php.ini , put ; before lines dont want, looks ;extension=php_zip.dll wamp still shows zip extensions loaded ! wrong ? restarted wamp no effect ! to able change extension loading settings, must run wampserver administrator. (right click wampserver shortcut -> run administrator). should work now. click wamp icon in system tray, click php > php extensions , try checking/unchecking items there. should work. <-- checking/unchecking these items same editing php.ini

python - How do I exclude columns when exporting app engine data -

i'm planning data mining on django app uses appengine storing data, however, 1 of tables stores images in 2 of it's columns, , because of that, gigabytes in size it's far slow download every time want analyse new data. data mining, care plan text columns in table, how exclude columns while exporting data csv file? i'm aware there "column_list" csv connector buildupload.yaml can specify include columns when exporting data, looks still downloads entire table row before filtering out columns when it's converting appengine's intermediate sqlite3 data file csv. for reference, i'm using method described here download data http://code.google.com/appengine/docs/python/tools/uploadingdata.html , i'm open other solutions, preferably ones can automate data export every few days. as you've observed, bulkloader downloads entire record using remote_api, outputs fields care csv. if want download selected fields, you'll have write own ...

java - How to parse wsdl and xsd files? -

i've been looking way programmatically parse wsdl , associated xsd files values annotation / documentation tags. managed values wsdl using wsdl4j, how do xsd files? tried use xsom reason null. 1). hope link useful choose best parser, parse wsdl effectively . i have tried using apache woden , wsdl4j , membrane soa . among these, membrane soa seems developer friendly. 2). place dependent xsd's in folder have placed wsdl. try parsing wsdl, should work fine.

javascript - How to stop default link click behavior with jQuery -

i have link on webpage. when user clicks it, widget on page should update. however, doing something, because default functionality (navigating different page) occurs before event fires. this link looks like: <a href="store/cart/" class="update-cart">update cart</a> this jquery looks like: $('.update-cart').click(function(e) { e.stoppropagation(); updatecartwidget(); }); what problem? e.preventdefault(); from https://developer.mozilla.org/en-us/docs/web/api/event.preventdefault cancels event if cancelable, without stopping further propagation of event.

actionscript 3 - Is there any best way to implement Encryption in Flex 3 -

we have 1 application pulling confidential information 1 of product design tools. have used https channel , encrypting request parameters , data before sent web services. so, seems ok. but when gave application security auditing found have hard coded encryption key in source code. have used sothink swf decompiler swf file. caught key , raised concern on it. we have developed application using flex 3(sdk 3.4). there best way use secret key without being hard coded in source code. if come across kind of problem, please let me know. anyone, please suggest me best way use secret keys in sourcecode without being hard coded. here sample code: var currentresult:string = ""; var strdatatoencrypt:string = ""; var kdata:bytearray; var todaydate:date = new date(); kdata = hex.toarray(hex.fromstring("secretkey here")); strdatatoencrypt =username.touppercase() + "#$#" + password + "#$#" + toda...

Magento - Import pending orders through excel or csv files -

is possible import pending orders through excel or csv file in magento? if yes, how can that? thanks. there seems existing , dedicated module this, used google find this. there more!

objective c - changing a key name in NSDictionary -

i have method returns me nsdictionary keys , values. need change key names dictionary new key name values need same key,but stuck here.need help this method work mutable dictionary. doesn't check should done if new key exists. you can mutable dictionary of immutable calling mutablecopy on it. - (void)exchangekey:(nsstring *)akey withkey:(nsstring *)anewkey inmutabledictionary:(nsmutabledictionary *)adict { if (![akey isequaltostring:anewkey]) { id objecttopreserve = [adict objectforkey:akey]; [adict setobject:objecttopreserve forkey:anewkey]; [adict removeobjectforkey:akey]; } }

C# foreach iterating rule for collections -

how .net decides order of items when iterating through collections ? for example: list<string> mylist = new list<string>(); mylist.add("a"); mylist.add("b"); mylist.add("c"); foreach (string item in mylist) { // what's order of items? -> b -> c ? } i need order (accessing collection members): for (int = 1; < mylist.count; i++) { string item = mylist[i - 1]; // order need } can safely use foreach list ? other types of collections? .net doesn't decide - class implementing ienumerable decides how being done. list index 0 last one. dictionary depends on hash value of key think. list indexes 0 based, can this: for (int = 0; < mylist.count; i++) { string item = mylist[i]; // order need } and same result foreach . if want explicit stick loop. nothing wrong that.

java - Implementing an iterator for a stack -

i defined interface stringstack public interface stringstack{ //add value stack public void push(string value); //fetch top-most element of stack. element removed public string pop(); //fetch top-most element of stack. element not removed public string peek(); } further defined class simplestack uses arraylist manage stack public class simplestack implements stringstack{ private arraylist<string> list = new arraylist<string>(); public void push(string value){ list.add(value); } public string pop(){ if(!list.isempty()){ return list.remove(list.size() - 1); }else{ return null; } } public string peek(){ if(!list.isempty()){ return list.get(list.size() - 1); }else{ return null; } } now want define iterator stack class don't want use built-in arraylist iterator. came implementing inner class , ...

javascript - How to check whetherpop up blocker is turned ON or not in a browser using Code ? -

how check whether pop blocker turned on or not in browser using java or java script code ? function check () { document.login.action= url+"test.jsp"; document.login.submit(); } i call function on click of submit button how about: var mywindow = window.open (url); if (if (mywindow == null || typeof(mywindow )=='undefined')) { // popup blocker enabled } else { mywindow.close(); }

c# - Access methods of a class from a control template in a resource dictionary -

i want make windowbaseclass derives window has few custom functionalities. such windowstyle none, have own color scheme applied , have resize logic. here snippet of xaml contains 1 of 'borders' has mousemove , previewmousedown events. <rectangle stroke="{x:null}" x:name="top" verticalalignment="top" height="5" grid.column="1" grid.row="0" previewmousedown="resize" mousemove="displayresizecursor"> <rectangle.fill> <solidcolorbrush color="{staticresource ocean}"/> </rectangle.fill> in code behind have methods such resize, drag etc. when contained in window1.xaml/.cs it's working nice. now want create custom template (in resource dictionary example) color schemes , want previewmousedown rectangle point method defined in class extends window. can done? appreciated. i don't think you...

How to generate iCal file from iphone? -

i have implemented calander applicaion in want send event data through email emailid.in want attach 1 file (ical file format).so when user file , click on file automatically event added in ical. please me query. thanks in advance

orbeon - Change CSS of form builder/runner to show title and input field inline -

i want build form every input field right after title alignment. change should effect form builder @ design time , form runner should run same design view. here short want open each field in form builder. [click enter lebel] input field [click enter optional hint] and form runner show: name : aminul haque [error message/hint] address : bangladesh [error message/hint] i tried change css uri in properties-local.xml file follows , place form-runner-orbeon.css , form-runner-base.css under /apps/mycss/ directory. if change on css, no effect shown form runner. unless css wizard, wouldn't try doing this. can change/override default css comes form builder / form runner have form fields right rather below labels, isn't done in 10 lines in css.

symfony1 - How do I create a Symfony validator that needs to access other fields values? -

i want implement symfony validator validates passwords registration form, means want 'password confirm' field. how make validator somehow ties these fields together? need check if password , password confirm values match. how stuff these implemented in symfony? you can use postvalidator . check documentation, there example password confirm validation.

How to save a recorded audio in objective C (iPhone) -

i using av audio framework record audio files on iphone. here current code : nsarray *dirpaths; nsstring *docsdir; dirpaths = nssearchpathfordirectoriesindomains( nsdocumentdirectory, nsuserdomainmask, yes); docsdir = [dirpaths objectatindex:0]; nsstring *soundfilepath = [docsdir stringbyappendingpathcomponent:@"sound.caf"]; nsurl *soundfileurl = [nsurl fileurlwithpath:soundfilepath]; nsdictionary *recordsettings = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithint:avaudioqualitymin], avencoderaudioqualitykey, [nsnumber numberwithint:16], avencoderbitratekey, [nsnumber numberwithint: 2], avnumberofchannelskey, [nsnumber num...

postgresql - postgres npgsql with c# - trying to write special characters to an ascii encoded database -

i using open source library npgsql http://pgfoundry.org/projects/npgsql/ manipulate third party data on postgres database. database encoded sql_ascii. if run query using standard c# string insert cities(cityname) values("köln") the value shows in database looks more like: пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ e.g. scrambled. i've spent many hours trying use different string encodings etc no success sql_ascii means turn off encoding functionality in database. it's make sure clients use same encoding. believe npgsql use utf8, , cannot changed. so there no "the value shows in database" - depending on encoding client talks database in. the best way fix set actual encoding in database, , set useful - such utf8 or latin1.

php - json_decode help -

i have been trying use api's various services, @ moment im trying retrieve data video on vimeo, i have got file , read contents, however, not know how access each part of file returned .json. basically, how access data in json file using php thanks $file_contents = file_get_contents("http://vimeo.com/api/v2/group/awesome/videos.json"), true); read variable using: $data = json_decode($file_contents); then can access parts using: echo $data->id; echo $data->title; etc. just use print_r($data); see available fields.

How to print stringgrid to Rave report in Delphi -

how print content of stringgrid using rave report in delphi? the provided nevrona good. as general idea: 1) fill clientdataset data string grid. 2) set rvproject, rvsystem, rvdatasetconnection components 3) create rave report, create data view , connect rvdatasetconnection 4) put region on report 5) in region put databand 6) on databand put datatext components each column dataview 7) link datatext components dataview elements or can create report dynamic. best regards, radu

Regarding (count down) timer for application in asp.net c# -

hi have created online quiz. have added count-down timer,label question & radiobuttonlist answers , next button next question. have code timer timer gets start again when click next button want count down timer whole questions(quiz). count down timer code(javascript) follows: var hour=0; //specify hours counter var min= '<%= session["timer"] %>'; // specify minutes var second = '<%= session["second"] %>'; // specify seconds var lab = 'cd'; // id of entry on page counter(for question) inserted & cd span id in aspx page displaying countdown timer function start() { displaycountdown(setcountdown(hour,min,second),lab); } loaded(lab,start); var pageloaded = 0; window.onload = function() {pageloaded = 1;} function loaded(i,f) { if (document.getelementbyid && document.getelementbyid(i) != null) f(); else if (!pageloaded) settimeout('loaded(\''+i+'\',...

asp.net mvc 3 - Illegal characters in path when calling the index view from my controller -

i receiving argumentexception when invoking index action of 1 of controllers , not sure why. error message following: server error in '/' application. illegal characters in path. [argumentexception: illegal characters in path.] system.io.path.checkinvalidpathchars(string path) +126 system.io.path.combine(string path1, string path2) +38 i not sure why happening. here code controller: public actionresult index() { var glaccounts = db.glaccounts.tostring(); return view(glaccounts); } the ambiguity comes fact using string model type. ambiguity resolved this: public actionresult index() { var glaccounts = db.glaccounts.tostring(); return view((object)glaccounts); } or: public actionresult index() { object glaccounts = db.glaccounts.tostring(); return view(glaccounts); } or: public actionresult index() { var glaccounts = db.glaccounts.tostring(); return view("index", glaccounts); } not...