Posts

Showing posts from April, 2015

javascript - Wrong value in console.log -

possible duplicate: is chrome's javascript console lazy evaluating arrays? i have following snippets in javascript output makes me feel going wrong. 1. a=2; console.log(a); a+=2; console.log(a); output: 2 4 ; expected 2. t=[0,2]; console.log(t); t[0]+=2; console.log(t); output: [2,2] [2,2] shouldn't output be [0,2] [2,2] ? and whats difference between above 2 cases results in different answers in both cases? it's because log delayed until chrome has time (i.e. scripts releases cpu). try understand happens : var t=[0,2]; console.log(t); settimeout(function() { t[0]+=2; console.log(t); }, 1000); it outputs expect. is bug of chrome ? maybe side effect of optimization. @ least it's dangerous design... why there difference ? suppose chrome stores temporarily must log, primary (immutable) value in first case, pointer array in last case.

linux - how to stop objcopy from padding sections -

i'm using objcopy on bash (ubuntu linux) , im trying copy 2 sections elf file using folowing commend: objcopy -j .section1 -j .section2 the problem objcopy adding padding between sections. there way (a flag?) can stop objcopy padding sections? the sections placed 1 after other in file there no need kind of padding.... solved! problem sections 1 after other not @ same segmant. 1 in w e segment , 1 in r w segmant. , thats why objcopy messed up.

javascript - HTML <select> JQuery .change not working -

alright don't see why isnt working. seems pretty simple. here drop-down menu: <div> <form> <select id='yeardropdown'> <c:foreach var="years" items="${parkyears}"> <option value=/events.html?display_year=${years}<c:if test="${currentyear == years}">selected="selected"</c:if>>${years}</option> </c:foreach> </select> </form> </div> and here javascript $("#yeardropdown").change(function () { alert('the option value ' + $(this).val()); }); right want working can add functionality. thanks! that code syntactically correct. running @ wrong time. you'll want bind event when dom ready : $(function(){ /* dom ready */ $("#yeardropdown").change(function() { alert('the option value ' + $(this).val()); }); }); or, use live : $...

Java Servlet/Jsp image upload along with form values -

i have jsp form accepts details employee name, sex, age, e-mail address , servlet 3.0 container's has standard support multipart data. first should writing html page takes file input along other input parameters. <form action="uploadservlet" method="post" enctype="multipart/form-data"> <input type="text" name="name" /> <input type="text" name="age" /> <input type="file" name="photo" /> <input type="submit" /> </form> now write uploadservlet uses servlet 3.0 upload api. here code demonstrates usage of api. fist servlet handling multipart data should define multipartconfig using of 2 approaches: @multipartconfig annotation on servlet class in web.xml, adding <multipart-config> entry inside <servlet> definition. here uploadservlet, @multipartconfig public class uploadservlet extends httpser...

c++ - How to detect if running inside Windows Metro application process? -

i developing library , able detect if running inside metro style application selectively disable/enable functionality. possible? you can use imetromode interface check if library has been loaded inside metro-style application. call getmonitormode() method, if pmode hold mmm_metro you'll sure you're running inside metro application.

Django dumpdata by date -

is there way or modules available dumpdata of models filtered date? example, between range of dates or dates greater|lesser given. limiting-the-amount-of-fixtures-in-django-dumpdata deals id , explicit model names arguments. i'm not meaning django/python datetime fields. i'm assuming there might native support of date , time keep track when record added in database. , use postgres. there no other way limit dataset range of dates.

mysql - Ensure values are not the same in a column -

