Posts

Showing posts from May, 2014

nmea checksum in c# .net cf -

i'm trying write own nmea parser,since need info gps, , don't need interpret messages. problem have nmea message validator gives me wrong checksum. can see i'm droing wrong? i'm using idea codepedia - calculating , validating nmea sentences . // returns true if sentence's checksum matches // calculated checksum // calculates checksum sentence private static bool isvalid(string sentence) { if (sentence == "") return false; if (sentence.length < 14) return false; try { string[] words = getwords(sentence); log.writetolog(words); int checksum = 0; string checktocompare = words[words.length - 1]; stringbuilder sb = new stringbuilder(); (int = 1; < (words.length - 2); i++) { sb.append(words[i]); } string sentecentoparse = sb.tostring();

php - How do I get serialize data on wordpress -

how serialize data on wordpress database? example option_name option_value ----------------------------------------------------------- widget_example-widget a:3:{i:2;a:0:{}i:6;a:4:{s:5:"title";s:14:"example widget";s:4:"name";s:8:"john doe";s:3:"age";s:2:"30";s:3:"sex";s:4:"male";}s:12:"_multiwidget";i:1;} example want call sex , use $sex = get_option('widget_example-widget'); echo $sex['sex']; it return empty , when try var_dump result below array(3) { [2]=> array(0) { } [6]=> array(4) { ["title"]=> string(14) "example widget" ["name"]=> string(8) "john doe" ["age"]=> string(2) "30" ["sex"]=> string(4) "male" } ["_multiwidget"]=> int(1) } actually can retrieve data add $sex['6']

mysql query result -

Image
i have built query kind of self explanatory: select events.*,(select count(*) events_participants events_participants.eventid=events.eventid)as participants,linkviews.totviews events inner join linkviews on events.event_id=linkviews.eventid in events table have 6 events query return 3 of them (id:1,2,4). where query wrong? hope infos enough thanks luca try left outer join instead of inner join. there no matching eventid in linkviews table/view.

floating point - Make VarToDoubleAsString use Delphi settings (not OS settings) -

when 1 assigns variant containing string value floating point variable delphi calls vartodoubleasstring conversion, in turn uses os settings decimal , thousand separator (via varr8fromstr). problematic if 1 has change sysutils.decimalseparator , sysutils.thousandseparator . example run following program: program varstrtofloat; {$apptype console} uses sysutils, math; function formatfloatusingdelphisettings(value: extended): string; begin result := formatfloat('#,##0.00', value); end; procedure test(const amsg: string); var r1, r2: extended; s1, s2: string; v: variant; begin r1 := 5432.1; s1 := formatfloatusingdelphisettings(r1); v := s1; // <== conversion uses os settings r2 := v; s2 := formatfloatusingdelphisettings(r2); write(amsg: 8, s1: 10, s2: 10, ' '); if samevalue(r1, r2) writeln('ok') else writeln('fail'); end; procedure swapem; var tmp: char; begin tmp := decimalseparator; decimalseparato

Java class definition in runtime -

possible duplicate: how programmatically compile , instantiate java class? how create new java class @ runtime? javassist lib looks manupulation classes - can try it: http://www.csg.is.titech.ac.jp/~chiba/javassist/ also maybe can usefull: http://www.javaranch.com/journal/200711/journal200711.jsp#a4

c# - Image button on visual studio 2010 -

i trying create button image , no text [design] view on visual studio 2010. drag & dropped button, click image property, select png image resource file, property remain empty , button doesn't have image neither on [design] view or in compiled program. i tried setting image on form.designer.cs file with: // // button1 // this.button1.location = new system.drawing.point(73, 11); this.button1.name = "button1"; this.button1.size = new system.drawing.size(39, 34); this.button1.tabindex = 10; this.button1.usevisualstylebackcolor = true; this.button1.image = properties.resources.close_project_img; and when go [design] view, error : to prevent possible data loss before loading designer, following errors must resolved: projectitem unavailable. instances of error (1) 1. show call stack @ envdte.projectitem.get_filecount() @ microsoft.visualstudio.design.serialization.resxglobalobjectprovider.getfilenameforproject

gwt rpc - Waiting for more than one event (using GWT) -

