Posts

Showing posts from September, 2010

windows - How to use WIA in C++? -

windows - How to use WIA in C++? - i found this tutorial on using wia in c++, don't understand how utilize it. next doesn't succeed, , don't wrong here. copied code tutorial. void init() { iwiadevmgr2* devmgr; hresult hr = createwiadevicemanager( &devmgr ); if(!succeeded(hr)) { std::cout << "couldn't create wia device manager!\n"; return; } ... } hresult createwiadevicemanager(iwiadevmgr2** devmgr) { if(devmgr == 0) homecoming e_invalidarg; *devmgr = 0; homecoming cocreateinstance( clsid_wiadevmgr2, 0, clsctx_local_server, iid_iwiadevmgr2, (void**)devmgr); } by way, using windows 7 64-bit, using iwiadevmgr2 should fine. createwiadevicemanager returns -2147221008 that's 0x800401f0 when interpret/display unsigned number. should, hresult not signed type. winerror.h sdk file: // // messageid: co_e_notinitialized // // messagetext: // // coinitialize has not...

What are the equivalents in Sass and LESS of these features? -

What are the equivalents in Sass and LESS of these features? - i'm less user, i'm considering trying out sass. each of them have 1 big thing find attractive, , i'm wondering if both frameworks have equivalents (third-party programs included) reason utilize sass (afaiu): sass can set auto-compile css files, saving need manually with less, closest using simpless, still manual step reason utilize less: less elements - set of commonly used mixins (e.g. rounded corners, box-shadow, etc.) something similar can made in sass, if not available, i'd know if it's been done few things might clear doubts: with lesscss include .js file on page doesn't require other manual step.. that's much simpler other method, , guess didn't know that. less.app mac work great, , me, it's improve launch app works type "sass --watch etc" in terminal. less.app compiles .less files on every file save, referenced in main stylesheet (simpless ...

Any way to identify F5 refresh in PHP? -

Any way to identify F5 refresh in PHP? - is there way identify whether has refreshed current page using php rather arriving elsewhere. i have access code current page can't pass page elsewhere check against. the title of question suggests you're looking way observe when page refreshed using f5 key. if that's case, you'll need javascript observe if key pressed. if don't care how page refreshed, reply should help: http://stackoverflow.com/a/456915/1144176. takes business relationship total url form content. php

exception - Blackberry Facebook NoClassDefFoundError -

exception - Blackberry Facebook NoClassDefFoundError - i'm doing dumb attempts access bb facebook functionality failing. here's code (taken straight fb sample code provided): string next_url = "http://www.facebook.com/connect/login_success.html"; string application_id = "app_id here"; string application_secret = "secret_key here"; string[] permissions = facebook.permissions.user_data_permissions; applicationsettings = new applicationsettings(next_url, application_id, application_secret, permissions); facebook fb = facebook.getinstance(as); it falls on over facebook fb ... line. any pointers anyone? grab of source - don't alter bundle names - , drop trunk on bb project. compile , run - it's namespace problem. it's error trust suggested jar. facebook exception blackberry

javascript - Replacing an element by using jQuery -

javascript - Replacing an element by using jQuery - i have html output in paging section this; <p>&nbsp;<strong class="active">1</strong>&nbsp;<a href="http://localhost/project/report_nc/search_now/1">2</a>&nbsp;<a href="http://localhost/project/report_nc/search_now/2">3</a>&nbsp;<a href="http://localhost/project/report_nc/search_now/1">next »</a>&nbsp;</p> now need add together attribute "onclick" using jquery. unfortunately "onclick" attribute cannot set jquery. @ same time came thought : taking single anchor tag (i.e. <a href="http://localhost/project/report_nc/search_now/2"></a> ) , replace new anchor tag (i.e. <a href="javascript:void(0)" onclick="myfunction(2)"></a> ). how jquery? thought post form while clicking on paging links. solved ! thank kind responses......i gue...

java - Android code lags due to logging / gc / audioManager -

java - Android code lags due to logging / gc / audioManager - to maintain simple: i'm working on little app want click several objects after each other. on clicking object, supposed play sound. this works well, except time time, entire app (including logcat's logging) freezes 5 seconds, after seems grab up. (all threads freeze) catching mean; if go on clicking during freeze, after unfreezing, still knows do. the log simple: 01-17 14:52:08.292: d/audiomanager(17963): setstreamvolume(streamtype:3, index:11, flags:0) 01-17 14:52:08.473: d/dalvikvm(17963): gc_concurrent freed 417k, 48% free 3113k/5895k, external 140k/647k, paused 2ms+4ms 01-17 14:52:09.033: d/audiomanager(17963): setstreamvolume(streamtype:3, index:11, flags:0) 01-17 14:52:09.484: d/audiomanager(17963): setstreamvolume(streamtype:3, index:11, flags:0) 01-17 14:52:10.174: d/audiomanager(17963): setstreamvolume(streamtype:3, index:11, flags:0) 01-17 14:52:10.785: d/audiomanager(17963):...

javascript - JS / Jquery - Remove multiple elements from an array by keys -

javascript - JS / Jquery - Remove multiple elements from an array by keys - i have set of keys (for illustration 2,3,4,101,102,454). i'd remove elements these keys array. there way remove them @ once? i tried iterating through for loop, , using splice remove elements 1 one, never removed elements - guess because modifies array i'm looping through. go backwards. if loop thru 0 -> n, modify indexes of elements coming after item removed. if go backwards, n -> 0, don't have problem. javascript jquery arrays

node.js - Node js - Less css cannot find file to import -

node.js - Node js - Less css cannot find file to import - i have 2 less files in public/stylesheets . using express.js serve them css files. the first file, one.less looks this: @import "another.less"; h1 { color: red; } the sec file, another.less looks this: p { color: red; } when seek load page, server quits error: file 'another.less' wasn't found. i have tried absolute path, didn't work. this express.js configuration: app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.bodyparser()); app.use(express.methodoverride()); app.use(express.compiler({ src: __dirname + '/public', enable: ['less'] })) app.use(app.router); app.use(express.static(__dirname + '/public')); }); edit: '@import "/public/stylesheets/two";' original proposal did not work. node.js less ...

