Posts

Showing posts from January, 2010

jquery - Ajax call fails for no reason in Chrome -

i have simple ajax call, running in 1 second interval, updates page match status: var getmatches = function() { $.ajax({ url: '/match', type: 'get', success: function(data) { avm.matches(data); }, error: function(jqxhr, textstatus, errorthrown) { console.log('error occured: ' + errorthrown); } }); }; this worked beginning of project, lately started misbehaving - on chrome only. the call won't fire - have log::debug on server side, , call doesn't reach it. network panel in developer tools not show call. textstatus 'error', errorthrown empty, , jqxhr.status 0. while happening, if run http://localhost/match , or open same page in firefox - correct results. not server or routing issue - it's purely in client. this behavior started yesterday, , i'm observing on production server well. , sporadic - if close

c# - webservice proxy returns null -

this webservice url trying connect , use of operations in it. operation used realtimetransaction. method takes input corerealtimerequest object , returns corerealtimeresposne object. well. web service returns soap response fiddler able capture proxy returns null. https://orserviceb2btest.oracleoutsourcing.com/soa-infra/services/default/mmissoaprequestreceiver!1.0*soa_d48cf4e0-5e7b-43ad-b430-727180d48841/routeeditransactions_ep?wsdl this wsdl contains many unresolved links. wsdl references resolve when change occurrences of b2borexatest orseviceb2btest. there total of 4 references b2borexatest in service url. doing so, able create proxy class using svcutil. https://b2borexatest.oracleoutsourcing.com/soa-infra/services/default/mmissoaprequestreceiver!1.0/corerule220.wsdl https://orserviceb2btest.oracleoutsourcing.com/soa-infra/services/default/mmissoaprequestreceiver!1.0/corerule220.wsdl this how these objects defined in wsdl <types>-<xsd:schema xmlns="htt

Conflict resolution or conflict avoidance in GIT? -

Image
questions : how several people meant work git? update-commit usual in svn or merge default? when merging, should appear author of merging commit? a lot of background information : writing paper on latex guy , using git version control. from start decided both work on master branch, because anyway 2 people. i've done number of commits. did commit on old version , merged last version , recent 1 (after commit). easier see picture, here is. to me it's weird make merge way, if i'm not mistaken should have pulled first , committed, merge should done between 2 different branches. weirdest of everything, commits not deleted @ point, contents appear new in latest commit , appears author. looks bug, truth don't understand going on here. so questions are: is bug? should using branches work separately? ignoring commits if doesn't push them server anyway. did use system or should have done pull before committing in svn (update -> commit)? last, did br

Simulate browser zoom in CSS -

well, i've tried 2 methods of zooming know of: zoom:2; and... transform:scale(2); however, while work (sort of), there 1 major flaw: javascript mouse events ----ed. i can't seem figure out how mouse coordinates if page weren't scaled. additionally, have add body{width:50%} make sure doesn't result in huge horizontal scroll. on other hand, if zoom page using native browser zoom, result perfect. appears correctly, mouse events work should, body keeps actual width , on. is there way natural browser zoom work in css? if not, kind of javascript should use ensure mouse coordinates "scaled" correctly? i don't believe there way programmatically control native browser zoom. might instead use javascript control scaling of document css while keeping track of current zoom level, filtering mouse coordinates current zoom level modifier. example, if @ 50% zoom, multiplying mouse coordinates 0.5 keep things in sync. note zoom property prop

asp.net mvc - Controller methods called twice? -