i want fetch 2 xml documents server , resume processing when both have arrived. can fetch them in parallel, or have refrain issuing second request until first has completed? make both requests, check when either 1 completes whether other done, , continue if is. private string responseone; private string responsetwo; public startrequests() { makeasyncrequestone(new asynccallback<string>() { onsuccess(string response) { this.responseone = response; if (responsetwo != null) { proceed(); } } }); makeasyncrequesttwo(new asynccallback<string>() { onsuccess(string response) { this.responsetwo = response; if (responseone != null) { proceed(); } } }); } as chris points out, may hit ceiling on maximum concurrent requests same hostname, if have lots of requests send @ once, keep queue of requests , call next 1 in proceed() until queue exhausted. but if plan on having lot of concurrent req

android - Error while running programe? -

there error while running application? can tell me why error appeared , how resolve it. error :[2011-02-23 17:46:48 - diffrentviews] w/resourcetype( 4072): bad xml block: header size 166 or total size 0 larger data size 0 [2011-02-23 17:46:48 - diffrentviews] c:\documents , settings\a.singh\workspace\diffrentviews\res\menu\main_menu.xml:7: error: no resource identifier found attribute 'alphabeticshortcuts' in package 'android' it android:alphabeticshortcut ,not android:alphabeticshortcuts .. there s .

c++ - Which way you prefer to send arguments? -

suppose have function: void fun(int *a, int *b); which way prefer send arguments? (1.) int x, y; fun(&x, &y); (2.) int *x, *y; fun(x, y); what problems other way or both same , behavior same? usually use former if want variables on stack, , latter if allocate memory them on heap. stack typically faster, whereas heap typically bigger. in general, use first pattern quite often, , use latter when dealing giant arrays or large objects.

imagebutton - Android GUI :: Continuous click events hangs -