image - How to output transparent PNG with Pycairo? -

image - How to output transparent PNG with Pycairo? - here's code: import cairo import os pil import image imagesize = (512,128) surface = cairo.imagesurface(cairo.format_argb32, *imagesize) cr = cairo.context(surface) cr.select_font_face("verdana", cairo.font_slant_normal, cairo.font_weight_normal) cr.set_font_size(24) cr.set_source_rgb(1, 1, 1) ... surface.write_to_png("myimage.png") as can see i'm drawing white text png, background defaults opaque black. how create png transparent white text showing? i able setup transparent background using set_source_rgba() , using 0.0 alpha value: cr.set_source_rgba(0.0, 0.0, 0.0, 0.0) # transparent black cr.rectangle(0, 0, 512, 128) cr.fill() had create sure write text this: # set writing color white cr.set_source_rgb(1, 1, 1) # write text cr.move_to(100,50) cr.show_text("hello") # commit surface cr.stroke() here's total code works me: import os pil import ima...

php - Custom Validator Issue in Zend Framework -

php - Custom Validator Issue in Zend Framework - i have form called loginform, extends recipeform in turn extends zend_form. recipefrom returns decorators. when form submitted, next error, 'message: method addvalidator not exist'. class recipe_form_loginform extends recipe_form_recipeform { public function init() { parent::init(); $this->setname('loginform') ->setaction('/login'); // add together email element $email = $this->addelement('text', 'email', array( 'label' => 'email addresses', 'required'=> true, 'size'=>12, 'filters'=>array('stringtrim'), 'decorators' => $this->getelementdecorator('email'), )); $email->addvalidator(new recipe_validate_emailaddress(), true, array( 'messages' =>...

How to Pull an RSS Feed using XmlPullParser in Android -

How to Pull an RSS Feed using XmlPullParser in Android - i'm building rss reader app, , i've been told utilize xmlpullparser interface. here block of code i'm working with: xmlresourceparser parser = context.getresources().getxml(resource); 'resource' integer r.id. integer of xml file. not internal xml file, don't know how work around this. any ideas? xmlresourceparser wrong approach project? i've seen xmlreaders used content handlers well. can integrate these technologies together? thank you what type of xml source? xmlpullparser can used parse xml sources. android rss xmlpullparser rss-reader

javascript - Selecting All Text After A "#" Symbol With Regular Expressions -

javascript - Selecting All Text After A "#" Symbol With Regular Expressions - i've got bit of jquery javascript , regex mixed in: $(function() { var regexp = new regexp("\\b(" + "hashtag" + ")\\b", "gm"); var boxlink = "<a class='taglink' onclick='tagbox()'>$1</a>" var html = $('body').html(); $('body').html(html.replace(regexp, boxlink)); }); function tagbox() { alert("it works!") }; basically applies $1 everywhere word "hashtag" appears. tagbox brings alert says works. simple enough. alter i'd create 1 won't jet select word "hashtag", words "#" symbols before them. how can accomplish , work script above? thanks in advance! first of all, $('body').html(html) bad idea. you'll recreate dom, , event listeners bound nodes within old construction no longer function. traversing d...

java - BytesMessage without OOM -

java - BytesMessage without OOM - is there way set big file in jms queue without loading whole thing in memory? let's file 100mb, can stream in , out of queue or must load whole byte array in memory? this not straight supported jms. there jms-supporting implementations, such apache activemq back upwards passing streams. see this page on activemq site more information. java jms out-of-memory

vb.net - .NET exception not appearing for some user accounts -

vb.net - .NET exception not appearing for some user accounts - i'm facing error in vb.net application shows next information: system.argumentnullexception: 'name' argument cannot null. parameter name: name @ system.data.datacolumncollection.get_item(string name) @ system.data.datarow.getdatacolumn(string columnname) @ system.data.datarow.get_item(string columnname) @ siwapro.utilities.getlabel(string frmname, string ctrlname) @ siwapro.frmhaupt.beschriften(control ctrl) @ siwapro.frmhaupt.frmhaupt_load(object sender, eventargs e) @ system.windows.forms.form.onload(eventargs e) @ system.windows.forms.form.oncreatecontrol() @ system.windows.forms.control.createcontrol(boolean fignorevisible) @ system.windows.forms.control.createcontrol() @ system.windows.forms.control.wmshowwindow(message& m) @ system.windows.forms.control.wndproc(message& m) @ system.windows.forms.scrollablecontrol.wndproc(message& m) @ system.windows.forms.containercontrol.wndproc(messa...

website - C# Can I Automate Drop Down Box in webbrowser control? -

website - C# Can I Automate Drop Down Box in webbrowser control? - hi first time on here, learning c# @ moment , have nail roadblock i have programme clicks through webpage using webbrowser control, , need pick options drop downwards box. i have html page, , far have been using element.invokemember clicking buttons, , element.innertext inputing data. is there way manipulate websites drop downwards box , pick values? i have id drop downwards box element , values options. set value of alternative selected field ie selected="id" c# website automation drop-down-menu

gwt - java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory -

gwt - java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory - i facing error while running gwt application. i have these jar files in classpath: slf4j-api & slf4j-log4j12 any thought reason? this problem due alter in slf4j-log4j12 jar. version 1.5.6 doesn't allow access field org.slf4j.impl.staticloggerbinder.singleton. to resolve it, utilize newest jars (or @ to the lowest degree version 1.5.6 onward) both slf4j-api & slf4j-log4j12. <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>1.5.6</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-log4j12</artifactid> <version>1.5.6</version> </dependency> java gwt

compiler construction - Convert a PHP script into a stand-alone windows executable -

compiler construction - Convert a PHP script into a stand-alone windows executable - i want automate simple task. have written little php script run command line using php-cli. want hand on script not want to: give away source code ask him install php on system is there way create .exe version of php script. not much worried de-compilation; more worried asking people install , configure php. phalanger http://www.php-compiler.net/ http://wiki.php-compiler.net/phalanger_wiki http://phalanger.codeplex.com/ phalanger project started @ charles university in prague , supported microsoft. compiles source code written in php scripting language cil (common intermediate language) byte-code. handles origin of compiling process completed jit compiler component of .net framework. not address native code generation nor optimization. purpose compile php scripts .net assemblies, logical units containing cil code , meta-data. bambalam http://www.bambalam.se/bamcompile/ ...

objective c - How to parse this response and save into array in iphone -

objective c - How to parse this response and save into array in iphone - i new in objective-c, have done nsxml parsing, how parse response. response is: array ( [success] => 1 [artworks] => array ( [0] => array ( [id] => 105 [title] => asdasdfg [height] => 0.000 [width] => 0.000 [depth] => 0.000 [medium] => [list_price] => 0 [status] => draft [edition] => [editions] => [artist_proofs] => [displaydate] => [created] => 2011-05-23 16:36:56 [hash] => 98a0b94ad30cdda90f9a8195722869db [artist] => array ( [first_name] => kcho ...

h.264 - how to set H264 profile in android recorder? -

h.264 - how to set H264 profile in android recorder? - i set h264 encoder's profile, such baseline profile / main profile / extension profile. but can not find api in mediarecorder it. api mediarecorder.setprofile(profile), seems assign predefined parameters such fps / bitrate / resolution. what want allow apk enable/disable 'i,p,b frames' , 'interlace' etc..which controlled h264 profile. idea? in advance :) have tried play : public int quality quality level of camcorder profile ? android h.264 mediarecorder encoder

c - GtkCellRendererText ellipsis causes text to completely dissapear -

c - GtkCellRendererText ellipsis causes text to completely dissapear - i have gtktreeview hooked gtkliststore , gtkcellrenderertext that's on it's own in column, column set expand. however renderer occupying max width of 3 characters, plenty ellipsis... while, , after editing text: did create window gtkbuilder? might this bug rearing ugly head again... c gtk

Blog module for Drupal 6 -

Blog module for Drupal 6 - i have cerated custom template drupal 6 , add together blog i'm not sure module use. do have suggetsion ? need alter template work on blog ? thanks suggestion! drupal 6 comes blog module in core. navigate admin/build/modules enable it. work out of box. if need alter template blog post can well. to alter template blog listing page: create new instance of page.tpl.php , name page-blog.tpl.php , customize liking. to alter blog node template: create new instance of node.tpl.php , name node-blog.tpl.php , customize liking. for more on creating templates, see drupal 6 template suggestions drupal drupal-6 module blogs

php - Unable to get all my images in web application via fql.query -

php - Unable to get all my images in web application via fql.query - i had api gives me images in galleries. now, when i'm using outside of facebook applications, , web application, getting empty array. $user = $facebook->getuser(); echo "$user<br>"; // gives me uid $user_albums_photos = $facebook->api(array( 'method' => 'fql.query', 'query' => 'select src,src_big photo aid in (select aid album owner=me())' )); print_r($user_albums_photos); // gives me empty array, when it's web application. $r_c = count($user_albums_photos); echo "<br>$r_c<br>"; the query looks fine , able run no problem when provide user access token. lint access token @ https://developers.facebook.com/tools/lint , see if has appropriate permissions (https://developers.facebook.com/docs/reference/api/permissions/). php facebook-graph-api

asp.net mvc 3 - Entity Framework POCO Serialization -

asp.net mvc 3 - Entity Framework POCO Serialization - i start code new web application soon. application built using asp.net mvc 3 , entity framework 4.1 (database first approach). instead of using default entityobject classes, create poco classes using ado.net poco entity generator. when create pocos using tool, automatically adds virtual keyword properties alter tracking , navigation properties lazy loading. i have read , seen demonstrations, julie lerman (ef guru!) seems turn off lazy loading , modifies poco template virtual keyword removed poco classes. julie states reason why because writing applications wcf services , using virtual keyword causes serialization issue. says, object getting serialized, serializer touching navigation properties triggers lazy loading, , before know pulling whole database across wire. i think julie perhaps exagarating when said pull whole database across wire, however, so, thought scares me! my question (finally), should remove virtual ke...

python - Django - FileField check if None -

python - Django - FileField check if None - i have model optional file field class mymodel(models.model): name = models.charfield(max_length=50) sound = models.filefield(upload_to='audio/', blank=true) let's set value >>> test = mymodel(name='machin') >>> test.save() why ? >>> test.sound <fieldfile: none> >>> test.sound none false how can check if there file set ? if test.sound.name: print "i have sound file" else: print "no sound" also, fieldfile 's boolean value false when there's no file: bool(test.sound) == false when test.sound.name falsy. python django django-models

javascript - iPhone WebApp opens links in safari -

javascript - iPhone WebApp opens links in safari - when add together 'web app' home screen on iphone, open , click link, opens safari. i've found couple of solutions question don't seem work: iphone safari web app opens links in new window $('a').live('click', function (event) { var href = $(this).attr("href"); if (href.indexof(location.hostname) > -1) { event.preventdefault(); window.location = href; } }); http://jakeboyles.com/2011/01/16/how-to-build-an-iphone-and-ipad-web-app/ <a ontouchstart="window.location=yourlink.html' ">your link</a> both of these posts/tutorials written before ios5. there new method? doing wrong? appreciate help one thought create home screen app iframe, , making anchors target it. no javascript needed. alternatively: $('a').on('click touchend', function(ev){ $(this).preventdefault(); window.location = $(this).at...

cocoa - Audio queue and EXC_BAD_ACCESS -

cocoa - Audio queue and EXC_BAD_ACCESS - this code generating noise using sound queue: http://pastebin.com/kn8gu72j the problem code generates exc_bad_access. problem seems in assignment maaudiomanager *audiomngr = (__bridge maaudiomanager *) inuserdata; in callback routine. suspect related access thread of class maaudiomanager. any idea? is there elsewhere in programme retains maaudiomanager instance? looks it's been dealloc'd time callback gets called. cocoa core-audio audioqueue

compilation - Cuda Source to Source translation using Rose compiler -

compilation - Cuda Source to Source translation using Rose compiler - i know extent of back upwards cuda in rose compiler. trying build source source translator cuda. possible using rose compiler? distribution of rose compiler should use? i know has been discussed before (support cuda in rose compiler), cannot understand whether cuda back upwards there or not. rose user manual not have much info either. rose has c++ front end end , fortran front end end seem reasonably integrated. rose scheme design imho not amenable easy integration of other front end end parsers (such need presumably parse cuda), although plenty effort it. (rose had c++, , fortran grafted on). if don't see explicit mention of cuda in rose manuals, pretty because isn't there. if want process cuda using source source transformations, you'll need both cuda parser , appropriate set of transformation machinery rose has. i cannot offer cuda parser, company provide industrial streng...

Android graphics - porting from existing AWT application -

Android graphics - porting from existing AWT application - i porting existing awt application android. application makes utilize of next code: graphics g = getgraphics(); how translate current canvas? also, lot of code goes on following: fontmetrics fm = g.getfontmetrics(); what existing classes within android can use? current class extends surfaceview if helps. thanks in advance for fontmetrics , you'll want check out paint.fontmetrics. as getgraphics() , i'm not sure is. briefly reading method description, believe similar getcontext() in android. i'm not familiar android many people around here, if i'm mistaken, sense free right me. android awt android-canvas

android - Getting objects out of an inner class/listener -

android - Getting objects out of an inner class/listener - i managed object out of asynctask (dogasynctask) interface/listener (doglistener): public string fout(string url) { dog d_in = new dog("dogname"); dogasynctask task = new dogasynctask(d_in); final string out = ""; <---have tried error out becomes "the final local variable out cannot assigned, since defined in enclosing type" task.setdoglistener(new doglistener() { @suppresswarnings("unchecked") @override public void dogsuccessfully(string data) { <---the string want log.e("doglistened", data); out = data; } @override public void dogfailed() {} }); task.execute(url); homecoming out; } my main activity calls function (fout) , supposed string out of it. string info there , log.e("doglistened", data); records too. how can homecoming outwards ...

how to get input from console in Xcode 4 in C++ -

how to get input from console in Xcode 4 in C++ - i want run project in xcode can not input console have checked websites can't it. #include <iostream> #include <stdio.h> using namespace std; int main (int argc, const char * argv[]) { cout<<"\n"<<argc<<"\n"; i getting ouput 1 don't know how input console output getting gnu gdb 6.3.50-20050815 (apple version gdb-1708) (mon aug 8 20:32:45 utc 2011) copyright 2004 free software foundation, inc. gdb free software, covered gnu general public license, , welcome alter and/or distribute copies of under conditions. type "show copying" see conditions. there absolutely no warranty gdb. type "show warranty" details. gdb configured "x86_64-apple-darwin".tty /dev/ttys000 [switching process 8492 thread 0x0] 1 programme ended exit code: 0 argc not "input console", it's number of arguments passed programme on command li...

Entity Framework 4.1 VS Nhibernate, for noob in ORM -

Entity Framework 4.1 VS Nhibernate, for noob in ORM - i in process of evaluating orm first time. please suggest 1 should take next project. i wrote couple of sample code ef 4.1 code first. before start same exercise nhibernate, want know if have experience both in production application. my evaluating criteria speed of database access learning curve (because new orm) community support tutorial/books availability anything else should consider (because noob orm) i wish if people have experience both orm in production level app reply question. thanks in advance!!! i aware question may little bit unsafe inquire ;) if noob orm , need basic features may find entity framework , nhibernate on kill , should looking @ lite weight 1 massive: https://github.com/robconery/massive that said there 2 main issues face ef vs nh ef microsoft back upwards , tooling default uses ef. making beginner code easier ef. nhibernate more mature , has greater feature set (...

bash - Preventing lock propagation -

bash - Preventing lock propagation - a simple , seemingly reliable way locking under bash is: exec 9>>lockfile flock 9 however, bash notoriously propagates such fd lock forked stuff including executed programs etc. is there way tell bash not duplicate fd? it's great lock attached fd gets removed when programme terminates, no matter how gets terminated. i know can stuff like: run_some_prog 9>&- but quite tedious. is there improve solution? you can utilize -o command line alternative flock(1) (long alternative --close , might improve writing in scripts self-documenting nature) specify file descriptor should closed before executing commands via flock(1) : -o, --close close file descriptor on lock held before executing command. useful if command spawns kid process should not holding lock. bash locking file-descriptor

c# - How to use Dynamic Radio button in aspx.cs file -

c# - How to use Dynamic Radio button in aspx.cs file - i have created dynamic radio button list java script , want utilize radio button list in aspx.cs page, how can do? the server-side code unaware of command dynamically created in javascript on client-side. likewise, viewstate of command invalidated if create options in list aren't available @ runtime. in order access values in code behind, you'll need pass values either ajax or set hidden field value prior postback. c# java asp.net

c - An error No such file or directory exist when i read from a file using fopen -

c - An error No such file or directory exist when i read from a file using fopen - i creating simple file server in c in linux. approach sending name of file client. file server receives file name. , search file , opens reading. read info it, , send info client. problem name file on client side. transfer server. have printed name there , recieved there(i mean server). server programme not open file specified name. , gives me error: no such files or directory exist. one must add together that: have created .txt file , entered in number 1 30 you should show code, , perhaps log output, too. i guess problem server executable running wrong current directory. sending total path names, directories perhaps exist on client? c linux sockets fopen

Flex FileReference prohibited characters -

Flex FileReference prohibited characters - the utilize of filereference has constraint on valid characters. error: error #2087: filereference.download() file name contains prohibited characters. fine since guess restriction comes underlying file scheme anyway is there such things generic way trim / replace prohibited characters? clarity after like: var dirty:string = "eat !@##$%%^&&*()\/";.txt var clean:string = dirty.replaceallprohibitedcharacters(); not looking os specific regular expressions, cross platform solution. the list of disallowed characters not alter depending on underlying os, fixed list. documentation filereference.download() list of disallowed characters is: /\:*?"<>|% edit: looks @ isn't allowed either. if want remove characters arbitrary string can this: var validfilename:string = invalidfilename.replace(/[\/\\:*?"<>|%@]/g, ""); if want replace them else, alter sec parameter r...

java - What version of Android should I compile for to avoid inner class warning -

java - What version of Android should I compile for to avoid inner class warning - i'm working android 2.1 (update1) , intellij project settings project show: jdk 1.6 , project language level set 6.0 (@override in interfaces) yet when build within ide or outside maven following warning: ignoring innerclasses attribute anonymous inner class this line of code (might) issue if how "should" in 1.6 friendly build of android? public class helloandroidactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); final button viewbutton = (button) findviewbyid(r.id.loadviewbtn); viewbutton.setonclicklistener(new view.onclicklistener() { @override //this says override not allowed when impl interface method?? public void onclick(view view) { intent viewactivity = new intent(helloa...

Yii framework proposed folder structure not working -

Yii framework proposed folder structure not working - i'm relatively new yii. i've managed sample application , running moving real project, utilize next folder construction increased security: [server root (/) ] - yii -- framework -- requirements [server htdocs] - myapp -- public --- assets --- css --- images --- themes --- index.php -- private --- protected all fine when leave protected folder within public folder don't want this. the way can work using proposed construction if create symlink within public folder pointing protected folder within private folder. if reference straight in private folder gives me blank page upon app load. i've double checked configuration paths , permissions. any help appreciated. you can configure yii utilize folders want specific needs, eg. protected-folder, assets, themes, etc. have @ "the directory construction of yii project site" example. yii

sql server 2005 - Remove duplicate row and update next row to current row and continue -

sql server 2005 - Remove duplicate row and update next row to current row and continue - i need select query .. environment : sql dba -sql server 2005 or newer example : in sample table, if select top 20 no duplicate records should come , next record should in 20 records . example : 123456 should not repeat in 20 records , if 18th duplicate, in place of 18th, 19th record should come , in 19th—20th should come, in 20th ---21st should come . no concern of asc or desc rows . lookup table before id name 123456 hello 123456 hello 123654 hi 123655 yes lookup table after id name 123456 hello 123654 hi 123655 yes my table: create table [dbo].[test]( [id] [int] identity(1,1) not null, [contesti...

Best way to create students information site with django -

Best way to create students information site with django - i want create website students django. i have learning_plan n subjects when create student want take existing learning_plan , have automatic subjects learning_plan has, want have exam_grades different each student. what i've done far: class subject(models.model): name = models.charfield(max_length=60) def __unicode__(self): homecoming self.name class learningplan(models.model): name = models.charfield(max_length=60) subjects = models.manytomanyfield(subject, through='exam') def __unicode__(self): homecoming self.name class student(models.model): name = models.charfield(max_length=60) learning_plan = models.foreignkey(learningplan) def __unicode__(self): homecoming self.name class exam(models.model): subject = models.foreignkey(subject) learning_plan = models.foreignkey(learningplan) exam_grade = models.integerfield() i kn...

c# - Get the ID of the dynamically generated textbox which is calling a javascript function -

c# - Get the ID of the dynamically generated textbox which is calling a javascript function - i dynamically generating textboxes in asp page , suppose calling javascript function "foo" on text change. want pass textbox id calling function javascript function. i.e. if typing in textbox 3, wanna show typing in txtbox3 (the id of textbox 3) i have autocomplete function dont know how pass id of calling textbox.. using class attribute changes value of every textbox... want id instead of .tbi there couple answers depend upon how code works. if attaching event handler addeventlistener, can object generated event this pointer this: obj.addeventlistener("change", function() { // id of object triggered event var id = this.id; // whatever want id }, false) or using regular function: function foo(e) { // id of object triggered event var id = this.id; // whatever want id } obj.addeventlistener("change", foo, false); ...

c# - how to cast COM object type to Excel.Checkbox type -

c# - how to cast COM object type to Excel.Checkbox type - i adding checkbox excel , have issue casting com object of type 'system.__comobject' interface type 'microsoft.office.interop.excel.checkbox', help appreciated! working on web app using visual studio 2008 , office 2007. error happens @ line :- chkbx = (microsoft.office.interop.excel.checkbox)obj; microsoft.office.interop.excel.oleobjects objs = (microsoft.office.interop.excel.oleobjects)mwsheet1.oleobjects(system.reflection.missing.value); microsoft.office.interop.excel.oleobject obj = objs.add("forms.checkbox.1", system.reflection.missing.value, system.reflection.missing.value, false, false, system.reflection.missing.value, system.reflection.missing.value, 234, 234, 108, 21); microsoft.office.interop.excel.checkbox chkbx; chkbx = (microsoft.offic...

Android TimePicker AM/PM button not invoking onTimeChanged -

Android TimePicker AM/PM button not invoking onTimeChanged - i'm having issues implementing timepicker in application allows user alter time of database record prior inserting it. the problem when am/pm button pressed, ontimechanged(view, int, int) method isn't invoked. whenever alter either hr or min value of timepicker, ontimechanged() called, however. scenarios: user clicks am/pm button: am/pm not updated user clicks hours/minutes: time updated user clicks am/pm button changes hours/minutes: time , am/pm updated am wrong in thinking am/pm button should able clicked update time without having alter time value after am/pm button? i've set little test project replicate , here's code: activity public class testactivity extends activity implements ontimechangedlistener { private calendar mcalendar; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.l...

tomcat6 - Do i need a context.xml file to deploy spring webapp to tomcat -

tomcat6 - Do i need a context.xml file to deploy spring webapp to tomcat - i new tomcat, apologize if dumb question. have created spring mvc webapp runs locally using maven-jetty-plugin. i can create war file. deploy war file tomcat6 instance. however, not sure if need create context.xml file tomcat? , if do, place file in spring webapp? current directory construction looks this: src | |-main | |-java |-resource | |-meta-inf |-webapp | |-web-inf |-web.xml the context.xml file used configure application specific instructions container (tomcat). instance, can define jndi resources, loggers, valves, etc. see context container more details. by default, tomcat auto-generate default context.xml war if not specify 1 , store within own configuration files in /conf/[enginename]/[hostname]/[context-root].xml if want include part of war, can place in /meta-inf/context.xml within war. spring tomcat6

javascript - JSON encode problems php -

javascript - JSON encode problems php - what wrong way encoded? <?php include ("../includes/db_con.php"); $itemresults = mysql_query("select `sold_for` `items` `item_did_sell`='1'") or die(); $miresults = mysql_query("select `mi_price`, `mi_total_sold` `misc_items` `mi_total_sold`>'1'") or die(); $donationresults = mysql_query("select `amount` `donations`") or die(mysql_error()); $total = 0; $itemtotal = 0; $mitotal = 0; $donationtotal = 0; while($row = mysql_fetch_assoc($itemresults)){ $itemtotal += $row['sold_for']; $total += $itemtotal; } while($row = mysql_fetch_assoc($miresults)){ $mitotal += ($row['mi_price'] * $row['mi_total_sold']); $total += $mitotal; } while($row = mysql_fetch_assoc($donationresults)){ $donationtotal += $row['amount']; $total += $donationtotal; } header("content-type: application/json"); $arr = array...

eclipse - Uninstalling Android ADT -

eclipse - Uninstalling Android ADT - this seems trivial task, can't find alternative cleanly de-install adt eclipse installation. of course, delete folder of sdk, throws errors when starting eclipse next time. reason i'm asking because old adt keeps throwing wierd error (failed fetch url https://dl-ssl.google.com/android/repository/addons_list.xml, reason: file not found) , need complete, fresh re-install. important: under help -> eclipse sdk -> installation details uninstall button android plugins greyed out the way remove adt plugin eclipse go help > eclipse/about adt > installation details . select plug-in want uninstall, click uninstall... button @ bottom. if cannot remove adt location, best alternative start fresh clean eclipse install. android eclipse adt

sql - Run multiple Insert statements with dynamic schema name -

sql - Run multiple Insert statements with dynamic schema name - i want run 100 insert statements of below insert`s in script. schema name db1 , db2 must used in placeholder variable sourcedatabase , targetdatabase. declare sourcedatabase varchar2(50) := 'db1'; targetdatabase varchar2(50) := 'db2'; begin insert targetdatabase.tablename (select * sourcedatabase.tablename); insert targetdatabase.tablename (select * sourcedatabase.tablename); insert targetdatabase.tablename (select * sourcedatabase.tablename); ... commit end; how can write in dynamic way oracle accepts statement? do mean "database" in oracle definition of term? or mean "schema"? pseudocode posted appears assuming sourcedatabase , targetdatabase schemas in single database. if mean indicate separate databases, needd utilize database links query remote tables. assuming mean schemas declare l_src_schema varchar2(30) := 'source'; l_dest_schema v...

jquery - How to dynamically change the stylesheet of an HTML page within an iFrame of another page? -

jquery - How to dynamically change the stylesheet of an HTML page within an iFrame of another page? - i have web page makes utilize of jquery ui themes. within page, there's iframe holding html document makes utilize of jquery ui themes. now, have made own theme selecter, , i'd know easiest way have impact page within iframe. example, whenever user selects new theme, simple like: <link id="uitheme" rel="stylesheet" type="text/css" href="ui/smoothness.css" /> $("#uitheme").attr("href", "ui/" + newtheme + ".css"); where newtheme string literal of different them (all done through select box, , know works , such). now, how can alter sheet beingness used within frame match of main page? guess question how can utilize jquery selector grab link id of innertheme alter it's href attribute same stylesheet? furthermore, need worry this, or ui-theme of outer page automatically desc...

file io - Data storing in haskell - excel like rows and cols -

file io - Data storing in haskell - excel like rows and cols - i have next quest: i have write programme in haskell allow me create excel sheet. there columns , rows, , each cell can hold number or string or function (sum, mean, multiply etc). each of functions take parameters list of cells summed etc. now trying figure out how store info program... thinking this: data cellpos = cellpos int int -- row , col of cell info datatype = text | string | sumfunction | ...... deriving (enum) info cell = cell cellpos datatype -- here problem , how set here info type depends on datatype??? i wanted have big list of cell , search in specified column/row etc but there must improve solution – maybe 2 dimensional array auto adjust size or something? i have save/load sheet /from file... let's reply 1 question @ time: data cell = cell cellpos datatype "but here problem , how set here info type depends on datatype???" put info datatype...

Export Maps for GPS navigators? -

Export Maps for GPS navigators? - what concept behind exporting maps gps navigators google map or open street map? there such thing in first place? there standardized gps format allow exporting/importing of coordinates gps navigators? thanks! gpx (called gps exchange) mutual format created (i think) garmin. not programs (arcgis) utilize can handily converted kml/kmz (keyhole aka google earth), , vice-versa. have found moving geodatabases between gis editors, gps navigators, , gps handheld units accomplished using programme converts gpx kml. tl;dr there no 1 format. there 2 interchangeable formats, gpx , kml. google-maps gps maps gis openstreetmap

php - using VersionControl_Git pear package fails -

php - using VersionControl_Git pear package fails - i trying deploy cloning git project on webserver, cannot work <? require_once 'versioncontrol/git.php'; $git = new versioncontrol_git('/home/xxx/public_html/yyy'); $git->createclone('http://github.com/maysam/braincheck.git'); ?> but error: fatal error: uncaught versioncontrol_git_exception: errors in executing git command output: error: error: requested url returned error: 403 while accessing http://www.github.com/maysam/braincheck.git/info/refs fatal: http request failed in /home/xxxx/php/versioncontrol/git.php on line 164 exception trace #functionlocation 0versioncontrol_git_util_command->execute()/home/xxxx/php/versioncontrol/git.php:164 1versioncontrol_git- in /home/xxxx/php/versioncontrol/git/util/command.php on line 237 i think need utilize git:// url. $git->createclone('git://github.com/maysam/braincheck.git'); php git pear

c# - Creating Windows Folders using impersonation -

c# - Creating Windows Folders using impersonation - i'm trying create folder using credentials of limited admin business relationship supplied encrypted .config file- right code running under assumption user has no access these directories, unauthorizedexception thrown, when given access code otherwise works, can't compromise our security. know how username / password out of encrypted file already, i'm not sure library or syntax should utilize impersonate; code: //set cursor string activedir = "\\\\department\\shares\\users\\"; //create directory userid folder name string newpath = system.io.path.combine(activedir + userid); system.io.directory.createdirectory(newpath); so need way supply credentials i'm @ loss- i've been using system.directoryservices.accountmanagement , pricipalcontext supply username/password making changes active directory... need utilize similar library create changes file system? help appreciated, thanks! i...

c++ - Red screen of death on old DOS accounting software (corrupted background structure) -

c++ - Red screen of death on old DOS accounting software (corrupted background structure) - i need help tracing downwards source of error i'm getting. i'm guessing doing c++ in dos era have seen already. maybe not os error application error colored red. i grateful if reply following: what corrupted background construction error where find manual fm_rd , fm_ed .. , other listed stack functions (are functions @ ?) ? i'm hoping knowing help me locate exact moment error triggers. all info have perchance help: it's old single core pentium (error popped on amd machine , others) ata disk. i presume it's coded in c++ uses paradox db occurs @ moment seek print out accounting info , save changes disk(db).(it's 2 operations in 1 i'm not sure 1 errors out) nothing prints , nil saves db fat filesystem i'll update in morning if find in machine's logs. thank much in advance!! this screenshot: http://cityinfo.hr/fotka.jpg c++ stack...

Mocking framework for osgi/eclipse applications? -

Mocking framework for osgi/eclipse applications? - i looking mocking framework utilize in osgi/eclipse test fragments. have looked at: http://www.jmock.org/download.html but since not osgi need convert manually. have tried google mocking frameworks works osgi out of box have not been able find any, osgi developers not utilize mocking? one solution create mock objects of osgi objects (like bundlecontext , servicereference). can utilize mocking framework , of course of study don't have run test in osgi container. ok simple scenarios. if want test within container, have next options: pax-exam spring dm testing facilities eclipse-plugin mocking

java - Line Break Height in android -

java - Line Break Height in android - now having code counts height , width of paragraph , sets accordingly. have been having unusual problems whenever break line(\n) passes through paragraph utilize code calculate height. calculate width , create sure line fit. float textsize = t.gettextsize(); paint paint = new paint(); paint.settextsize(textsize); however reason break line couldn't have height calculated mean me missing few lines or show me half line cause of break lines during performed calculations. my question is, how undergo calculation of height of break line of space occupies? i wasn't able solve issue. did seek delete 3 more characters @ border of end point of width. worked. real problem lies more in character width. if character not registered android calculation vs actual out come can different if have letters different off regular alphabet. using code can determine border of endpoint. totalcurrentwidth = t.getpaint().measuretext(s.sub...

param - rails: is "pollresponse" a magic keyword that is not allowed in query string? -

param - rails: is "pollresponse" a magic keyword that is not allowed in query string? - spent hr debugging "impossible" situation, query string pollresponse=true not beingness recognized. basically, params[:pollresponse] seems nil, when params hash shows { 'pollresponse' => 'true' } on hunch, replaced name , worked expected. so assume there "magic" though googling "rails pollresponse" didn't give me obvious. a) in fact reserved , hence illegal query param? b) there list of other such reserved words which, if used query string param, ignored? a) no, there no magic keyword pollresponse rails. b) create sure none of gems/plugins using in rails-app somehow messes params-hash. you don't utilize keyword somewhere in code you don't have model, resource, whatever named exaclty same, cause might cause confusion in rails ruby-on-rails param

java - Custom components that can extend beyond their container's bounds - how? -

java - Custom components that can extend beyond their container's bounds - how? - let's have jpanel size 200 x 200, custom combo-box-type component dropdown list should able extend outside of 200 x 200 jpanel. the problem i'm facing dropdown either doesn't 'paint' outside bounds of container, or container sized according dropdown. how can add together component container allows component extends beyond bounds of container? how java jcombobox internally? simply utilize jpopupmenu dropdown. jpopupmenu internally handle painting @ , beyond edges. java swing layout

php - Multidimensional array sort on multiple keys -

php - Multidimensional array sort on multiple keys - hi i've been using array_sort() function found here time sort results multiple apis have need sort 2 keys simultaneously. the 2 keys need sort on deal_score desc , date_start desc the properties of array follows. record 2 has highest deal_score should come first records 0 , 1 have same deal_score date_start higher on record 1 final order of results should 2, 1, 0 here's illustration array has been trimmed downwards readability. [0] => array ( [db_id] => 414314 [date_start] => 2012-04-17 [deal_score] => 81.3 [deal_statements] => array ( [0] => 49.85 [1] => 2.11 ) ) [1] => array ( [db_id] => 414409 [date_start] => 2012-04-20 [deal_score] => 8...

Visualize Git logs to people who don't understand version control -

Visualize Git logs to people who don't understand version control - i need somehow visualize project graphs, commits, analysis, etc. stuff people (who don't know terms "version control" or "git" - i.e. illiterate people in domain) project has required xyz amount of work measured in x, y, z. indicators, in other words. zyz amount of developers z correspond language p of proportion %%, language t of proportion, etc. how can explain in hectic situation bit of technical project managers xyz objectively without reinventing wheel? bit fed explaining things again-and-again-and-again , things not proceed because not understand issues @ all. if automatic log summary or pdf or rss or that, may understand things better. using flowdock our logs appear in real-time it, want more details (they can see log msgs). without looking @ repo cannot see much else. any automatic repository visualizer or that? github has visual guides impact, punchcard etc. see ru...

google maps - loop an action using system milliseconds android java -

google maps - loop an action using system milliseconds android java - hi developing app update marker on google maps , move him towards various geopoints. i moving marker few meters per 10 milliseconds accomplish smooth motion on map. i using countdown timer that(move marker meters every 10 milliseconds example) know not precise. what else can utilize loop action , can more precise? shall utilize system.nanotime(); and if best way can illustration ? try timertask & timer timer timer = new timer(); timertask task = new timertask() { @override public void run() { // code here } }; timer.scheduleatfixedrate(task, 0, 10000); hope, help you! android google-maps countdowntimer

What is the cross-platform way to add a JavaScript module to the global scope? -

What is the cross-platform way to add a JavaScript module to the global scope? - i having @ source code of store.js, in particular how adds global scope: if (typeof module != 'undefined') { module.exports = store } else if (typeof define === 'function' && define.amd) { define(store) } else { this.store = store } i understand lastly statement this.store = store , how other ones? module , define functions? won't this.store = store work on browsers? more generally, correct, cross-browser way, add together module global scope? the first case commonjs, notably used in node.js , flavor of amd (asynchronous module definition). module javascript file gets executed global module object defined. whatever file sets module.exports available other parts of app, , else in file remain private module. here good blog post on it. the sec 1 flavor of amd, commonly implemented requirejs. it's similar thought commonjs, more commonly found in bro...

assembly - Tiny Pe file format program error when running on Windows 7 64-bit -

assembly - Tiny Pe file format program error when running on Windows 7 64-bit - i'm trying run next assembly code (assembled nasm) in windows 7 ultimate 64-bit. ; tiny.asm bits 32 ; ; mz header ; ; 2 fields matter e_magic , e_lfanew mzhdr: dw "mz" ; e_magic dw 0 ; e_cblp unused dw 0 ; e_cp unused dw 0 ; e_crlc unused dw 0 ; e_cparhdr unused dw 0 ; e_minalloc unused dw 0 ; e_maxalloc unused dw 0 ; e_ss unused dw 0 ; e_sp unused dw 0 ; e_csum unused dw 0 ; e_ip unused dw 0 ; e_cs unused dw 0 ; e_lsarlc unused dw 0 ; e_ovno unused times 4 dw 0 ; e...

javascript - Is there an issue passing data using window.name in a Phonegap application? -

javascript - Is there an issue passing data using window.name in a Phonegap application? - i'm creating phonegap application multiple platforms (specifically, playbook , ipad) requires passing big amount of info between pages. i've read on subject, have much pass through url. can't server-side pass information. alternative i've found utilize window.name property. however, i've read clear on fact should not that, due security risks involved. in phonegap application, risks still exist? alternatively, there improve way pass info between pages in phonegap? localstorage tailor made looking do: http://docs.phonegap.com/en/1.3.0/phonegap_storage_storage.md.html#localstorage javascript cordova

ios5 - How to change UIbutton title once a UIbutton is pressed? -

ios5 - How to change UIbutton title once a UIbutton is pressed? - i having problem changing title of uibutton btn2 1 time btn1 pressed. when utilize _definition settitle:@"show word" forstate: uicontrolstatenormal changes original btn1. here code review, - (ibaction)mynextpressed:(uibutton *)sender { //display string in label field [self.worddisplay settext:vocabulary]; //reset center button "show word" [_definitionpressed settitle:@"show word" forstate:uicontrolstatenormal]; nslog(@"displaying word: %@", _definitionpressed.titlelabel); } try along lines of: [btn2 settitle:@"show word"] ios5 uibutton

java - How can I run unit tests with different versions of a library w/o changing it manually? -

java - How can I run unit tests with different versions of a library w/o changing it manually? - unit test in java, using maven build & run. can utilize either local jars "outside" maven or local maven repository. however, i'd figure out way automatically somehow, without changing pom.xml->running ->changing pom.xml is there other way except above or creating pom.xmls differ in specific library version? (i'm using intellij if that's of use) you read version of lib property, <dependency> <groupid>javax.faces</groupid> <artifactid>jsf-api</artifactid> <version>${jsp.api.version}</version> </dependency> you can set property in several ways, e.g. loading build-specific properties file. you specify parameter when running build. on command line svn, like mvn -djsp.api.version=1.8 install don't know how specify such property when running maven ...

coldfusion - CFWheels Nested Properties and hasManyCheckBox -

coldfusion - CFWheels Nested Properties and hasManyCheckBox - i trying figure out how can update petevents table several events. no error, not updating/inserting. here relevant code snippets , schema relevant tables follows. view <cfloop query="events"> #hasmanycheckbox(objectname="pet", association="petevents", keys="#pet.key()#,#events.id#", label=events.eventname)# </cfloop> pet model <cfset hasmany(name="petevents", dependent="deleteall", shortcut="events")> <!--- nested properties ---> <cfset nestedproperties(associations="petevents", allowdelete=true)> event model <cfset hasmany(name="petevents", dependent="deleteall")> petevent model <cfset belongsto("pet")> <cfset belongsto(name="event", jointype="outer")> view update in controller <cfset pet = model("p...

java - Initialization hook for Clojure Noir WAR/Servlet (CloudFoundry) -

java - Initialization hook for Clojure Noir WAR/Servlet (CloudFoundry) - i'm building clojure noir web application run war file in cloudfoundry. in project.clj have: :ring {:handler appname.server/handler} in server.clj create handler using noir: (def handler (noir.server/gen-handler {:ns 'appname})) i build war file using lein ring plugin: lein ring uberwar then force cloudfoundry using: vmc force appname the request handler works fine , can browse url of application fine. so question is: right way initialization when application started? i can next in server.clj: (when (system/getenv "vcap_application") (init-func)) but there couple problems that. first, seems doing initialization @ wrong time (when code read/eval'd rather on app start). second, protector specific cloudfoundry , there proper general war way this. i think purpose of contextinitialized method on servletcontextlistener how hook in noir/ring? f...

Android: setVisibility(View.GONE) reducing the font size and image size on the webview -

Android: setVisibility(View.GONE) reducing the font size and image size on the webview - i have android application hits webview , displays content. per requirement should hide webview , later on should show user. so, phone call setvisibility(view.gone); , hide visibility of webview . and, phone call setvisibility(view.visible); show webview user. 1)when doing in sequence, size of content(font , images) on webview getting reduced. 2)if don't phone call setvisibility(view.gone); , straight show user size of content(font , images) on webview bigger. i want accomplish 2 scenario hiding webview . means want hide webview initially, , show user bigger sized content on webview . how accomplish this? i have got working finally!!! instead of using setvisibility(view.gone); create webview invisible, using setvisibility(view.invisible);. this way able accomplish proper size of items on webview. dont know exact reason mismatch, working expected change...