Posts

Showing posts from June, 2012

cuda - Low performance kernel -

i have cuda kernel there many operations , few branches. looks like __global__ void kernel(real *randomvalues, real mu, real sigma) { int row = blockdim.y * blockidx.y + threadidx.y; int col = blockdim.x * blockidx.x + threadidx.x; if ( row >= cntimesteps || col >= cnpaths ) return; real alphalevel = randomvalues[row*cnpaths+col]; real q = 0.0; real x = 0.0; if ( alphalevel < p_low) { q = sqrt( -2*log( alphalevel ) ); x = (((((c1*q+c2)*q+c3)*q+c4)*q+c5)*q+c6) / ((((d1*q+d2)*q+d3)*q+d4)*q+1); } else if ( alphalevel < p_high ) { q = alphalevel-0.5; real r = q*q; x= (((((a1*r+a2)*r+a3)*r+a4)*r+a5)*r+a6)*q / (((((b1*r+b2)*r+b3)*r+b4)*r+b5)*r+1); } else { q = sqrt( -2*log( 1.0-alphalevel ) ); x = -(((((c1*q+c2)*q+c3)*q+c4)*q+c5)*q+c6) / ((((d1*q+d2)*q+d3)*q+d4)*q+1); } randomvalues[row*cnpaths+col] = sigma * x + mu; } where a 's, b 's, c ...

angularjs - isolated scope "=" affects parent scope -