hello have 1 imagebutton single image. have added onclick event , works fine.when imagebutton clicked add entry function works. now when user continously clicks imagebutton, add entry functions executes many times same data. want prevent it. such that, imagebutton should not queue process next click event until function gets executed completely. i tried myimagebutton.setenable(false) onclick event executes. , doing myimagebutton.setenable(true) after data entry function. i tried put code in myimagebutton.isenabled() didnt work. how ignore such queued click events? there other way (than setenable() ) ignore/eat click processing? i have checked putting println statements each click event in sync...means code executes in order. edit private onclicklistener m_addclickhandler = new onclicklistener() { public void onclick(view v) { if(m_bdoadd) { m_bdoadd = false; new addtask().execute();

Who know the history of unix fork? -

fork great tool in unix.we can use generate our copy , change behaviour.but don't know history of fork. does can tell me story? actually, unlike many of basic unix features, fork relative latecomer (a) . the earliest existence of multiple processes within unix consisted of few (fixed number of) processes, 1 per terminal attached pdp-7 machine (b) . the basic idea shell process given terminal accept command user, locate program file, load small bootstrap program high memory , jump it, passing enough details bootstrap code load program file. the bootstrap code, after loading program low memory (overwriting shell), jump it. when program finished, call exit wasn't exit know , love today. this exit reload shell , run using pretty same method used load program in first place. so more rudimentary exec command, 1 replaces current program another, in same process space. the shell exec program then, when program done, again exec shell calling exit . t

php - Confused in mysql query -

i have 2 tables property_description , property_extras . table property_description looks like id location price etc etc 1 new york 3000 v v table property_extras looks like property_id extras 1 12,14,16,167 well question how should mysql query return result if @ least 1 of extras matched ? you should ideally have extras normalized like property_id extra_id 1 12 1 14 ... if can't convert database structure this, have (terrible) like: select property_id property_extras extras '12,%' or extras '%,12,%' or extras '%,12' or, if can insert commas start , end ,12,14,..., delphist points out, simply: select property_id property_extras extras '%,12,%'

php - How can I determine why imageCopyResampled is failing? -

i calling php's imagecopyresampled() function , failing. i'm not sure why (i looked closely @ code , don't see obvious errors passing in empty or non-numeric values, , know source image there, etc.). so i'm not asking how solve problem, rather can diagnose it, since function returns true or false. don't see errors or warnings being outputted page or in error log, , calling error_get_last() returns nothing. any ideas?

PHP Cookies problem... cookie working on one page but not working on another -

hi can explain me: on 1 page have: setcookie(cookiename,$cookiedata,time()+(84600*30*24)); setcookie(cookiename2,$cookie2data, time()+(84600*30*24)); if on same page say: echo $_cookie['cookiename']; it works fine.... but if go page few clicks onwards, , say: echo $_cookie['cookiename']; nothing appears. why happen? cookie deleted in way? oh , if try on page in between, same problem occurs.... i'm stumped, thanks in advance, niall are different pages on same domain? should setting path, have found cases when path not set '/' not accessible default 'everywhere' on site though make sense default. try setting path of cookie.

asp.net - HTTP Error 500.19 - Internal Server Error -

i migrating application cloud sites dedicated server. dedicated server running on windows 2008 server 64 bit iis 7. application pool in new server in integrated mode. i have default.htm page start page , works fine. cannot access other pages , encountering error "http error 500.19 - internal server error" the configuration source showing error follows. {system.webserver} 68: {httperrors errormode="detailedlocalonly" defaultpath="/errorpage-404.asp" defaultresponsemode="executeurl"} 69: {remove statuscode="404" substatuscode="-1" /} please help. thanks in advance! error message: "http error 500.19 - internal server error requested page cannot accessed because related configuration data page invalid." solution: 1 way can error having multiple copies of solution, each of them using same port number. can solve problem exiting instances of visual studio, restarting projec

SQL Server VARCHAR(MAX) and DB Size very high -

i storing html in database. no, not dynamic web application, template gets stored in database , gets printed. this template varchar(max) , has on average of 700k records (7 lac records). there 28k records stored in database , db size 21gb. i figured template column causing db size big. size of column in database 17gb. do think can add compression logic compress , save data in database? know add little overhead compression, doubt if going big. i cannot store database outside of sql make sensitive data available having file share permissions. any other ideas appreciated. (binary, text or else)? sql server 2008 has built in data compression worth looking at.

Powershell editor with intellisense that I can embed into my program? -

i have c# application , want allow people write powershell code within app. does know of powershell editor intellisense fits bill?? powergui choice here. check out http://powerguivsx.codeplex.com/ , see how powergui used within visual studio.

Is it possible to get exactly what the error is in MySQL? -

i'm getting error when trying add foreign key , description not helpful @ all: it's error 1050 , i'm able find in google pages a list of possible causes. there way exact cause of error mysql, example "fields not match (one unsigned , signed) can't have foreign key"? if run show engine innodb status\g @ mysql prompt , "latest foreign key error" section, should give more detail on error.

iphone - correct way to sharing nsarray (3.1M size) between views -

i'm reading appdelegate not small array. nsarray *mycountryspecific = [[nsarray alloc] initwithcontentsofurl:[[nsbundle mainbundle] urlforresource:@"nexttwoweekevents" withextension:@"ary"]]; self.mycountryspecificcodeslist = mycountryspecific; [mycountryspecific release],mycountryspecific = nil; to keep in memory, declared property @property (nonatomic, retain) nsarray *mycountryspecificcodeslist; but main view have go 2 steps while using it, under event controller have event detailed view controller necessary part of array (based on predicate). my current design read array not appdelegate, event detailed view controller when necessary. can u share u experience? if better load array appdelegate , keep in memory, please advice correct way send access property between classes without memory leaks. eventstableviewcontroller *events = [[eventstableviewcontroller alloc] initwithnibname:@"eventstableviewcontroller" bundle:nil]; self.eve

android - problem with datePicker, title initialization is funky -

so have reached end of rope when comes dang datepicker dialog working with. have made through 7 different activities within app , have not encountered single problem until reached datepicker. problem consists of 2 elements: 1) dang title of datepicker displays wednesday, december 31, 0002 when called. datepicker displays correctly, not title, , have not altered title 1 bit. when change date title changes correct information except for.... 2) appears if days of week off 1 (for today says monday, february 22, 2011). going post entire code within activity , if has ideas appreciated. issue going in oncreatedialog or onpreparedialog methods. if need remove of other extraneous init methods so, verify not causing problems anywhere else within activity. public class quizsettingsactivity extends quizactivity { sharedpreferences mgamesettings; static final int date_dialog_id = 0; static final int password_dialog_id = 1; /** called when activity first created. */ @override

visual studio - Project reference in one .sln, and assembly reference in another -

Image
scenario this distillation of problem having... we have 2 solution files. both have project reference same project, proja proja has reference projx problem we projx reference project reference in solutionone, assembly reference in solutiontwo how can done, since proja.csproj same file referenced both solutions? i've never done before sounds conditional build. you'd need define new solution configurations - instead of debug/release, you'd call them projref , asmref. solutionone build using projref , solutiontwo build using asmref. then, you'd modify vbproj/csproj , tag reference condition. take @ article: http://weblogs.asp.net/lkempe/archive/2009/12/02/projectreference-with-condition-in-your-msbuild-project-files.aspx

makefile - Android build error -

i try build android: $ source build/envsetup.sh $ lunch $ make after make, got many errors files cannot find stdlib.h string.h unistd.h , other .h files. am right need add in build/core/config.mk in src_headers path bionic/libc/include. have tried got many mistakes in .h files within bionic/libc/include directory. here logs after make bionic/libc/include/stdio.h:240: error: expected declaration specifiers or '...' before 'off_t' bionic/libc/include/stdio.h:241: warning: type defaults 'int' in declaration of 'fpos_t' bionic/libc/include/stdio.h:241: error: expected ';', ',' or ')' before '*' token bionic/libc/include/stdio.h:243: error: expected '=', ',', ';', 'asm' or ' attribute ' before 'ftello' bionic/libc/include/stdio.h:270: error: expected declaration specifiers or '...' before '__va_list' bionic/libc/include/stdio.h:270: warning:

Rails 3: Difference between Relation.count and Relation.all.count -

moin, i stumbled upon inconsistency in activerecord. tried used combinations of values in 2 columns of large table. first idea: select distinct col1, col2 table imagine rails app organizes meals model , each meal has_many :noodles each noodle has attributes (and hence db table columns) color , shape . goal number of present combinations of color , shape single meal. since ar not provide "distinct" method used my_meal.noodles.select("distinct color, shape") and got (in rails console stdout) 6 line output of 8 noodle objects (respectively string representations). but: >> my_meal.noodles.select("distinct color, shape").count => 1606 in fact my_meal contains 1606 noodles. if convert the relation array , size of or use .all.count result correct. so question is, why ar output 8 objects count db lines? a similar problem seems mentioned here no answer given. thanks , best regards, tim okay, tadman pushing me in

Read JSON with jQuery -

i want load json file , read following data { "exttitle": { "message": "test1" }, "extname":{ "message": "test2" } } this how load data function loadlocales(){ var userlang = (navigator.language) ? navigator.language : navigator.userlanguage; switch(userlang){ default: $.getjson("_locales/ne/messages.json", function(data){ return data; }); break; } } when try read following function i18n undefined error . function getvalue(key){ var i18n = loadlocales(); return i18n[key].message; } any ideas? this because ajax asynchronous. not possible return success callback. (there "sychronous" option, out of question series of dictionary lookups.) you need re-build program's flow operation (whatever - populating label or other element value example) takes pl

c# - ajax actionlink redirecting instead of updating tag -

when making ajax call controller redirecting , not updating tags code looks follows. this in _layout.cshtml <code> <script src="@url.content("~/scripts/jquery-1.4.1.min.js")" type="text/javascript"> </script> <script src="@url.content("~/scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@url.content("~/scripts/microsoftajax.js")" type="text/javascript"> </script> <script src="@url.content("~/scripts/microsoftmvcajax.js")" type="text/javascript"> </script> </code> and web config looks like, have tried turning off unobtrusive javascript off no luck. <code> <appsettings>

documentation - How to see docstrings and other symbol information in Common Lisp REPL? -

i'm new cl, , i'd learn how read documentation strings , other information repl. help(symbol) in python, or symbol? in ipython, or :t , :i in haskell's ghci. so, given symbol name, i'd able know: what kind of value bound to, if (a function, variable, none @ all) if function or macro, positional arguments if has docstring, show it what package or file coming or when defined i found there (documentation '_symbol_ '_type_) , not need. need know type of value symbol bound ( 'function , 'variable , 'compiler-macro , etc.) before can use documentation . returns docstring, may missing or not sufficient use symbol. for example, in lisp, mapcar not useful (clisp's repl): > (documentation 'mapcar 'function) nil i'd able see instead: >>> map? type: builtin_function_or_method base class: <type 'builtin_function_or_method'> string form: <built-in function map> namespace: python

ruby on rails - Creating Form with accepts_nested_attributes_for -

i have 2 models, user , patient. user has_one patient , patient belongs_to user. class patient < activerecord::base belongs_to :user accepts_nested_attributes_for :user attr_accessible :user_id, :user_attributes end # == schema information # # table name: patients # # id :integer not null, primary key # user_id :integer # insurance :string(255) # created_at :datetime # updated_at :datetime # class user < activerecord::base has_one :patient attr_accessible :username, :password, :active, :disabled, :first_name, :last_name, :address_1, :address_2, :city, :state, :postcode, :phone, :cell, :email attr_accessor :password end # == schema information # # table name: users # # id :integer not null, primary key # username :string(255) # encrypted_password :string(255) # salt :string(255) # active :boolean # disabled :boolean # last_login :time # first_n

actionscript 3 - flash as3 movieClip loader doesn't load in numerical sequence -

i loading array of movie clips , adding them stage flash as3, problem movie clips added stage finish loading, , not in order of there position in array, order on screen appears messed up. how ensure added stage in same order references exist in url? here code: var currentloaded:int = 0; function loadthumbs(){ (var in project_array){ var thumbloader:loader = new loader(); thumbloader.load(new urlrequest(project_array[i].project_thumb)); thumbloader.contentloaderinfo.addeventlistener(event.complete, thumbloaded); } } function thumbloaded(e:event):void { project_array[currentloaded].projectthumb.thumbholder.addchild(e.target.content); admin.slideholder.addchild(project_array[currentloaded].projectthumb); currentloaded++; } well typing same solution... load in specific order, have make recursive. may try loadermax library greensock. rock solid, fast , lightweight. besides easy use , can set ammount of parallel loading treads. can

spring exception handler to not handle certain types of exception -

ive set simple exception handler in spring 2.5 app. catches exception s , shows stacktrace page. this , good, spring security not kick non-logged in user login page, instead exception page shown spring security exception: org.springframework.security.accessdeniedexception the problem application doesnt have own exception subclass uses exceptions, must map exception unmap accessdeniedexception is possible in spring 2.5? edit : spring security 2.0.1 my bean looks this <bean class="org.springframework.web.servlet.handler.simplemappingexceptionresolver"> <property name="exceptionmappings"> <props> <prop key="java.lang.runtimeexception">common/error</prop> </props> </property> </bean>** the way handle have custom exception resolver class handles exceptions not caught other handlers - implements handlerexceptionresolver, ordered. we declare separate

svn - subversion ignore files on import? -

is possible set subversion property before initial import has taken place? i'm getting ready import web cms new repository. has directory sites/default/files , files user-generated, , don't want them in repository. i'm trying set property beforehand, looks can't, because obivously, it's not repository. $sites/default/files> svn propset svn:ignore '*' . svn: '.' not working copy how do import ignoring folders? simply not possible. import folder tree without files folder.

C++: Drawing a 2D disk in OpenGL -

i've tried write proper function drawing 2d disk on screen opengl few days now, , can't seem right :( this current code: void disk( float x, float y, float r, const color& vcolor ) { glbegin( gl_triangle_fan ); glvertex2f( x, y ); for( float = 0; <= 2 * pi + 0.1; += 0.1 ) { glvertex2f( x + sin( ) * r, y + cos( ) * r ); } glend(); } when zooming in, resulting disk shows spikes, not in edges spikes pointing out. also function doesn't draw 1 disk only, bit more 1 - means if alpha enabled, results wrong. what need change in function draws disk? void circle(float x, float y, float r, int segments) { glbegin( gl_triangle_fan ); glvertex2f(x, y); for( int n = 0; n <= segments; ++n ) { float const t = 2 * m_pi * (float)n / (float)segments; glvertex2f(x + sin(t) * r, y + cos(t) * r); } glend(); } that should rid of overdraw. spikes... pictu

python - Output dictionary to csv file -

i have nested dictionary in following format, used internationalization (this allows our translators , non-programmers edit file necessary; backup plan use json format, not suitable these users..). dict[language][key] = value i output csv file in following format: key, value-lang-1, ... value-lang-n where value-lang-i = dict[language-i][key] this works fine, long values simple strings. run problem, though, if value more complex (a nested dict or list). there way handle robustly? it hard suggest alternative format suitable manual editing non-technical users without knowing exact details of data structures want store there (e.g. nested dicts/lists mention). one obvious suggestion stick computer-friendly format , provide usable gui editing files.

resources - Best way to add a formatted localized string to an ASP.NET page? -

i've been using <asp:literal runat="server" meta:resourcekey="blah" /> resx files in app_localresources directory translatable strings, if key, blah.text "enter {0} category", how pass parameter replace {0} in context? i know use <%=string.format(... seems unclean , can't access local resources in way. should use case? an example of markup: <asp:literal runat="server" id="blah" /> from code behind: blah.text = string.format( "enter {0} category", getlocalresourceobject("blah").tostring() ); by using getlocalresourceobject method.

javascript - Sort one list based on the order of a second list -

i'm new jquery , struggling work out how solve problem. i have 2 unordered lists, list , list b. list sortable using .sortable({ axis: 'y' }) method. when list reordered, automatically reorder list b (which not user sortable) reflect changes in list a. i'm struggling know start, if can help, appreciated. thanks update : here's code page put things context. <div class="cvoverview"> <h4>cv overview</h4> <ul class="sortable" id="lista"> <li id="item_1" class="editcontent"><span></span>about me</li> <li id="item_2" class="editcontent"><span></span>personal profile</li> <li id="item_3" class="editcontent"><span></span>employment history</li> <li id="item_4&

How to access bpos Exchange online via WebDav? -

i trying access exchange mailbox via webdav. locally used following url so: https://server/exchange/username/inbox/ since moved our server bpos (exchange online) not sure url use access mailbox. bpos server handle multiple domains , not sure put domain in url above. does has experience in accessing bpos exchange server programmatically? thanks andreas we use "webdav .net exchange", commercial library access microsoft exchange online server on webdav protocol. have use forms based authentication login , url https://red003.mail.microsoftonline.com/exchange/xxxxxx@xxxxx.microsoftonline.com

Styling GWT FlexTable only with CSS -

how style gwt flextable using css? api mentions nothing css classes available. aren't there classes , have set them myself? i instance styling on "th". flextable (which extends htmltable ) doesn't appear apply particular styles cells contains. there 2 possible solutions: apply style enclosing flextable , use descendent selectors ( .myflextable th {} ) style cells. use cellformatter add own style names cells in flextable.

flex - How to Print the custom item renderer images in Advanced Datagrids -

we have developed web application using flex-blazeds-java. got requirement print user existed page whenever clicks on print button. able print flex components , advanced datagrid not able print custom item renderer images rendered in datagrid. , how print multiple pages when have large data in advanced datagrid. use printadvanceddatagrid printing purposes. use same custom itemrenderer same images appear. printadvanceddatagrid provide functionality pagination. from adobe documentation: // queue first page. printjob.addobject(theprintview); // while there more pages, print them. while (theprintview.mydatagrid.validnextpage) { //put next page of data in view. theprintview.mydatagrid.nextpage(); //queue additional page. printjob.addobject(theprintview); } for more info, check out: http://livedocs.adobe.com/flex/3/html/help.html?content=printing_5.html

model view controller - What's the Rails way of making super-minimal websites? (1 form --> results page) -

i'm making website simple form on homepage. when user submits form, application crawls website , presents results on new page. domain.com has search form (:method => "get") domain.com/search/xxxxxx has results of search. i'm having trouble thinking models , controllers when i'm not working obvious objects users, posts, threads, or shoppingcart. what's rails way of organizing such application? try using sinatra your site should this. rails heavy requirements. get '/' erb :form, layout => :layout end '/search/:key_word' # use params[:key_word] u want end

SQL: detecting differences in sums between two tables? -

it seems simple enough: have 2 votes , want see states have different numbers of votes. individually, it's easy: select state, sum(votes) votes_a group state; select state, sum(votes) votes_b group state; how query state, votes_a, votes_b states have different results? try join: select totals_a.state, totals_a.total_votes, totals_b.total_votes ( select state, sum(votes) total_votes votes_a group state ) totals_a join ( select state, sum(votes) total_votes votes_b group state ) totals_b on totals_a.state = totals_b.state totals_a.total_votes <> totals_b.total_votes note miss states received 0 votes in 1 of tables. fix use full outer join (assuming database supports feature) , check nulls.

android - Modifying AndroidManifest.xml with build tag causes infinite rebuilding in Eclipse -

i've added tagging / date-stamping system android build system similar thread found here on stack overflow: embed version details in android apk this worked out great me, post awesome , modified perl put in datestamp thus: perl -npi -e 's/(build date:)(.+)(dev-mob)/"build date: " . localtime() . " dev-mob"/e;' $manifest the issue i'm dealing eclipse wants continue building on , over. sees androidmanifest.xml has changed, starts autobuild, thereby changing androidmanifest.xml , sparking autobuild... rinse, lather, repeat. i've turned off "build automatically," , result fine me (i.e. build on debugging deployment and/or after clean), not on every single file save and/or change eclipse want do. co-worker wants autobuild functioning normal, , says date stamping defective otherwise. how "builder" mark tree refreshed and/or up-to-date after modifying androidmanifest.xml, tree doesn't keep looping? looks flag s

Is there a way in PHP for me to specify that an array will consist only of certain types of objects? -

for example suppose have car object , want array consist of cars. there syntax allows me this? no. php not have strong typing. the way can think of enforcing have cararray class has getters,setters,etc.. functions enforce parameters of class car.

osx - Why am I not getting any images in my dot output? -

i've installed mac os x binaries graphviz website , downloaded test .dot file. http://www.karakas-online.de/downloads/from-past-to-future.tgz from page: http://www.karakas-online.de/forum/viewtopic.php?t=2647 it produces image, none of embedded images visible. here's output command "dot -v" dot - graphviz version 2.26.3 (20100126.1600) activated plugin library: libgvplugin_pango.6.dylib using textlayout: textlayout:cairo activated plugin library: libgvplugin_dot_layout.6.dylib using layout: dot:dot_layout activated plugin library: libgvplugin_core.6.dylib using render: dot:core using device: dot:dot:core plugin configuration file: /usr/local/lib/graphviz/config6 loaded. render : cairo dot fig gd map ps quartz svg tk vml vrml xdot layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi textlayout : textlayout device : bmp canon cgimage cmap cmapx cmapx_np dot eps exr fig gd gd2 gif gv imap imap_np ismap

sandbox - Lua Sandboxing - Eliminating Function Creation -

i've read on lua wiki / here / etc. on how sandbox lua code generally. haven't been able find disallows function creation. example, example here provides sample code as: assert(run [[function f(x) return x^2 end; t={2}; t[1]=f(t[1])]]) and that's empty environment. want eliminate ability create function (the 1st part of code) - e.g., allow expressions. idea on how that? have in c somehow? in advance! if want evaluate expressions only, try this: function run(s) return loadstring("return "..s)() end (error handling omitted) this simple solution prevent `attacks', not eliminate them because 1 can say (function () f=function(x) print"hello" end end)() which defines new function named f . your best bet use sandbox , not worry user environment, because it'll not your environment.

Post wall message on facebook account -

i trying implement functionality in blackberry app, saw in other application. basically it's window has message, , facebook icon. when click on icon launches new window, window asks user permissions(user , password), , message posted in user's wall. question how can replicate that?. have been looking @ graph api, can't figure out how of in 1 step. mean typing url in browser, , post data. lot. have looked @ facebook blackberry sdk project? facebook blackberry sdk

c# - How to move files with metadata in SharePoint? -

i have written code copies files , metadata new url. reason it's copying metadata word , excel files. non-microsoft, pdfs not metadata copied. code below, see should change? also, code worked pdfs when ran under 2007... static void copyfilewithhistorycrosssite(spfile sourcefile, spfolder destination, string destinationurl) { byte[] binfile; binfile = sourcefile.openbinary(); destination.files.add(destinationurl, binfile, true); } this code not "copy metadata" in destination, metadata recreated based on stream of file's stream (it called "property promotion", see http://msdn.microsoft.com/en-us/library/aa979617.aspx ). try spfile.copyto/moveto think may copy metadata.

makefile - CMake: specifying build toolchain -

very new cmake, , far i'm finding extremely helpful. have set of custom libraries build multiple platforms using cross-compilation. toolchains installed, , can hand-create makefile s need so, able make use of cmake. is there way tell cmake toolchain use, either @ command line or in cmakelists.txt file? have here : basically, define "toolchain file" sets things system name, paths compilers , on. call cmake so: cmake /path/to/src -dcmake_toolchain_file=/path/to/toolchain/foo-bar-baz.cmake

winforms - C# Template Forms Get panel in parent form -

i have form have created contains panel - panel1. have created template form inherits first form. how can add panel inherited template? you need set panel's modifiers protected in property grid.

flash - Turn off color ranges in Pixel Bender -

what best way turn turn off (using pixelbender) colors fall within range. example, turn off colors between 0x0000ff , 0x00ffff. help. has work in flash. thanks! if mean per channel "between", here simple way it. <languageversion : 1.0;> kernel untitled < namespace : "your namespace"; vendor : "your vendor"; version : 1; > { input image4 src; output pixel4 dst; parameter float rthreshold < minvalue: 0.0; maxvalue: 1.0; defaultvalue: 0.0; >; parameter float gthreshold < minvalue: 0.0; maxvalue: 1.0; defaultvalue: 0.0; >; parameter float bthreshold < minvalue: 0.0; maxvalue: 1.0; defaultvalue: 0.0; >; void evaluatepixel() { pixel4 sourcepixel = samplenearest(src,outcoord()); if(sourcepixel.r <= rthreshold) sourcepixel.r = 0.0; if(sourcepixel.g <

Mercurial subrepo and relative path -

i have project, have bitbucket repository for, , dependent on project incorporate subrepo. now, don't have push access subrepository, nor want or need to--it's pull-only relationship. i realize when push main repository, try push subrepositories, well. since cannot that, pulled local copy of dependent project, @ same level main repository's directory. in essence, have following layout: main/ ; pushes https://mine.org/main .hg/ .hgsub lib/ subrepo/ ; clone of main/../subrepo/ .hg/ subrepo/ ; local copy of https://forbidden.org/subrepo .hg/ the content of .hgsub like, lib/subrepo = ../subrepo then cloned, ~/path/to/main $ hg clone ../subrepo/ lib/subrepo so far, good. problem is, after set , committed changes, when try push main mercurial try push subrepo https://mine.org/subrepo , not exist, thereby failing whole push operation. is there i'm missing? why not create https://mine.org/subrepo -- if don

iphone - What causes (and how can I fix) this odd Core Location error? -

error,generic,time,320195751.128,function,"void clclienthandleregistrationtimerexpiry(__cfrunlooptimer*, void*)",registration timer expired, client still registering! there few mentions of problem able dig in wider internet, , nobody has useful info. here's context: i have app monitors device's location via cllocationmanager's startupdatinglocation method. starts monitoring, runs little while, message pops in debug output. point forward, no more location updates delivered. this error killing location functionality of app, , i'm @ loss may causing it. has exclamation point @ end, means it's exciting error. update: though never found solution problem, or figured out why happens in first place, i've lost ability reproduce it. seems have happened during period of time in did many things, including general change in code structure followed update ios 5 beta. there seems have silenced issue me. have implemented - (void)locat

android - lockCanvas() really slow -

testing game on slower device (orange san francisco aka zte blade) , have been getting appalling frame rate. i put debug code draw loop , discovered following line taking on 100ms: c = msurfaceholder.lockcanvas(); anyone else seen behaviour? temporarily replaced surfaceview extending view , implementing ondraw(), , got much better framerate. although in general surfaceview faster on htc desire. suspicious may android 2.1 problem. i'm contemplating rooting phone , upgrading 2.2 if possible, did want device running on 2.1 might counter-productive in long run. ** update ** i've been working on more, , have discovered more puzzling aspects it. i rooted phone , installed 2.2 , problem still happens. when app first started, lockcanvas working expected (0-1 ms). @ point during initialisation, lockcanvas starts taking approx 100ms. it might worth pointing out loading assets in async task, can display loading screen. despite best efforts pin down program doing whe