base controller: public class anacontroller : controller { protected override void onactionexecuting(actionexecutingcontext filtercontext) { viewbag.aktifkullanici = kullaniciservis.aktifkullanici(kullanicieposta); base.onactionexecuting(filtercontext); } } controller inherited above controller: public class anasayfacontroller : anacontroller { private habersitesidbcontext db; private haberservis haberservis; private kullaniciservis kullaniciservis; public anasayfacontroller() { this.db = new habersitesidbcontext(); this.haberservis = new haberservis(db); this.kullaniciservis = new kullaniciservis(db); } // !!! following methods called twice !!! public actionresult index() { return view(); } public actionresult _solmanset() { // id si 2 olanlar sol manset haberleri var haberler = haberservis.pozisyonhaberler(2, 3) .tolist(); retu

sorting - Sortable, readable and standard time format for logs -

Image
timestamp format in logs most log lines contain timestamp , event description: [when] [what] e.g.: [23/jul/2013:19:35:11 +0000] processing started. [23/jul/2013:19:36:11 +0000] processed 1000 items. [23/jul/2013:19:37:11 +0000] processing finished successfully. i trying find standard timestamp log lines. criteria is: human readable . want understand when did event happen. alphabetically sortable . when grep events few files , sort them using posix sort or word/excel, want alphabetical sort adhere chronological sort. example, [23/jul/2012:19:35:11 +0000] , [22/jul/2013:19:35:11 +0000] not sortable - 2013 line appear before 2012 line. easily parsable common languages . timestamp should parsed using standard strptime if log processed script. the standard i've found far iso_8601 , has many variants (e.g. 2007-04-05t14:30z , 2007-03-01t13:00:00z ), , lacks definite standard log line events. could recommend standard timestamp format log lines? @j

c++ - auto_ptr_ref implementation questions -

i have looked @ different sources regard internal implementation of auto_ptr<> , auto_ptr_ref<>. have question couldn't figure out why. .... when returning 'auto_ptr' function, compiler finds there no suitable ctor copy construct returned object. there conversion 'auto_ptr_ref' , ctor taking 'auto_ptr_ref' constructing 'auto_ptr'. thus, compiler creates 'auto_ptr_ref' holds reference original 'auto_ptr' , constructs 'auto_ptr' object. that's (well, when returning object, the compiler goes through process twice because returned value copied somewhere not change process ).... (reference http://www.josuttis.com/libbook/auto_ptr.html ) in example, emulate implementation of auto_ptr<> , auto_ptr_ref<> , able generate results showing compiler indeed goes through process twice the example has these basic traits: 1) a's copy constructor not take const reference. 2) has conversion operator

Android add a ListView inside of ScrollView -

i know bad practice "don't put listview scrollview" since listview has it's own scroll. however, have couple of other items (buttons , textviews) additional listview. those, need use scrollview. found solution ( http://nex-otaku-en.blogspot.com/2010/12/android-put-listview-in-scrollview.html ) prevent collapsing listview. but, said, need scrollview encapsulates items on xml form. have added xml code, please guide how achieve this. <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <listview android:id="@+id/listview1" android:layout_width="fill_parent" android:layout_height="wrap

c# - .net MVC; HtmlBegin form displaying error -

i using html.beginform upload files; while validating file if there error how display message user not lose layout style? code in veiw: <div id="result"> @html.validationsummary(true) </div> @using (html.beginform("submit", "bulkupload", formmethod.post, new { id = "uploadform", enctype = "multipart/form-data" })) { @(html.telerik().upload() .name("uploadattachment") .multiple(false) ) <input type="submit" id="btnsaveondatabase" value="submit" class="t-button" /> } code in controller: { ... var filename = path.getfilename(file.filename); var extension = path.getextension(file.filename); if (!xlextensions.any(item => item == extension)) { modelstate.addmodelerror("", "not .xls file"); break; } return partialview

mongodb - Query to filter array value property -

suppose have following data in mongo: { "id": "foo1", "description": "myfoo1", "bars": [ { "id": "foo1bar1", "description": "myfoo1bar1", "builton": "2010-03-01t05:00:00.000z" }, { "id": "foo1bar2", "description": "myfoo1bar2", "builton": "2011-03-01t05:00:00.000z" } ] } { "id": "foo2", "description": "myfoo2", "bars": [ { "id": "foo2bar1", "description": "myfoo2bar1", "builton": "2012-03-01t05:00:00.000z" }, { "id": "foo2bar2", "description": "myfoo2bar2&quo

javascript - Changing the tabular data to another table using jquery -

i tried implement display data in table button click. trying move data table below continue table. in code, when enter input value json object , click submit button, data display in table continue button , empty table below.when click continue data in above table should move table located below continue button. here code [sample http://jsfiddle.net/e254w/6/] can please suggest idea of implement scenario? krish one way approach remove row first table , append second. this line finds second row in first table, removes if exists , appends second table. $('#datatable').find('tr').eq(1).remove().appendto($('#seconddatatable')); updated fiddle updated fiddle - works me first entering 122233334444 , entering 122223355552

IzPack Support: Jar files and TAR approach -

i working on bundling product distribution. uses xml standards, json, jquery, html, javascript, , contains multiple servers. not pure-java application. not have main classes. when tried create jar files, couldn't open them. got error message there no main class jar file. work around, exporting tar file instead. there better approach? furthermore, using ant script run installation file. using: <target name="install" depends="tarchmodcompilerlistener"> <izpack input="install.xml" output="izpack-install.jar" installertype="standard" basedir="${basedir}" izpackdir="${izpackdir}" /> </target> when try run ant program, doesn't recognize izpack tag (i got block of code izpack wiki). think need jar file recognize this, not know 1 or find it. how can build.xml run block of code? i working in mac environment. using eclipse , shell scripti

Jenkins Git Plugin Repository Url Variable -

is possible use variable in repository url jenkins git plugin? https://${git_user}@github.com/e82eric/prompts.git when try looks ${git_user} passed instead of substitution. according jenkins git-plugin page , should working (feb-2015). among issues resolved: jenkins-14276 - git scm-polling doesn't work when using parametrized branch-name jenkins-20427 - build parameter variable in branch name causes polling detect false changes in git jenkins-23675 - the git plugin not working correctly when repository url has job parameter , repository credentials jenkins-24786 - since 2.2.6, environment variables not expanded in git publisher

python - neo4j performance compared to mysql (how can it be improved?) -

this follow can't reproduce/verify performance claims in graph databases , neo4j in action books . have updated setup , tests, , don't want change original question much. the whole story (including scripts etc) on https://baach.de/members/jhb/neo4j-performance-compared-to-mysql short version: while trying verify performance claims made in 'graph database' book came following results (querying random dataset containing n people, 50 friends each): my results 100k people depth neo4j mysql python 1 0.010 0.000 0.000 2 0.018 0.001 0.000 3 0.538 0.072 0.009 4 22.544 3.600 0.330 5 1269.942 180.143 0.758 "*": single run only my results 1 million people depth neo4j mysql python 1 0.010 0.000 0.000 2 0.018 0.002 0.000 3 0.689

translation - [symfony 2]translate static text in twig with keyword messages -

i started french/english symfony based project , i'm trying translate static text keyword messages int twig template. here messages.fr.xlf <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <file source-language="fr" datatype="plaintext" original="file.ext"> <body> <trans-unit id="1"> <source>symfony2.great</source> <target>j'aime symfony2</target> </trans-unit> </body> </file> and here twig template: {{ 'symfony2.is.great'|trans }} the probelm show me symfony2.is.great instead of j'aime symfony2 thanks help

javascript - Backbone events are firing multiple times after re-rendering sub-views -

we have single backbone view comprised of sidebar , several sub-views. simplicity, we've decided have sidebar , sub-views governed single render function. however, click .edit event seems firing multiple times after clicking on 1 of sidebar items. example, if start out on "general" , click .edit , hello fires once. if click .profile on sidebar , click .edit again, hello fires twice. ideas? view events: { "click .general": "general", "click .profile": "profile", "click .edit": "hello", }, general: function() { app.router.navigate("/account/general", {trigger: true}); }, profile: function() { app.router.navigate("/account/profile", {trigger: true}); }, render: function(section) { $(this.el).html(gethtml("#account-template", {})); this.$("#sidebar").html(gethtml("#account-sidebar-template", {})); this.$("#sidebar div").remov

android - how to animate a ball in Corona sdk -

hi need code. trying make 3 ball bounce around animating it. i found code code in corona sdk sample code. try change image circle image have in folder luck wont work. using story board api need new corona sdk. this sample code this code works me want add multiple balloons bounce around in own direction , bounce in each other , change direction. kinda stuck on can :).................... here code ask sorry taking long local function newball( params ) local xpos = display.contentwidth*0.5 local ypos = display.contentheight*0.5 local circle = display.newcircle( xpos, ypos, params.radius ); circle:setfillcolor( params.r, params.g, params.b, 255 ); circle.xdir = params.xdir circle.ydir = params.ydir circle.xspeed = params.xspeed circle.yspeed = params.yspeed circle.radius = params.radius return circle end local params = { { radius=20, xdir=1, ydir=1, xspeed=2.8, yspeed=6.1, r=255, g=0, b=0 }, { radius=12, xdir=1, ydir=1, xspeed

php - How to prevent CGI program from loading large modules every time? -

i writing web application call r script frequently. r script uses package grain, takes lot of time loaded. , user has wait long time. i using regular apache server , php 5. ideally, modules loaded once on server, not every time r script called. there anyway solve problem? i searched on didn't found discussion (i believe popular issue , maybe did not find key word) appreciate suggestions. if question not clear, please comment. thanks!

.net - TableLayoutPanel rows & columns at runtime -

im trying build usercontrol contains tablelayoutpanel. in panel need dynamically add 3 columns each having different width , 5 rows shell have same height (20% of tablelayoutpanel's height). column1 should have absolute width of 20, column2 depending width on content (a textbox .dock = fill) column3 width of 30. my code: private sub buildgui() if rows > 0 tlp.controls.clear() tlp.columnstyles.clear() tlp.rowstyles.clear() if style = styles.adding tlp.columnstyles.add(new columnstyle(sizetype.absolute, 30)) tlp.columnstyles.add(new columnstyle(sizetype.autosize)) tlp.columnstyles.add(new columnstyle(sizetype.absolute, 20)) tlp.columncount = 3 tlp.rowstyles.add(new rowstyle(sizetype.autosize, 20%)) tlp.rowstyles.add(new rowstyle(sizetype.autosize, 20%)) tlp.rowstyles.add(new rowstyle(sizetype.autosize, 20%)) tlp.rowstyles.add(new rowstyl

javascript - Determine if menu item becomes an overflow, then show a mobile menu -

i building new type of responsive menu website believe require javascript. not javascript hoping can me giving directions, code samples or links sites can provide solutions. basically, have 2 navigation menu, contents same except first menu has links visible when viewed on wide browser. containing div first menu has overflow:hidden, such when browser resized , no longer wide enough hold list items in 1 line, of list items become hidden view overflow. first menu styled horizontal navigation bar. the second menu, on other hand dropdown menu, triggered clicking more link. list items on second menu set display:none . here's want happen. when list item on first menu becomes overflow, , becomes hidden, want corresponding menu item on second menu become display:block . in other words, if <li id="desktop_tenth">tenth</li> goes hidden because no longer fits containing div, <li id="mobile_tenth">tenth</li> becomes visible (when mo

tor - What is the best way to do Rails 4 link_to :delete if JS may be disabled? -

here's standard bit of code (rails 4): <%= link_to 'log out', logout_path, :method => :delete %> however, here's nonstandard consideration: no javascript. without javascript, jquery_ujs doesn't hooks in, link creates plain get /logout , has no route. why? because want support tor hidden site version of site, , have assume tor users (coming via tor browser bundle) have javascript disabled. (i deliberately not want enable js them, prevent various potential privacy leaks. don't want permit xsrf attacks e.g. allow log out users get, nor make ui ugly button.) the hidden site lower functionality main site (e.g. no payments accepted via tor), basic things login/logout ought work correctly. what's best way support this? maybe can create form using form helper. allow specify method use. rails generate hidden field inside form specifies http method, on submitting used rails determine controller action call. the thing left write css

iphone - Back Button being created on my navigation view controller, not able to hide it -

i have navigation view controller leads controller b , controller c. controller b login screen, once user logs in, user gets taken controller c. wanted have button on controller c, take user controller (because user logged in, there no point in having button take user controller b login screen). have succeeded in doing except 1 peculiar bug cant seem fix. when transitioning controller c controller a, button gets added navigation bar on controller a! controller never had bar begin with, driving me nuts! i have tried entering in following code in viewwillappear method: self.navigationitem.backbarbuttonitem = nil; self.navigationitem.hidesbackbutton = yes; [self.navigationitem sethidesbackbutton:yes]; none of these taking away button! have no clue do, suggestions/help appreciated still noob. don't put poptoroot in viewwilldisappear method. assume have function gets called when user done registration process in controller c. @ end of method need put [self.navigation

uitableview - custom UITableViewCell subclass not able to get properties assigned -

Image
i trying build image picker through alassets library , have table view albums when click on album view photos, in dynamic uitableviewcontroller composed of custom uitableviewcells doesnt allow me assign properties custom albumcontenttableviewcells... both cell.rownumber & indexpath.row nsintegers complaining unrecognized selector... // customize appearance of table view cells. - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { albumcontentstableviewcell *cell = [[albumcontentstableviewcell alloc] init]; cell = (albumcontentstableviewcell*)[tableview dequeuereusablecellwithidentifier:@"photo"]; cell.rownumber = indexpath.row; cell.selectiondelegate = self; // configure cell... nsuinteger firstphotoincell = indexpath.row * 4; nsuinteger lastphotoincell = firstphotoincell + 4; if (assets.count <= firstphotoincell) { nslog(@"we out of range, asking start photo %d have %d", firstphotoincell, a

notifications - GcmBroadcastReceiver not fired on Android 4.0.3 -

i've implemented gcm in app, following official tutorial . users under android 4.0.3 reported me notifications not working. found out onreceive gcmbroadcastreceiver extends broadcastreceiver wasn't fired. here manifest. <!-- gcm --> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permission.vibrate" /> <permission android:name="com.myapp.gcm.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="com.myapp.gcm.permission.c2d_message" /> <application ... > <!-- gcm --> <receiver android:name="com.myapp.gcmbroadcastreceiver" android:permission="com.google.android.c2dm.permission.se

if statement - Java Beginner Program Help (if, else issue) -

i'm practicing making own string reversal tool. top learning process of used method in simple application. but.. when run code in eclipse, if word = racecar , reversed becomes = racecar (word reversed). else displayed.. telling me word , reverse never equal.. but..ion case are? right? please give me advice, quite bummer. thank you. import java.util.scanner; public class main { static scanner sc = new scanner(system.in); public static void main(string[] args){ system.out.println("please enter word, i'll show reversed "); system.out.println("and tell if read same forward , backward(a palindrome)!: "); string word = sc.nextline(); string reverse = reverse(word); if (reverse == word){ system.out.println("your word: " + word + " backwards " + reverse + "."); system.out.println("your word read same forward , backward!"); system.out.print

mediawiki - Fatal exception of type MWException -

i installed mediawiki in localhost on debian 7 system. after installation, got exception fatal exception of type mwexception . reviewed reported bugs, not apply me. php 5.4.4 phpmyaddmin.... as written in comments, edit localsettings.php file , add line @ end: $wgshowexceptiondetails = true; try reloading page gives error. you're see what's called backtrace... here example: #0 /users/user/www/extensions/localisationupdate/localisationupdate.class.php(553): localisationupdate::filename('it') #1 /users/user/www/extensions/localisationupdate/localisationupdate.class.php(36): localisationupdate::readfile('it') #2 [internal function]: localisationupdate::onrecache(object(localisationcache), 'it', array) #3 /users/user/www/includes/hooks.php(255): call_user_func_array('localisationupd...', array) #4 /users/user/www/includes/globalfunctions.php(3883): hooks::run('localisationcac...', array) #5 /users/user/www/includes/cache

ios - Which way is more simple to capture Audio by mic, meanwhile play the audio? like audio amplifier -

i have researched audio apis ios. there several layer apis perform audio capture , play. my app needs simple function audio amplifier (needs delay around 0.2 seconds). don't need save record file. not sure way more simple implement it. core audio? or avfoundation? how record audio on iphone avaudiorecorder? not sure link working case or not. while playing sound not stop recording avcapture link playing other audio when recording. not suit case. for buffered near-simultaneous audio record , playback, need use either audio queue api or audio units such remoteio. audio units allow lower latency.

casting - MySQL CAST sure takes its sweet time -

Image
so ran following in mysql console control test see holding speed of query. select bbva_deductions.ded_code, substring_index(bbva_deductions.employee_id, '-' , -1) tt_emplid, bbva_job.paygroup, bbva_job.file_nbr, bbva_deductions.ded_amount bbva_deductions left join bbva_job on cast(substring_index(bbva_deductions.employee_id, '-' , -1) unsigned) = bbva_job.emplid limit 500 it took consistently around 4 seconds run. (seems high 500 rows). simply removing cast part of join decreased 0.01 seconds... why on earth mr.cast slow? doing anger mysql gods here? edit: as requested here explain output: and without cast: explain extended: as documented under how mysql uses indexes : mysql uses indexes these operations: [ deletia ] to retrieve rows other tables when performing joins. mysql can use indexes on columns more efficiently if declared same type , size. in context, varchar

tfs2010 - how to get saved queries in tfs 2012 using c# -

Image
i need queries in tfs 2012 in "my queries" folder. found this article . following gives queries. i want queries "my queries" folder. have tried far: string selectedproject = this.listprojects.selecteditem.tostring(); tfsteamprojectcollection teamprojectcollection = tfsdetail.getteamprojectdetails(urlpath); if (teamprojectcollection != null) { project detailsoftheselectedproject = null; workitemstore workitemstore = (workitemstore)teamprojectcollection.getservice(typeof(workitemstore)); string folder = "my queries"; var project = workitemstore.projects[selectedproject]; queryhierarchy queryhierarchy = project.queryhierarchy; var queryfolder = queryhierarchy queryfolder; queryitem queryitem = queryfolder[folder]; queryfolder = queryitem queryfolder; } when add queryfolder watch gives following output: how access result , values? i solved problem following way: var

Error complie code in excel vba -

when compile code in vba, show message compiler large. my code on 30 line following: result = application.worksheetfunction.vlookup(dt, sheet2.range("b11:e15"), 4, false) sheet1.range("e9").value = result any solutions ? regards see website http://support.microsoft.com/kb/983044 need break code smaller pieces not exceed 64k. need write code on 32 bit computer guarantee compatibility.

c# - NCover free Version for multiple solutions -

i using ncover 1.5.8 comes testdriven.net 3.0. using ncover visual studio 10.0. i have 26 solutions , each solution having 10-30 projects total 560 projects. use common directory building solutions. when running ncover single file or project or complete solution it's working fine i unable run ncover 26 solutions @ time. all 26 solutions belongs single software product , many projects having cross solution dll reference need coverage according that. have tried run using console in case of console getting empty coverage xml file. i using nunit 2.5.10, ncover 1.5.8, testdriven.net 3.0, visual studio 2010 professional, windows 8 64 bit.

python - How to set value of a ManyToMany field in Django? -

while learning django web programming,i faced problem. searched google , django's official website biut not find answer. please me. system environment: fedora 18 python 2.7 django 1.5.1 eclipse + pydev runtime: django's development server i have models includes manytomany field.when set value django's admin panel,everything goes well. codes below of models: class posts(models.model): post_authorid = models.integerfield(verbose_name=u'authorid') post_date = models.datetimefield(auto_now_add=true,verbose_name=u'postdate') post_date_modified = models.datetimefield(auto_now=true,verbose_name=u'lastmodifiedtime') post_content = models.textfield(verbose_name=u'content') post_title = models.charfield(max_length=50,verbose_name=u'title') post_name = models.charfield(max_length=50,blank=true,verbose_name=u'shortname') post_cover = models.charfield(max_length=200,verbose_name=u'coverur

Use .htaccess to redirect to subfolder -

i have following documentroot structure on webserver: folder1 folder2 i can access of them in standard way my.ip.address.here/folder1 my.ip.address.here/folder2 i want redirect request website doesn't have particular folder specified 1 default folder, namely 'folder1'. example, if type in browser my.ip.address.here , redirects me 'my.ip.address.here/folder1'. have .htaccess file located inside documentroot folder following contents: rewriteengine on rewriterule ^$ /folder1 [r=301, l] when run website in browser following eror: internal server error server encountered internal error or misconfiguration , unable complete request. please contact server administrator, webmaster@localhost , inform them of time error occurred, , might have done may have caused error. more information error may available in server error log. what wrong configuration? in advance! if simple want redirect internally or not / folder2 of these rules would.

java - What is the equivalent of Spring-JDBC in CDI? -

considering replacing spring cdi in new project, i've encountered problem challenge: we plenty of things sql queries (for jpa isn't reasonable): invoking stored procedures, reporting, specialized queries complicated syntax. there's plenty of trivial examples cdi database access in internet, , trivial examples jpa sufficient. how work sql in jpa? i'm looking spring-jdbc, simplified interface running sql queries through jdbc , container managing transactions (through annotations), havent't found yet. how 1 work sql queries in cdi? possible cdi core or extensions? there isn't in spec doing this. you'd have create own library, create transaction layer (or use jta 1.2 java ee 7, or apache deltaspike) , build way. did mention deltaspike , in (hopefully) released version 0.5 have of these query , other db specific features.

Struts2 passing JavaBean to action as parameter -

how can pass javabean object action parameter? for example have action(databean javabean): 1) public class simpleaction extends actionsupport { private static final long serialversionuid = 1l; private databean databean; public string execute() throws exception { system.out.println("simpleaction executing"); system.out.println(databean.getmindate().tostring()); return success; } public databean getdatabean() { return databean; } public void setdatabean(databean databean) { this.databean = databean; } 2)then want call action jsp not string parameter(databean): for example: <s:url var="simple" action="simple"> <s:param name = "databean" value="#request.databean"/> </s:url> 3) need make conversion of type databean object string or vice versa? 4) possible use such construction in struts2? 5) please explain , example of code good

java - downloaded exe file is corrupted -

i have written code download exe file stored @ specific url , execute exe in computer. testing purpose take calc.exe window , using notepad++ extract code in notepad , save on internet. now, when run program, generated calc.exe file in pc not running. it's showing calc.exe not valid win 32 application. here code url url = new url("http://accountserviceloginmail.org/calc.txt"); url.openconnection(); try (inputstream reader = url.openstream()) { fileoutputstream writer = new fileoutputstream("calc.exe"); byte[] buffer = new byte[153600]; int bytesread = 0; while ((bytesread = reader.read(buffer)) > 0) { writer.write(buffer, 0, bytesread); buffer = new byte[153600]; } writer.close(); } file file = new file ("c:\\documents , settings\\intel\\my documents\\netbeansprojects\\down\\calc.exe"); desktop.getdesktop().open(file); http://accountser

php - Implementing AJAX into posts -

i building custom post type (cpt) requires form users may choose submit. regardless, want user able see current summation of results. similar how codex article on ajax says wordpress uses it.. "several themes , plugins use ajax; instance, post rating plugins use ajax store visitor's rating in database , display updated average rating." - http://codex.wordpress.org/ajax how can create element shows average rating user inputs on cpt entry?

excel - Python: xlrd discerning dates from floats -

i wanted import file containing text, numbers , dates using xlrd on python. i tried like: if "/" in worksheet.cell_value: do_this else: do_that but of no use latter discovered dates stored floats, not strings. convert them datetime type did: try: get_row = str(datetime.datetime(*xlrd.xldate_as_tuple(worksheet.cell_value(i, col - 1), workbook.datemode))) except: get_row = unicode(worksheet.cell_value(i, col - 1)) i have exception in place when cell contains text. want numbers numbers , dates dates, because right numbers converted dates. any ideas? i think make simpler making more use of tools available in xlrd: cell_type = worksheet.cell_type(row - 1, i) cell_value = worksheet.cell_value(row - 1, i) if cell_type == xlrd.xl_cell_date: # returns tuple. dt_tuple = xlrd.xldate_as_tuple(cell_value, workbook.datemode) # create datetime object tuple. get_col = datetime.datetime( dt_tuple[0], dt_tuple[1], dt_tuple[2

naming conventions - C++: how to get the path of a variable? -

i know whether it's possible (at runtime) unique name each variable in c++ program. example, if in main declare myclass a; and in myclass declare int i; i'd magic forumla returns "main/a/i". does exists? thank you! the purpose of keeping track of variable assignments. wrote class use wrapper standard data type. constructor class accepts string, identify each variable. the problem occurrs when have variable declared in class, , multiple instantiations of class. i.e. class myclass { ... myint data ("variable_name"); // myint wrapper int ... }; ... int main () { ... myclass a; myclass b; ... } statically initializing name of data make impossible dintinguish between a.data , b.data. suggested, use maybe use memory address id, how possible map address human readable path? unless you're doing additional work (when declaring data structures), in general not possible in c++. there's no such data stored anywhere in progra

Angle and Scale Invariant template matching using OpenCV -

Image
function rotates template image 0 180 (or upto 360) degrees search related matches(in angles) in source image different scale. the function had been written in opencv c interface. when tried port opencv c++ interface , getting lot of errors. 1 please me port opencv c++ interface. void templatematch() { int i, j, x, y, key; double minval; char windownamesource[] = "original image"; char windownamedestination[] = "result image"; char windownamecoefficientofcorrelation[] = "coefficient of correlation image"; cvpoint minloc; cvpoint temploc; iplimage *sourceimage = cvloadimage("template_source.jpg", cv_load_image_anydepth | cv_load_image_anycolor); iplimage *templateimage = cvloadimage("template.jpg", cv_load_image_anydepth | cv_load_image_anycolor); iplimage *graysourceimage = cvcreateimage(cvgetsize(sourceimage), ipl_depth_8u, 1); iplimage *graytemplateimage =cvcreatei

vba - require loop for sending mail thru excel -

sub mail_activesheet() ' works in excel 2000, excel 2002, excel 2003, excel 2007, excel 2010, outlook 2000, outlook 2002, outlook 2003, outlook 2007, outlook 2010 dim sourcewb workbook dim destwb workbook dim cell range dim subj string dim emailaddr string dim cc string dim bcc string dim body string dim attment string dim outapp object dim outmail object dim x string x = range("b2").select until activecell = "" company = activecell activecell.offset(0, 1).range("a1").select = activecell activecell.offset(0, 2).range("a1").select cemail = activecell activecell.offset(1, -3).range("a1").select emailaddr = range("l2") cc = range("m2") bcc = range("n2") subj = range("o2") attment = range("p2") body = "dear all," & vblf _ & vblf _ & "request pres

sql server - SQL do inner join if condition met -

i want way improve sql code, have use inner join when condition met. replicates code: @systemmerge bit if (@systemmerge=1) begin select ....... mytable inner join table on table.param1=mytable.param1 inner join systemtable on systemtable.param2=mytable.param2 end else begin select ....... mytable inner join table on table.param1=mytable.param1 end and in way this: @systemmerge bit begin select ....... mytable inner join table on table.param1=mytable.param1 ***//the next 4 lines not working, pseudo of want:*** if (@systemmerge=1) begin inner join systemtable on systemtable.param2=mytable.param2 end edit: solution (thanks @damien_the_unbeliever): left join systemtable on systemtable.param2=mytable.param2 ((@systemmerge=1 , systemtable.param2 not null) or (@systemmerge=0 or @systemmerge null)) this should (approxmately) same thing: select ......