i have table column values should not same. due poor implementation software not check ensure if user enters duplicate or not, therefore entrusted task of writing "simple" sql statement or function @ values in column , ensure not identical. sql executed once month not have efficient. the column stores int , increment 1 of duplicate values, , keep on doing every time until there no more entries in table have same value column. suggestion should do? not sure start. thanks insight. edit: sorry forgot mention values in data not duplicate should stay way. these settings used customers, , should punish them if have duplicate values. if not, should not destroy settings or angry. it 1 table, contains lot of columns, 1 specific column in particular of type int , never contains nulls, should not have duplicates. create table tablename (keycol int identity(1,1), intcol int) insert tablename values (1), (2), (2), (3), (5), (6), (5), (7), (9) while exists ( se...

nlp - Natural Language Generation in PHP -

i woke last night thought in head: can php used generate random words sound natural? (like lorem ipsum verses). words being single letter: 'a,e,i,o,u' words being double letter: combination of vowel , consonant. maximum word length think 6 letters. the purpose fill space on website templates instead of 'lorem ipsum', or send test emails php scripts make sure mail() works. but thoughts on how work php generate random length words, 1-6 letters each, few "don't this" rules "no 2 single-letter words next each other" or "no three-vowels in row" or "no three-consonants in row" , automatically add punctuation , capitalization after between 4 , 8 words sentence. would @ possible, , if so, there pre-existing classes or functions implement? you can take context-free grammar approach: http://en.wikipedia.org/wiki/context-free_grammar <word> := <vowel> | <consonant><remaining word following ...

android - Disable use of AsyncTask, using custom AsyncTask -

i have following implementation of asynctask , allowing multiple asynctask s run concurrently: public abstract class myasynctask<params, progress, result> extends asynctask<params, progress, result> { public asynctask<params, progress, result> executecompat(params... params) { if (build.version.sdk_int >= build.version_codes.honeycomb) { return executeonexecutor(thread_pool_executor, params); } else { return execute(params); } } } now avoid confusion , accidental use of normal asynctask , block access code to: the asynctask class, myasynctask should used. the execute() function in myasynctask . is possible this? my idea of doing bit different. instead of extending asynctask class, can create method takes parameter asynctask want use. here example: public void executeasynctask(asynctask asynctask) { if (build.version.sdk_int >= build.version_codes.honeycomb) { asyn...

asp.net mvc 4 - Razor, MVC4, @html.dropdownlistfor problems -

i'm trying create drop down list populates database. have: public class employee { [key] public int id { get; set; } [required] public string firstname { get; set; } [required] public string lastname { get; set; } [required] public string jobtitle { get; set; } } public class project { [key] public int id { get; set; } [required] public string projectname { get; set; } [required] public string companyname { get; set; } } public class projecthour { [key] public int id { get; set; } [required] public decimal hours { get; set; } [required] public datetime date { get; set; } public virtual icollection<employee> employeeid { get; set; } public virtual icollection<project> projectid { get; set; } } what want create form create new project hours associated projec...

date - split string based on character position in ORACLE 11g SQL -

i'm using oracle 11g sql developer i have varchar2 column dates 0523 (mmdd). i want convert them date column , have them 23-05 (dd-mm).. any ideas? well, can string operations directly format want: substring(c, 3, 2)||'-'||substring(c, 1, 2) to convert date, can use: to_date('2012'||c, 'yyyymmdd') to convert date form want: to_char(<date>, 'dd-mm')

Derived data type pointer? -

i'm trying convert c code fortran 90. there way in fortran define derived data type pointer? code below example of i'm talking about. typedef struct _rkmatrix rkmatrix; typedef rkmatrix *prkmatrix; the struct _rkmatrix defined outside snippet of code. example declarations linked list: type mycustom_type real :: value type (mycustom_type), pointer :: next => null () end type mycustom_type type (mycustom_type), pointer :: head_of_list

c# - What is the difference between Node.SelectNodes(/*) and Node.childNodes? -

string xml1 = "<root><inserthere></inserthere></root>"; string xml2 = "<root><child1><childnodes>data</childnodes><childnodes>data1</childnodes></child1><child2><childnodes>data</childnodes><childnodes>data1</childnodes></child2></root>"; among below mentioned 2 code samples.. usage of childnodes doesn't copy child nodes xml2. <child1> being copied. string strxpath = "/root/inserthere"; xmldocument xdxmlchilddoc = new xmldocument(); xmldocument parentdoc = new xmldocument(); parentdoc.loadxml(xml1); xdxmlchilddoc.loadxml(xml2); xmlnode xnnewnode = parentdoc.importnode(xdxmlchilddoc.documentelement.selectsinglenode("/root"), true); if (xnnewnode != null) { xmlnodelist xnchildnodes = xnnewnode.selectnodes("/*"); ...

how to find attributes of image by javascript -

i've image attributes name, width. and i'm trying attribute value not existing image. var title = imgtemp.attributes("title").value; and giving error, because argument title not there. how can check before assign? you can use getattribute : var title = imgtemp.getattribute('title'); if there no title attribute, return null . you can access attribute directly property: var title = imgtemp.title; it return empty string if there no title attribute present, means have same return value if title attribute present empty, f.ex: <img title="">

c# - how to get particular column value from DataGrid and add it as combobox items in wpf using Linq to sql concept -

Image
i have loaded above table state in datagrid control.but want particular column state_name , add it's value(tx,tn,up,nul,.....) combobox items. belove code wrote load state table datagrid control. using (dataclasses1datacontext _mc = new dataclasses1datacontext()) { var _mycountry = cntry in _mc.gettable<state>() select cntry; grd_table.itemssource = _mycountry; } there many solutions use linq because of how easy use. guess want value of comboboxitems state_id of state , displayed name state_name? following code you? grd_table.itemssource = _mycountry; combobox.itemssource = (from m in _mycountry select m).tolist(); combobox.displaymemberpath = "state_name"; combobox.selectedvaluepath = "state_id";

jquery - Call a function within a function to init -

;(function ($, w, d, config, undefined) { $.fn.pluginname = function ( options, config ) { var pluginname = this; var defaults = { //defaults }; var settings = $.extend({}, defaults, options); var methods = { init : function ( settings, options ) { //init stuff here } } }) })(jquery, window, document) // html looks <script> $('.item').pluginname({ methods : 'init' }); </script> i'm new plugin development, , objects in general, i'm trying learn in deep end without swimmies. :) basically, want initialize plugin calling "init" function within methods variable. plugin's name "pluginname". i having trouble calling "init" fn because lives within variable named "methods". also, take 1 step further, need collect "item" classes on page , set inside data variable. in init function have following: return this.each(function(){ ...

c# - Counting an Array XNA HLSL -

wondering how count array in hsls? say, have array declared in our effect file: float2 position[1]; and inside our source set parameter else instance: effect.parameter["position"].setvalue(myvector2array); under shadering function how count array? similar to: float4 ps_function(float2 tex : texcoord0) : color0 { int size = position.count(); } thanks in advance :] the simple way declare constant define array size: const static int max_positions = 1 float2 position[max_positions];

c# - How can I parse this HTML to get the content I want? -

i trying parse html document retrieve of footnotes inside of it; document contains dozens , dozens of them. can't figure out expressions use extract of content want. thing is, classes (ex. "calibre34") randomized in every document. way see footnotes located search "hide" , it's text afterwards , closed < /td> tag. below example of 1 of footnotes in html document, want text. ideas? guys! <td class="calibre33">1.<span><a class="x-xref" href="javascript:void(0);"> [hide]</a></span></td> <td class="calibre34"> among other factors on premium based average size of losses experienced, margin contingencies, loading cover insurer's expenses, margin profit or addition insurer's surplus, , perhaps investment earnings insurer realize time premiums collected until losses must paid.</td> use htmlagilitypack load html document , extract footnotes xpath: ...

html - Get the href value using XPath/Hpple/Objective-C -

i tried makes (and doesn't make) sense me. have following html code try parse xpath in objective-c: <tr style="background-color: #eaeaea"> <td class="content"> <a href="index.php?cmd=search&id=foo">bar</a> </td> </tr> i "bar" via //tr/td[@class='content']/a/text() . but have no idea how index.php?cmd=search&id=foo . it drives me despair :-( thank help! after trying whole night (again) found out how solve problem: //put elements in array nsarray *somearray = [xpathparser searchwithxpathquery:@"//tr/td[@class='content']/a"]; //just 1 possibility make for-loop (tfhppleelement *element in somearray) { //this important line: nsstring *myurl = [[element attributes] objectforkey:@"href"]; //do whatever want myurl } i hope helps folks out there!

jasper reports - Create an external URL hyperlink with JasperReports -

how include hyperlink (url) in pdf links external site? using simple string " http://www.stackoverflow.com ", link automatically generated. but, how can use url <a href="http://www.stackoverflow.com">click here</a> ? if use html string, jaspers create link shows code. using jasperreports 4.0.4 , ireport 4.5.1. to make textfield hyperlink external url, need add attribute hyperlinktype="reference" element, , add <hyperlinkreferenceexpression> tag within it. reference expression put url. for example: <textfield hyperlinktype="reference" hyperlinktarget="blank"> <reportelement x="5" y="5" width="200" height="15"/> <textelement/> <textfieldexpression class="java.lang.string"><![cdata["click here!"]]></textfieldexpression> <hyperlinkreferenceexpression><![cdata["http://www.goo...

Is the quality of a language where it's not required to declare a variables type an example of weak typing or dynamic typing -

is quality of language it's not required declare variables type (such php , perl) known weak typing or dynamic typing? i'm having trouble getting head around 2 terms. am right dynamic/static typing pertains type conversion whereas weak/strong typing pertains deceleration of variable? according to: http://en.wikipedia.org/wiki/type_system#static_and_dynamic_type_checking_in_practice weak typing means language implicitly converts (or casts) types when used. whereas: a programming language said use static typing when type checking performed during compile-time opposed run-time. so, strong/weak , static/dynamic 2 different dimensions. language 1 of strong/weak, , 1 of static dynamic. instance, ruby , javascript both dynamically typed, ruby typed while javascript weakly typed. is, in ruby following code give error: 1.9.2p290 :001 > 'a'+1 typeerror: can't convert fixnum string whereas in javascript, get: > 'a'+1 >...

java - Spring JDBCTemplate Update issue -

in table definition, there column int data type. if value "0", want jdbctemplate update method update field "null" instead of "0" default. this.jdbctemplate.update("update gcur_observation " + "set observerid = ?," + "observationdate = ?," + "pointcuring = ?" + " locationid = ? , observationstatus = 0", new object[] { new integer(newobservation.getobserverid()), newobservation.getobservationdate(), new integer(newobservation.getlocationid()) }); the code snippet above runs when point curing not null . however, how can stored null in database table? i hope getting null pointer exception. try this integer locid = null; if(newobservation.getlocationid() != null) { locid = new integer(newobservation.getlocationid()); if(locid == 0) { locid = null; } } and pass locid her...

r - "Error in mktdata[, keep] : number of dimensions incorrect " due to stock "T" referring to TRUE? -

i have problem when trying run example of quantstrat on stock at&t referred symbole "t". believe because r somewhere thinking t refering true. here code: library(quantstrat) ticker="t" total_hist.start = as.date("2006-06-22") total_hist.end = as.date("2008-06-20") total_hist = total_hist.end - total_hist.start currency("usd") stock(ticker,currency="usd",multiplier=1) getsymbols(ticker,from=total_hist.start,to=total_hist.end,to.assign=true) init.date = initdate=total_hist.start-1 strat.name<- "mystrat" port.name <- "myport" acct.name <- "myacct" tradesize = 1000 initeq=as.numeric( tradesize*max(ad(get(ticker)) ) ) port <- initportf(port.name,ticker,initdate=init.date) acct <- initacct(acct.name,portfolios=port.name, initdate=init.date, initeq=initeq) ords <- initorders(portfolio=port.name,initdate=init.date) strat<- strategy(strat.name) strat<- add.indicator...

Ajax Request Error using Jquery -

i have application in fb on website.. i sending ajax request in fb working fine in own web doesn't show nothing. on firefug console shows red color. anybody have idea here link of application fb link and web link here when add pincode or city click find. it works fb anybody tell me exact problem you getting following error message: xmlhttprequest cannot load https://7elevenstores.ca/store_locator/getlatlng. origin http://www.slurpee.ca not allowed access-control-allow-origin. what means is, trying make xmlhttprequest (ajax request) origin (another domain). , not allowed. ajax request may go same origin page loaded from. check out article on mdn on access policy and this article same origin policy javascript

java - hibernate save and read from DB -

i new in java , use hibernate. i added in code datapoints instances: datapoint dp = new datapoint(); dp.setdataset(dataset); dp.setstation(station); i run dataset.getdatapointcount() function has count dp dataset id: public int getdatapointcount() { criteria crit = database.getsession().createcriteria(datapoint.class); crit = crit.add(restrictions.eq("dataset", this)); crit.setprojection(projections.rowcount()); integer result = (integer)crit.uniqueresult(); return result.intvalue(); } and got 0 datapoints. (when run finished see new datapoints in database). i added database.getsession().flush(); before getdatapointcount() function , realy return new number (1000 example) but in end of runing datapoints didnt saved in database! in addition, if write getdatapointcount() after filush() twice ,i got in first time right answer(1000) , in second time no right answer (0) can 1 me? tha...

c# - The post back object is not correctly filled after a submit in MVC4 with editor templates -

i've got troubles mvc4 , editor templates when post after press submit button. model : public class form { public form() { this.rows = new list<row>(); } public list<row> rows { get; set; } public int id { get; set; } } public class row { public row() { this.label = string.empty; this.type = string.empty; } public string label { get; set; } public string type { get; set; } public int id { get; set; } } public class simplerow : row { public simplerow() { this.value = string.empty; } public string value { get; set; } } public class dropdownrow : row { public dropdownrow() { this.content = new list<contentdropdown>(); } public list<contentdropdown> content { get; set; } } public class contentdropdown { public contentdropdown() { this.title = string.empty; this.selected = false; } public string titl...

java - Resource Loading: How to determine if it's a directory -

currently use solution load resources: url url = myclass.class.getclassloader().getresource("documents/"+path); if(url == null) throw new filenotfoundexception(); bufferedreader reader = new bufferedreader( new inputstreamreader(url.openstream())); sadly can't control whether path file or directory. there way can determine if denoted path directory? i'm looking solution independent resource loaded (in other words: file.isfile won't work when loading resource jar). i use code grab names of text files jar. public string[] getfiles() throws ioexception { arraylist<string> list = new arraylist<string>(); list<jarentry> ents = new arraylist<jarentry>(); enumeration<jarentry> e = null; url jarp = getlocation(); if (jarp != null) { jar = jarp.getprotocol().equalsignorecase("jar") ? jarp : new url("jar:" + jarp.tostring() + "!/"); jarfile jarf = n...

iphone - CLLocationCoordinate2D currentCentre not returning lat/long -

cllocationcoordinate2d currentcentre; not returning lat/long when use method in viewdidload if use viewdidappear works lat/long coming somewhere else(not accurate). on viewdidload or viewdidapear execute [self querygoogleplaces:@"grocery"]; i'm new nice please -(void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. //back button uibarbuttonitem *back = [[uibarbuttonitem alloc] initwithtitle:@"back" style:uibarbuttonitemstyleplain target:nil action:nil]; [[self navigationitem] setbackbarbuttonitem:back]; self.mapview.delegate = self; locationmanager = [[cllocationmanager alloc] init]; [locationmanager setdelegate:self]; [locationmanager setdistancefilter:kcldistancefilternone]; [locationmanager setdesiredaccuracy:kcllocationaccuracybest]; [self.mapview setshowsuserlocation:yes]; firstlaunch=yes; imagename=[[nsstring alloc] init]; imagename=[nsstring stringwithformat:@"park.png"]; [self ...

java - How to request focus synchronously in Swing? -

Image
when call component.requestfocusinwindow() , swing enqueues asynchronous focus_gained , focus_lost events rather synchronously transferring focus. workaround, appears defaultkeyboardfocusmanager trying simulate synchronously switching focus delaying dispatch of keyboard events until focus events have finished dispatching. appears isn’t working properly. question: there way change focus synchronously in swing? defaultkeyboardfocusmanager trying simulate synchronous focus, , buggy? there focus manager correctly? motivation: have jtextfield automatically transfers focus when it’s full. in writing integration tests using java.awt.robot , need behavior deterministic , not timing-dependent. related question didn’t response: how grab focus now ? here’s demo. expected behavior: when hold down key, each jtextfield contain single character. actual behavior: focus not change fast enough multiple characters. update : note behavior not specific progammatically changing focus. i...

ruby - Poking around in parent's internal state -

tl:dr how decoupling work? need little example i'm reading programming ruby - pragmatic programmer's guide. (http://ruby-doc.org/docs/programmingruby/html/tut_classes.html) there example on how implement to_s subclass karaokesong of song. class karaokesong < song # ... def to_s "ks: #{@name}--#{@artist} (#{@duration}) [#{@lyrics}]" end end asong = karaokesong.new("my way", "sinatra", 225, "and now, the...") asong.to_s » "ks: way--sinatra (225) [and now, the...]" now bad way it: say decided change song store duration in milliseconds. suddenly, karaokesong start reporting ridiculous values. idea of karaoke version of ``my way'' lasts 3750 minutes frightening consider. instead should define to_s super: def to_s super + " [#{@lyrics}]" end now when @duration variable still stores song duration in miliseconds, how new to_s calls parent's method solve problem? still returns 3750 ...

java - Unable to get ActiveMQ to dequeue -

there might stupid simple answer this, i'm trying use activemq pass messages between producers , consumers. have many producers , many consumers, want each message delivered once among consumers. seem mean cannot use topics, since deliver messages consumers listening, , want 1 consumer receive each message. my problem able receive messages, messages not dequeued. if restart consumer process, of messages reprocessed. this answer seems pertinent not seem apply since can't create durable queue consumers, durable topic consumers (unless i'm missing in api docs). my code follows. topicconnectionfactory factory = new activemqconnectionfactory(props.getproperty("mq.url")); connection conn = factory.createconnection(); session session = conn.createsession(true, session.client_acknowledge); queue queue = session.createqueue(props.getproperty("mq.source_queue")); conn.start(); messageconsumer consumer = session.createconsumer(queue); then later ...

javascript - Override Inline Styles added via JS with CSS -

a js plugin adding style giving me headache: element.style { z-index: 100 !important; } so have tried this: html body div#shell div#shellcontent div#bottompart div#rightcol div.containerbox div#embedcontainer div#janrainengageembed div.janraincontent div#janrainview div.janrainheader[style] { z-index: 1 !important; } and still nothing. contrary other answers, possible override inline styles css: http://css-tricks.com/override-inline-styles-with-css/ i guess extremely long selector might not hitting element. i had similar z-index issue janrain plugin solved this: #janrainengageembed > div[style] { z-index: 0; } in case, need: z-index: 0 !important;

CSS under float right -

i hope explain well. have div has style="float: right;" , in div have table editor fields. have 2 text editor boxes (in .net mvc3 @html.textareafor) sit under these edit fields. happens text editor boxes appear somewhere in middle of page , not under right floated editor fields. how make text editors appear under right floated editor fields? thank you try apply overflow:hidden parent of div float right, assuming blocks have below not in same parent. sure see markup.

google apps script - Password input field created with HTMLService loses type=password -

i'm creating password reset form use staff @ school using google apps education. i'm using htmlservice api import html file , use template. part of file table: <table id=passwords> <tr> <td>new password</td> <td> <input name='password1' id='password1' type='password'/> </td> </tr> <tr> <td>confirm new password</td> <td> <input name='password2' id='password2' type='password'/> </td> </tr> </table> when display gadget on google sites page, type='password' lost html, passwords aren't hidden when user types them in: <table id="passwords-caja-guest-0___"> <tbody><tr> <td>new password</td> <td> <input autocomplete="off" id="password1-caja-guest-0___" nam...

windows 7 - Batch Drag and drop files and folders -

i'm trying copy multiple files , folders drag , drop selection using solution think should this: mkdir newdir %%a in ("%*") ( echo %%a ^ >>new.set ) /f "tokens=* delims= " %%b in ('type "new.set"') ( set inset=%%b call :folderchk if "%diratr%"=="d" robocopy "%%b" "newdir" "*.*" "*.*" /b /e && exit /b copy /y %%b newdir ) exit /b :folderchk /f tokens=* delims= " %%c in ('dir /b %inset%') ( set atr=%~ac set diratr=%atr:~0,1% ) i've tried throwing code following examples i'm stuck: http://ss64.com/nt/syntax-dragdrop.html drag , drop batch file multiple files? batch processing of multiple files in multiple folders handling of special characters drag&drop tricky, doesn't quote them in reliable way. spaces not complicated, filenames spaces automatically quoted. there 2 special characters, can produce problems, exclamatio...

In Delphi how does the OnIncludeItem event work on TOpenDialog? -

i've been playing around topendialog in delphi xe2, , haven't been able work out how make onincludeitem event work. want able show files based on file name (or file size etc). has used event successfully? topendialog encapsulation of windows common dialog component. onincludeitem event encapsulation of cdn_includeitem notification mechanism. the documentation notification explains items have sfgao_filesystem , sfgao_filesysancestor flags set included, irrespective of return cdn_includeitem notification message (or event, in delphi). further, the documentation these sfgao attributes further suggests me cdn_includeitem mechanism never intended used filter file system items rather exclude things not part of file system. this confirmed in another answer different question .

sql - Why would my Access 2007 query suddenly become not updateable? -

i have query in access 2007. it's worked fine months, i'm getting "the recordset not updateable" error. thinking error must have been caused recent change, went archived versions (that definitley worked) - they're chucking out same error. table updatable; indeed, query on same table works fine. have happened break query? code follows: select prospects.company, contactnames.*, iif([prospects]![key contact]=[contactid],true,false) [key contact], prospects.status contactnames inner join prospects on contactnames.companyid=prospects.id (((prospects.status) not "duplicate")); any appreciated. thanks, oli. if using linked odbc tables, need include primary key field(s) tables in query if want query updateable. here potential "gotchas": access may not recognize primary key fields correctly in linked odbc table; (always?) access picks first unique index finds table (based on alphabetical order of index name) , assumes index prim...

Xcode iPad simulator keyboard opens in middle of screen -

Image
i running xcode 4.3.2 , started having following problem. all projects running in simulator positioning popup keyboard in center of ipad simulator. iphone simulator fine normal keyboard positioned @ bottom of screen. simple new project single text field shows keyboard in middle of screen equal amounts of white space above , bellow. occurs in orientations. interestingly, uipickerviews exhibit same behavior. this driving me nuts, has been fine many months , objects (text fields etc.) hidden when keyboard plops down smack in middle of screen. please help. in advance. tom this feature of ipad. can "drag" keyboard drag handle in lower-right hand corner of keyboard. image from blog post rob rogers indicates how use it. guess inadvertently moved keyboard.

google app engine - How to use ndb's OR? -

i have following code: employees = employee.query() employees = employees.filter(query.or(employee.passport_id == passport_id, employee.inn == inn)) employees.order(-employee.added) results = employees.fetch(5) but getting error: nameerror: global name 'query' not defined btw, how work in case passport_id none , employee.passport_id none . find such match? upd. fixed first problem adding from google.appengine.ext.ndb import query second question remains.. you should use ndb.or, won't need import query submodule (you should never have import that). if passport_id defined property, yes, querying employee.passport_id == none work. (be sure use '==' operator, not 'is'.)

ibm mq - Websphere MQ 7.1 Automatic Startup -

what best way startup automatically websphere mq v7.1 queue managers during system startup? see there supportpac it, want make sure right one. have mq running on 64-bit linux. thanks. yes, supportpac msl1 correct 1 linux. some other unix flavors can use supportpac as-is or modifications. windows, specify qmgr started automatically , wmq service start it. update 26 sep 2017 responding comments byteborg, checked , seems ibm have removed supportpac msl1 reason, list of withdrawn supportpacs. as happens i'm @ mqtc week , lots of ibmers hursley lab here i'll ask restore or put on github. if able so, internal review process make happen extensive won't happen soon. if doesn't work, i'll see getting permission host myself. stay tuned. update 1 oct 2017 while @ mqtc, mark taylor, mq architect ibm hursley labs, explained removal of msl1. basically, "it didn't work" according mark. instead, ibm have provided guidance in form of...

c# - Loop for every key? -

i have code: if (ks.iskeydown(keys.f11)) { if (rndkey == 11) { rightbutton(); } else { wrongbutton(); } pressed = true; } now problem is: need every key. can somehow loop keys.blabla? i'm newbie c# , xna so... yeah. i guess like: foreach (keys k in keyboard.getstate(playerindex.one).getpressedkeys()) { switch (k) { case keys.f11: if (rndkey == 11) { rightbutton(); } else { wrongbutton(); } break; case keys.f12: if (rndkey == 12) { rightbutton(); } else { wrongbutton(); } break; default: wrongbutton(); break; } }

r - ggplot2: Drop unused factors in a faceted bar plot but not have differing bar widths between facets -

Image
df <- structure(list(id = structure(c(1l, 1l, 1l, 1l, 1l, 2l, 2l, 2l, 2l, 2l, 2l, 3l, 3l, 3l, 3l, 3l, 3l, 4l, 4l, 4l, 4l, 4l, 4l, 5l, 5l, 5l, 5l, 5l, 5l, 6l, 6l, 6l, 6l, 6l, 6l, 7l, 7l, 7l), .label = c("1", "2", "3", "4", "5", "6", "7"), class = "factor"), type = structure(c(1l, 2l, 3l, 4l, 5l, 1l, 2l, 3l, 4l, 5l, 6l, 1l, 2l, 3l, 4l, 5l, 6l, 1l, 2l, 3l, 4l, 5l, 6l, 1l, 2l, 3l, 4l, 5l, 6l, 1l, 2l, 3l, 4l, 5l, 6l, 1l, 2l, 3l), .label = c("1", "2", "3", "4", "5", "6", "7", "8"), class = "factor"), time = structure(c(2l, 2l, 2l, 2l, 2l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 2l, 2l, 2l, 2l, 2l, 2l, 1l, 1l, 1l, 1l, 1l, 1l, 2l, 2l, 2l, 2l, 2l, 2l, 1l, 1l, 1l), .label = c("1", "5", "15"), class = "factor"), val = c(0.937377670081332, 0.522220720537007, 0.27869...

java - Opengl multiple textures with mixed colors -

Image
why colors of textures mixed? how can fix that? this how draw , initialize: private void initgl_3d() { int width = display.getwidth(); int height = display.getheight(); glloadidentity(); // reset projection matrix glu.gluperspective(45.0f, ((float) width / (float) height), 0.1f, 100.0f); // calculate aspect ratio of window glmatrixmode(gl_modelview); // select modelview matrix glloadidentity(); // reset modelview matrix glshademodel(gl_smooth); // enables smooth shading glcleardepth(1.0f); // depth buffer setup glenable(gl_depth_test); // enables depth testing gldepthfunc(gl_lequal); // type of depth test glhint(gl_perspective_correction_hint, gl_nicest); // nice perspective calculations } private void initgl_2d() { int width = display.getwidth(); int height = display.getheight(); glmatrixmode(gl_projection); glloadidentity(); glortho(0.0f, width, height, 0.0f, 1, -1); glmatrixmode(gl_modelview); gll...

c++ - Using ncurses to capture mouse clicks on a console application -

i'm making console application unix platforms, , i'm using curses (or ncurses) library handle keyboard , mouse input. problem i've found little documentation on how use that, appart this page , this one , don't have detailed examples. i've managed capture left click, can't work right click because options menu terminal emulator appears @ cursor location, event not processed application. how can avoid , have event captured in application? i have following line configuration of mouse events: // set mouse event throwing mousemask(button1_pressed | button2_pressed, null); and in method processes input, have following: int c = getch(); mevent event; switch(c) { case key_up: ... stuff break; case key_down: ... stuff break; case key_mouse: if(getmouse(&event) == ok) { if(event.bstate & button1_pressed) // works left-click { ... stuff } ...

optimization - LEMP Nginx + php-fpm high load timeouts then fine -

i'm pretty new of i'm ocd optimization. i'm trying optimize web server running lemp setup wordpress. i'm using wp hypercache instead of w3 total cache seems perform phenomenaly in comparison setup i'm using blitz.io test , throw 450 users @ domain 60 seconds starting full 450. this results: spike @ 5 sec errors , timeouts http://i.imgur.com/cdpbz.png htop during spike: http://i.imgur.com/oheys.png it's vps w/ 2 cpu @ 2.5ghz , 2.5gb memory, can see memory usage low. nginx: worker_processes 1; worker_connections 1024; php-fpm: dynamic, pm.max_children = 10, pm.start_servers = 2, pm.max_spare_servers = 2, ;pm.max_requests = 500 default value = 0 i've increased nginx worker_processes 2 no change, , i've messed php-fpm settings no change. ideas should looking at? this not bad. ~40 timeouts out of 19k requests normal. got similar results. as tuning: look http://wiki.nginx.org/httpfastcgimodule#fastcgi_cache - using avoids ...

winapi - How to port the C++ SetWindowsHookEx to C# or is this not possible? -

i looking @ example in microsoft kb318804 use threadid of "current" application!!! have c++ code works have rewrite it, , prefer re-write in c# while in there. 1 thing threadid of target application so: uint lastid = getwindowthreadprocessid(targethandle, intptr.zero); no, getcurrentthread not correct call getting thread id of remote application today , want do. targethandle handle remote application. i cast lastid int , tried wire c# code setwindowshookex returns 0 , fails. appdomain.getcurrentthreadid() seems work (even though deprecated, replacement though doesn't work either). do have go c++ code then? or there way work in c#? currently register hookhandler in c++ other application , events back. have checked out pinvoke.net entry setwindowshookex ? if setwindowshookex returns null , supposed call getlasterror , in c# should call marshal.getlastwin32error (assuming dllimportattribute.setlasterror included on p/invoke signature.) from ...