Image
in directive, define scope:{isonetwork:'=network'}, if parent scope has no 'network' property, auto create it? following pic parent scope: here code example(same in jsfiddle: http://jsfiddle.net/yougen/mvyrj/7/ ): var app = angular.module('app',[]) app.controller('appctrl', function($scope){ $scope.leavevoicemail = function(number, message, network){ console.log("controller scope: ", $scope); window.alert("number: " + number + " said: " + message + ", network: " + network); }; }); app.directive('phone', function(){ return { restrict:'e', scope:{ isolatedattributenumber:'@number', isonetwork:'=network', makecall:'&' }, link:function(scope){ scope.networks = ["verizon", "at&t", "sprint"]; scope.isonetwork = scope.ne...

XPages and Rich Text - " Item Note already exists" error -

i'm migrating lotus notes application xpages. 1 lotus notes form has rich text item on xpage added rich text control , bound item on notes form. whenever edit xpages document , make change in rich text editor, on saving error " item note exists". there way of solving prolem? i'm using 8.5.3. rich text field on notes form called "note". ideally able edit documents both in lotus notes client , in xpages. here code on xpage: <xp:inputrichtext id="notert" value="#{document1.note}" style="height:150.0px; width:300.0px" rendered="#{javascript:currentdocument.iseditable()}"> <xp:this.dojoattributes> <xp:dojoattribute name="toolbartype" value="slim"> </xp:dojoattribute> </xp:this.dojoattributes> </xp:inputrichtext> <xp:text escape="false" id="noteread" rendered="#{javascript:!currentdocument.iseditable()}" value="#{document...

newrelic - Custom vertical bar like deployment Tracking in New Relic RPM -

we want add additional vertical bars (like 1 deploys) new relic charts, mark other points in time important us, besides deploys. i did not find in docs, possible? or maybe different color. have things affect live operation, need visualize this. right there's not way add notes charts. word 'arbitrary' can sound pejorative, that's i'd see: ability add arbitrary text particular time such viewing graph see note e.g. "our tv ad airs" right way offer context either hack deployment system way walden mentioned, or create note , add explanatory text. https://newrelic.com/docs/site/public-and-private-notes neither ideal need, i'll let our product managers know (and others) see feature.

html - How to mask divs with a linear gradient mask? -

Image
i'm trying fade div 's content out @ edges using couple of absolutely positioned overlay div s @ either side. however, need background of page viewable once fade finished, , throughout - masking content of 1 div using 2 others linear 'fade' gradients. see diagram below better explanation... i have tried following: use -webkit-mask property linear gradient. works in webkit, nothing else. also, linear gradient rather choppy , stacatto when used mask property. not ideal. use svg gradient mask (e.g. in firefox / mdn demo ). works, in firefox. not anywhere near poor gradient -webkit-mask / linear-gradient in chrome though using transparent masking gif or png. however, in example used masking colour shows through (see this question ). i'm hoping there might way i've not thought of, or perhaps alternative layout use achieve same aim. thoughts? i think transparent png best bet, make absolute higher z index , make inside container div. contai...

python 2.7 - How to iterate link inside unknown total page number? -

i want application link inside every pages.but problem total page inside each category not same. have code: import urllib bs4 import beautifulsoup url ='http://www.brothersoft.com/windows/mp3_audio/' pageurl = urllib.urlopen(url) soup = beautifulsoup(pageurl) in soup.select('div.coleft.cate.mbottom dd a[href]'): print 'http://www.brothersoft.com'+a['href'].encode('utf-8','repalce') suburl = 'http://www.brothersoft.com'+a['href'].encode('utf-8','repalce') page in range(1,27+1): content = urllib.urlopen(suburl+'{}.html'.format(page)) soup = beautifulsoup(content) in soup.select('div.freetext dl a[href]'): print 'http://www.brothersoft.com'+a['href'].encode('utf-8','repalce') but link of application 27 pages in each category. if other category not have 27 pa...

linux - Printing all matches in a line using regular expression in awk -

say have line: terminal="123" pwd="567" i want select number portion using awk awk 'match($1, /[0-9]+/){print substr($1, rstart, rlength)};match($2, /[0-9]+/){print substr($2, rstart, rlength)}' file this gives desired result. 123 567. however there must other better way select both numbers without writing 2 match statements. thanks. here nice little solution awk : awk '{gsub("[^0-9]+"," "); print}' just converts consecutive non-digit characters 1 space, leaves 1 space before digit sequence 123 .

html - Vertically centering text within an inline-block -

i'm trying create buttons website using styled hyperlinks. have managed button looking how want, bar 1 slight issue. can't text ('link' in source code below) vertically center. unfortunately there may more 1 line of text demonstrated second button can't use line-height vertically center it. my initial solution use display: table-cell; rather inline-block , , sorts issue in chrome, firefox , safari not in internet explorer i'm thinking need stick inline-block. how go vertically centering link text within 57px x 100px inline-block , , have cater multiple lines of text? in advance. css: .button { background-image:url(/images/categorybutton-off.gif); color:#000; display:inline-block; height:57px; width:100px; font-family:verdana, geneva, sans-serif; font-size:10px; font-weight:bold; text-align:center; text-decoration:none; vertical-align:middle; } .button:hover { background-image:url(/images/categoryb...

jquery - How to get inner and outer width to a single element? -

Image
is there way in css or jquery inner , outer width single element ? have div has width of 100% , height of 30px , , inside div have navigation menu list (two unordered lists). want inner width of 960px div menu centered , background of div have width:100% because div has width of 100%. example: i don't want add other div inside or outside div. want this single div . how can accomplish this? any appreciated! thank much! what this? div{ width:100%; height:30px; border:1px solid red;/* fiddle visualization*/} ul{ margin:0; height:30px; width:430px; position: relative; } div ul:first-of-type{ background-color:#00f;/* fiddle visualization*/ left: 50%; margin-left: -430px; float: left; } div ul:nth-of-type(2){ background-color:#0f0;/* fiddle visualization*/ right: 50%; margin-right: -430px; float: right; } here fiddle: http://jsfiddle.net/fkzx5/

python - how to print contents of PYTHONPATH -

i have set path using sys.path.insert(1, mypath) then, tried print contents of pythonpath variable using os.environ below print(os.environ['pythonpath']) but getting error as raise keyerror(key) keyerror: 'pythonpath' how can print contents of pythonpath variable. instead of using os.environ dict, can simple use sys module: import sys print(sys.path) this solution should platform independant. pythonpath key can vary depending on os.

java - In Spring How to send email with attachments to multiple users -

i using spring & java based application. need send reports users periodically .i have done using javamailsender , velocity , jobscheduler. but need send reports multi recipients @ onetime. 1 know how send email multi recipients without showing other recipients has received same email using spring framework ? in class mimemessagehelper used javamailsender exist method named setbcc()... method received how parameter objects internetaddress or string arrays. besides can use in class mimemessage method addrecipient indicating message.recipienttype.bcc check official docs

c++ - Strange assembler generated by VS 2008 -

i have c++ function, looking like: inline unsigned short function_name(float x, float y, somestruct *cfg) { int x_pos = (int)(x*2 + 0.5f); int y_pos = (int)(y*2 + 0.5f); int dict_index = x_pos + (y_pos * cfg->subdivisions_adj); [...] while somestruct declared as: struct somestruct { int subdivisions; int subdivisions_adj; [...] } the generated assembly third line ( int dict_index = [...] ) is: cvttss2si edi,xmm3 imul edi,[ecx+04h] movss xmm3,[ecx+0ch] movaps xmm4,xmm3 mulss xmm4,xmm0 addss xmm4,xmm1 cvttss2si eax,xmm4 add edi,eax (see result amdcodeanalyst ) can explain assembly does? don't know why cvttss2si , movaps used @ all, aren't floating point numbers? i using visual studio 2008 on windows 7, sse2 instruction set enabled. what seeing compiler merges first 3 lines 1 intermingled sequence of instructions. cvttss2si edi,xmm3 convert xmm3 float 32-bit int . presumably xmm3 contains float value of y_pos , , resu...

linux - In bash, what does dot command ampersand do? -

i'm trying understand bash script i'm supposed maintaining , got stuck. command of form: . $app_location/somescript.sh param1 param2 & the line not being called in loop, not return code bening sent calling script somescript.sh i know "." make process run in same shell. "&" spawn off different process. that sounds contradictory. what's happening here? ideas? the script running in background process, subshell, not separately-invoked interpreter without dot. that -- current interpreter forks , begins running command (sourcing script). such, inherits shell variables, not environment variables. otherwise new script's interpreter invoked via execv() call, replace current interpreter new one. that's right thing, because provides more flexibility -- can't run script written same shell . or source , after all, whereas starting new interpreter means other script rewritten in python, perl, compiled binary, etc without ...

what is __ksymtab? in linux kernel -

when cat 'proc/kallsyms' or 'system.map' symbols this .... c033718c t nf_hook_slow c04ca284 r __ksymtab_nf_hook_slow c04ca28c r __ksymtab_nf_hooks c04d24a0 r __kcrctab_nf_hook_slow c04d24a4 r __kcrctab_nf_hooks c04e9122 r __kstrtab_nf_hook_slow c04e9179 r __kstrtab_nf_hooks c054d854 d nf_hooks c0571ca0 d nf_hook_mutex .... what meaning of t, r, d, d stuffs? i can find symbols in kernel source export_symbol(...) there others prefixing __ksymtab... or __kstrtab... these? is possible there symbols in system.map excluded in /proc/kallsyms? (assuming kernel compiled properly) i have netfilter enabled linux kernel cant find symbol 'nf_hooks' there '__ksymtab_nf_hook'. there way address of nf_hooks using __ksymtab_nf_hook? i see in linux source code export_symbol(nf_hook) cant find if 'cat /proc/kallsyms'. there typical reason this? thank in advance. the format similar of output of nm utility , see this page . to put simple...

html - Styles not working -

i have following code. <html> <head> <style> .fb{ position: relative; right:-1000px; } .info{ position:relative; } </style> </head> <body> <div id="info"> <a href="../jsp/aboutus.jsp" class="anatips" title="about us">about us</a> | <a href="../jsp/privacy.jsp" class="anatips" title="privacy policy">privacy policy</a> <a id = "fb" href="https://www.facebook.com/xyz" target="https://www.facebook.com/xyz"> <img src="../images/facebook.png" height = 16, width = 16 /> </a> </div> </body> </html> i want move fb link right corner. guess styling not working. or going wrong somewhere? you have defined class in stylesheet .fb{ position: relative; right:...

c# - Accessing another ribbon element in IRibbonExtensibility class -

i have project in i'm using office.iribbonextensibility inheritance. issue i'm having project requires me 'uncheck' checkbox when button pressed on ribbon. far can tell, selected control accessible in code through office.iribboncontrol property of button press handler. question is, how access checkbox element in button click event in xml based vsto project? try code ribbon.xml <?xml version="1.0" encoding="utf-8"?> <customui onload="ribbon_load" xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon> <tabs> <tab idmso="tabaddins"> <group id="group1" label="group1"> <button id ="btntest" size="large" label="testbutton" onaction="btntest_click"/> <checkbox id ="chktest" label="testcheckbox" getpress...

How to collect records in crystal report using record selection formula to concatenate records -

what want collect records using record selection formula on basis of criteria selection. if have 2 criteria's have 4 combinations using criteria selection. e.g. if(cri1 <> 'all' , cri2 <> 'all') record fetched else if(cri1 = 'all' , cri2 <> 'all') record fetched else if(cri <> 'all' , cri = 'all') record fetched else if(cri = 'all' ; cri = 'all') record fetched (cri1 , cri2 parameter fields used in crystal report) in same way 3 criteria's, have 8 combinations. is, n criteria's having '2' power of 'n' combinations means 10 criteria's having 2 power of 10 combinations (i.e. 1024) combinations. well want know whether there way collect data in simpler way n number of criteria's. because more 3 criteria's confusing collect records. ** please on this..**

css - How to get div height 100% inside td of 100% -

this question seems have been asked @ least 10 other times here on stackoverflow not 1 of them has answer. 1 different in issue appears in firefox. i have table height 100%, tr height 100%. set border of td can see. see td 100% expected. put div in td , set height 100%. it's 100% in chrome. it's not 100% in firefox. how fix this? example <!doctype html> <html> <head> <style> body, html { width: 100%; height: 100%; padding: 0px; margin: 0px; } .full { width: 100%; height: 100%; border: 10px solid red; } #content { width: 100%; height: 100%; } #content>table { width: 100%; height: 100%; } #content>table>tbody>tr>td { border: 10px solid blue; width: 50%; } #container { width: 100%; height: 100%; border: 10px solid black; } </style> </head> <body> <div id="content"> <table> <tr> <td> <div...

javascript - jquery use next and each to change the url of the elements -

i have 4 links points 4 pages <a href="asdf">asdf</a> <a href="asdfer">1244</a> <a href="iuiuy">qwer</a> <a href="asdfasdf">asdfqew</a> i want add number current url href of next elements based on current page url argument (ie) if @ page "asdf" other 3 links needs add sum number <a href="asdf">asdf</a> <a href="asdfer/123">1244</a> <a href="iuiuy/123">qwer</a> <a href="asdfasdf/123">asdfqew</a> here code used var pathname = window.location.pathname; var split = pathname.split("/")[4]; console.log(jquery("#pagetabs li a").each().next().attr('href')); if(split.match(/^\d+$/)){ jquery("#pagetabs li a").each(function(){ href = jquery(this).attr('href'); newhref = href+'/'+ split; jquery(this).next().attr(...

c++ - how does opencv work? -

i'm if there component diagrams or documentation opencv library works each others, how depend 1 ? example highgui.dll need core.dll doesn't imagproc.dll looked in google, didn't ! any idea ? afaik core module dependency of other modules. , seems intuitive , natural core functionality , definitions of basic structures such mat used other modules (which independent on each other). this concept described in first chapter of official opencv's online documentation , should first place should answers in terms of opencv :) and in case need know dependencies of binaries of application, need build application , drag-n-drop binaries the dependency walker (depends.exe) , show .dll files app needs.

java - JSF Richfaces Render condition for one part of Label -

i using 3 different strings backing bean build label rich:simpletogglepanel. <rich:simpletogglepanel id="loadpanel" switchtype="client" label="#{backingbean.name1} - #{backingbean.name2} - #{backingbean.name3}" > i want name3 appear in specific conditions. possible give condition name3? you can using el conditional operator: label="#{backingbean.name1} - #{backingbean.name2} - #{conditions ? backingbean.name3 : ''}" so when conditions evaluate true backingbean.name3 printed otherwise empty string added label, backingbean.name3 omitted when conditions evaluate false .

c - What is the difference between assembler generated for functions with and without returns_twice and noreturn? -

i understand noreturn should used functions expected doesn't return control caller, can't find difference in generated assembler codes. know examples generate different codes? edit: noreturn not generate cleanup code after it. returns_twice disables gcc optimizations. as example, in old gcc version have laying around: tail call optimization, global common subexpression elimination, jump bypassing. returns_twice uses calls_setjmp machinery (all around source tree): if (flags & ecf_returns_twice) cfun->calls_setjmp = true; tco ( gcc/tree-tailcall.c ): static bool suitable_for_tail_call_opt_p (void) { [...] /* function calls setjmp might have longjmp called called function. ??? should represent in cfg needn't special cased. */ if (cfun->calls_setjmp) return false; gcse ( gcc/gcse.c ): static int gcse_main (rtx f attribute_unused) { [...] /* not construct accurate cfg in functions call ...

sql - Selecting top n Oracle records with ROWNUM still valid in subquery? -

i have following firebird query: update hrs h set h.plan_week_id= (select first 1 c.plan_week_id calendar c c.calendar_id=h.calendar_id) coalesce(h.calendar_id,0) <> 0 (intention: records in hrs (non-zero) calendar_id take calendar.plan_week_id , put in hrs.plan_week_id ) the trick select first record in oracle use where rownum=1 , and if understand correctly i not have use rownum in separate outer query because 'only' match rownum=1 - suggesting questions may have answer ;-) this make it update hrs h set h.plan_week_id= (select c.plan_week_id calendar c (c.calendar_id=h.calendar_id) , (rownum=1)) coalesce(h.calendar_id,0) <> 0 i'm using 'first record' selection of one field guarantee one value can put h.plan_week_id . question: will above query work under oracle intended? right now, not have filled oracle db @ hand run query on. like nicholas krasnov said, can test in sql fiddle . but if ever...

include - Create MAPI profile using c++ -

i trying create outlook profile , found this and trying the: "use mapi iprofadmin interface" dont know "include" need us. if know better way create outlook profile without user interaction :) according msdn documentation interface, need include <mapix.h> .

jsf - How to close a p:messages through a button? -

for primefaces messages, here example: http://www.primefaces.org/showcase/ui/messages.jsf . in example, if click "info", message pop out. close message, i'll have click on toggle on right. want achieve when click "info" second time, messages disappear. , if click again after that, appear again. means button works switch control message. any thoughts appreciated! you can have here, @ toogle function: http://api.jquery.com/toggle/

Push multiple Git repositories to one repository -

i'm not sure if possible. however, let me ask. can push multiple repos single repo? essentially, want single repo contain files smaller repos. i have repos created various modules of project. , single repo project itself. as twalberg noted above, can push multiple repositories single destination, create distinct history graphs. can merge them though , in keep sync git's using call in git subtree merge, described in http://git-scm.com/book/ch6-7.html . take look.

android - Retrieve blob from sqlite -

i retrieve blob database base on row position i'm retrieving data sqlite database using cursor public cursor gettestdata(int index,string house) { try { string sql ="select * heroes position ="+ index +" , house='"+house+"'"; cursor mcur = mdb.rawquery(sql, null); if (mcur!=null) { mcur.movetofirst(); } return mcur; } catch (sqlexception msqlexception) { log.e(tag, "gettestdata >>"+ msqlexception.tostring()); throw msqlexception; } } this returns me columns , can strings cursor testdata = mdbhelper.gettestdata(pos,house); string sname = utility.getcolumnvalue(testdata, "name"); string sadvance = utility.getcolumnvalue(testdata, "class"); this return column "name" , "class" value, how retrieve blob , show it. byte[] img = utility...

mysql - How to do a second query using the results of a previous query -

ok need count how many sales has made each of sell agents of company, this... select agentid, agentname, count(*) total_sales sales group agentid this works perfectly, how ever not show agents had 0 sells. so need perform a select agentid agents and query of each result, can count how many sales had agent. hope explain it. (i can loop in php, how ever im wondering if possible directly in mysql) regards you can want 1 query: select a.agentid, a.agentname, count(s.agentid) total_sales agents left outer join sales s on a.agentid = s.agentid group a.agentid, a.agentname; the left outer join keeps in first table ( agents ). count() counting number of matches in sales table.

primefaces - Error in WebSphere 8.5 + Mojarra + MyFaces2 + Spring webflow -

i trying deploy web application in websphere 8.5. app has following characteristics. mojarra 2.1.13 primefaces 3.4.2 spring webflow 2.3.1 spring 3.1.2 jdk 1.6 this app works tomcat 7 when try deploy websphere got nullpointerexception following stacktrace. javax.faces.component.uicomponentbase.restoredeltasystemeventlistenerclassmap(uicomponentbase.java:1933) javax.faces.component.uicomponentbase.restorestate(uicomponentbase.java:1765) javax.faces.component.uiviewroot.restorestate(uiviewroot.java:1214) javax.faces.component.uicomponentbase.processrestorestate(uicomponentbase.java:1401) javax.faces.component.uiviewroot.processrestorestate(uiviewroot.java:731) org.springframework.faces.webflow.flowviewstatemanager.restorecomponentstate(flowviewstatemanager.java:78) org.springframework.faces.webflow.flowviewstatemanager.restoreview(flowviewstatemanager.java:203) org.apache.myfaces.shared_impl.view.viewdeclarationlanguagebase.restoreview(viewdeclarationlanguagebase.java:106...

java - Condition give the effect of having multiple wait-sets per object? -

i reading condition in java.util.concurrent.locks.condition . condition factors out object monitor methods (wait, notify , notifyall) >into distinct objects give effect of having multiple wait-sets per object, combining them use of arbitrary lock implementations. can explain me this? how benefit on normal synchronization blocks or method? one lock can associated many conditions. lock "object", each condition "waiting set". allows independent conditions sharing critical section. example, consider bounded producers-consumers problem. 1 way solve have 1 lock protects queue, , 2 independent waiting sets: 1 producers, waiting slot place item in queue, other consumers waiting items take. using plain old synchronized , wait/notify api, best can along these lines: producer: synchronized (lock) { while (queue.isfull()) { lock.wait(); } queue.put(sth); lock.notify(); } consumer: synchronized (lock) { while (...

python - Writing for both PySide and web2py -

background: have desktop app i've written in python27x uses wxpython ui , requests xml.etree.elementtree retrieve open data restful service , present data in meaningful ways user. i re-writing app using pyside . can present data-candy in html5 , provide web-app using web2py , javascript . the pyside , web2py versions both need support: aquiring lock on throttle object i've made handle fair-usage policy of service. presenting analyzed data in tables links or buttons retrieving or donwloading more related data. presenting lists of related data , highlighting groups of items on mouse-over of member of group. presenting text documents , providing automatic searching / highlighting of keywords / part-of-speech tagging using nltk . providing basic graphs , charts of various stats on data. question: given i've told app, , assuming web2py , html5 can meet user-interface / presentation needs, steps can take / widgets should use in making pyside deskto...

html - Serving pages and HTTP STATUS codes -

as know, when server gives http 404 status code, can deliver custom page. else status codes can serve custom pages except 200-206 codes? you may take @ rfc 2616 . http status codes , definitions listed beginning on page 56.

linux - why is this variable not being changed? -

this question has answer here: assign value variable in loop 1 answer i have larger script smaller 1 shows problem: #!/bin/bash x=0 if [[ $x == 0 ]] ls | while read l x=5 echo "this file $l , set 5 --> $x" done fi echo "this should not 0 --> $x" if variable set outside while loop works expect. bash version 3.2.25(1)-release (x86_64-redhat-linux-gnu). i'll feel dumb if obvious thing. the x being set 5 in sub-shell (because part of pipeline), , happens in sub-shell not affect parent shell. you can avoid sub-shell , result expected using process substitution in bash : #!/bin/bash x=0 if [[ $x == 0 ]] while read l x=5 echo "this file $l , set 5 --> $x" done < <(ls) fi echo "this should not 0 --> $x" now while loop part of main shell process (only ls ...

html - How to disable print option for PDF in iframe -

i'm showing pdf in <iframe> follows: <iframe src="/itextpdfservlet" height="600px" width="700px"></iframe> i disable print option this. how can achieve this? my servlet protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { string fullpath = (string) request.getsession().getattribute("fullpath"); response.setcontenttype("application/pdf"); servletoutputstream out = null; try{ file file = new file( fullpath ); fileinputstream filein = new fileinputstream( file ); out = response.getoutputstream(); document document = new document(pagesize.a4); pdfwriter writer = pdfwriter.getinstance(document, out); document.open(); pdfcontentbyte cb = writer.getdirectcontent(); pdfreader reader = new pdfreader(filein); ...

Using a Flex AIR application with the Flash browser plugin -

i have flex air application. during compilation process, .swf file generated. swf usable flash browser plugin? if not, how 1 go porting application browser? there pitfalls aware of? the common/standard approach create multiple projects in ide. note air classes cannot used in web applications. you'll need segregate air specific code anyway. you'll put majority of common code shared libraries (swc's). might have several library swc's (some might contain air code, , vice versa). create 2 application projects: air application , web application. the 2 application projects use shared library swc's , not have code in them. these "application shells" utilize common code swc.

mysql - phpMyAdmin 4.0.5 export error bug - anyone know if it is being addressed? -

phpmyadmin has announced in few days on sept 1st 2013 they're closing down other resources such mailing list , forums , deferring use stackoverflow / stackexchange. i provide general support @ small cpanel hosting service , part of duties include doing frequent db exports in phpmyadmin , showing hosting customers how export databases phpmyadmin within cpanel backup tool. been working fine many years , across many servers / cpanel versions / php versions / mysql versions. but after upgraded phpmyadmin 4.0.5 final (we use whm's easyapache keep php , other server modules updated regularly) we're encountering apparent bug , cannot export databases. any attempt export db on size (haven't determined yet, seems around 20mb) instead of getting usual download prompt, fails . if export attempted in firefox error looks this: firefox can't find file @ https://example.example.net:2083/cpsess1210889896/3rdparty/phpmyadmin/export.php if export attempted in int...

java - How do I dynamically create multiple swing objects and remove them one at a time? -

i'd create new jpanel each click of button , have objects on panel created (buttons and/or labels). part seems technically working, run problems when trying remove panels (from last added first) 1 @ time. i've tried trim down code as possible, though left in unused array because think that's how i'm suppose make work. advice appreciated. let me know if vague, trying verbalize question harder thought. disclaimer: @ least few best practices have been ignored, sorry. public class createpanelstest{ jpanel totalgui; gridlayout grid = new gridlayout(0,1); int panelx = 10; public jpanel createcontentpane (){ //create bottom jpanel place on. totalgui = new jpanel(); //set layout manager null, manually place objects totalgui.setlayout(null); jpanel controlpanel = new jpanel(); controlpanel.setlocation(50, 220); controlpanel.setsize(200, 40); jbutton addset = new jbutton("add s...

c# - Best Way to Pass Data to new ViewModel when it is initiated -

i working on wpf database application using mvvm-light framework. using simpleioc inject data services, , viewmodels connected view xaml file. however, when opening new view models need pass object view model (lets passing integer of carid can grab actual car database). right passing using messenger on view, after initializecomponent(). caught view model. work, has set backs. first, message not sent until after constructor of view model called. lets had thiscar object property in viewmodel, , had secondary properties string called brand, returns thiscar.brand. public const string thispersonpropertyname = "thiscar"; private model.car _thiscar; public model.car thiscar { { return _thiscar; } set { if (_thiscar== value) { return; } raisepropertychanging(thiscarpropertyname); _thiscar= value; raisepropertycha...

java - subset based on index from google guava TreeBasedTable -

i have treebasedtable<string,string,customtype> structure need able subsets based on start , end range indices, fromindex toindex . cellset method doesn't return sortedset . best approach this? i thought of doing lists.newarraylist(structure.cellset()).sublist(start,end) , doesn't efficient thing do. if startindex , endindex integer positions, arraylist implementation isn't far off best that's feasible, though it'd more efficient write fluentiterable.from(table.cellset()).skip(fromindex).limit(toindex).tolist() that implementation won't copy more of elements has result list. generally speaking, there's not efficient way arbitrary sortedset , sortedmap , or pretty of sorted data structures come java.

osx - How to deploy a Qt application on Mac OS X using install_name_tool? -

i having problems packaging qt app mac os x. i've read documentation on deploying application on mac os x i'm still not sure i'm doing wrong. on mac, have qt5 installed on ~/qt5.1.0/5.1.0/clang_64 (this bin/ , lib/ folder resides) i have qt application called "renamer" on ~/documents/qtprojects/renamer/. using qt creator, have built release version of application on ~/documents/qtprojects/build-renamer-desktop_qt_5_1_0_clang_64bit-release. first thing did run otool on application: $ cd ~/documents/qtprojects/build-renamer-desktop_qt_5_1_0_clang_64bit-release $ otool -l renamer.app/contents/macos/renamer here result: renamer.app/contents/macos/renamer: /users/paul/qt5.1.0//5.1.0/clang_64/lib/qtwidgets.framework/versions/5/qtwidgets (compatibility version 5.1.0, current version 5.1.0) /users/paul/qt5.1.0//5.1.0/clang_64/lib/qtgui.framework/versions/5/qtgui (compatibility version 5.1.0, current version 5.1.0) /users/paul/qt5.1.0//5.1.0...

c# - EntityFramework trying to insert unchanged attached entity -

i have model this: public class parent { public childa childa { get; set;} public childb childb { get; set;} } in cache store collection of such objects statistics. when i'm trying save collection, error childa cannot added violation primary key constaint. icollection<metric> statistics = this.cacheservice.get<icollection<metric>>(statisticscachekey); if (statistics.any()) { foreach (parent parent in statistics) { this.dataservice.attach<childa>(parent.childa); this.dataservice.attach<childb>(parent.childb); this.parentrepository.create(parent); } await this.dataservice.savechangesasync(); statistics.clear(); this.cacheservice.put<icollection<parent>>(statisticscachekey, statistics); } childa exists in database , attac...

running an AngularJS app in general -

i taking baby steps angularjs. bit confused requiring webserver run angularjs sample or demo. reason study purpose have downloaded running examples , demos, not having luck it. simple demo of displaying name not working me. have specific simple app running. feel weird asking doubt requing webserver angularjs client side framework. nevertheless, hoping can throw light on this. in adavnce. if use firefox, don't need server have basic app running. if use chrome, security reasons doesn't file-access librairies. librairies must serve in way. can have hello-world angularjs working opening classic index.html firefox, don't have start web server. here sample application explanations in readme : https://github.com/davidb583/white-angularjs-app

angularjs - Wrapping JSTree in an Angular directive -

i have 2 fiddles have same jstree loading in. 1 wrapped in angular directive, other not. new angular. not seeing of images in angular version. animations not work. missing jstree plugin, or need add bind function add in functionality? here fiddle: (not in angular js) here simple js tree code : $('#tree').jstree({ 'plugins' : ['themes', 'json_data', 'checkbox', 'types'], 'icon':false, 'checkbox' : { 'two_state' : true // nessesary disable default checking childrens }, "json_data" : { "data" : [ { "data" : "basics", "state" : "open", "children" : [{ "data" : "login", "state" : "closed", "children" : [ "login", {"data" : "results", "state" : "open...

xml - Python - Process Disappearing and Freezing when working with large Dict? -

i'm in process of dealing xml files 85mb in size. i'm trying process one. i'm doing download zip, extract disk, convert xml python dict, change couple things, save dict, , send mongodb. except when converting python dict, process freezes/disappears.. i'm running script on vm ubuntu 13.04 server, 4 cores @ 2.6, 16gb of ram, , 1tb 15,000rpm. i'm monitoring script runs, python takes 12% of ram on 7 minutes, , gone, process falls off high usage list , pipe terminal doesn't move. kill ctrl+z , returned "write failed: broken pipe" . the last thing printed on terminal "converting dailyprice_0505_eur.xml.zip" , makes me suspect maybe xmltodict, i'm stuck. example code, data, should work willing me test out. appreciated! thanks. #importing import urllib, xmltodict, os zipfile import zipfile #getting working dir abspath = os.path.abspath(__file__) root = os.path.dirname(abspath) + "/" print "current working directory: ...