Posts

Showing posts from April, 2010

Android: Control goes back to Splash Screen -

i have designed app splash screen sleep() s 3 seconds , displays home screen of app. can navigate app seamlessly , after come home screen, when button pressed control goes splash screen again instead of terminating app. please give me solution. :) finish splash activity before starting new one. onresume method of splash activity this: @override protected void onresume() { super.onresume(); new handler().postdelayed(new runnable() { @override public void run() { // finish splash activity can't returned splashactivity.this.finish(); // create intent start second activity intent mainintent = new intent(splashactivity.this, secondactivity.class); splashactivity.this.startactivity(mainintent); } }, 3000); // 3000 milliseconds }

how to include absolute css path using add_editor_style() in wordpress -

how include external css google font http://fonts.googleapis.com/css?family=lato using add_editor_style() ? when add add_editor_style('http://fonts.googleapis.com/css?family=lato'); , in source code show : <link rel="stylesheet" data-mce-href="http://203.223.152.159/~marineac/wp-content/themes/twentyten/http://fonts.googleapis.com/css?family=lato&amp;ver=342-201106301" href="http://203.223.152.159/~marineac/wp-content/themes/twentyten/http://fonts.googleapis.com/css?family=lato&amp;ver=342-201106301"> you should use mce_css filter. not tested: function so_17961871( $mce_css ) { if ( ! empty( $mce_css ) ) $mce_css .= ','; $mce_css .= 'http://fonts.googleapis.com/css?family=lato'; return $mce_css; } add_filter( 'mce_css', 'so_17961871' );

iphone - is it possible to not dealloc a view controller when the back button is pressed in a navigation controller? -

here issue: have tableview bunch of cells. core data loads task object cells using nsfetchedresultscontroller. right have each cell has detailviewcontroller, stored in dictionary so: -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath{ detailviewcontroller *detailvc; if (![self.detailviewsdictionary.allkeys containsobject:@(indexpath.row)]){ detailvc = [[detailviewcontroller alloc]initwithnibname:@"detailviewcontroller" bundle:nil]; [self.detailviewsdictionary setobject:detailvc forkey:@(indexpath.row)]; }else{ detailvc = self.detailviewsdictionary[@(indexpath.row)]; } tasks *task = [[self fetchedresultscontroller] objectatindexpath:indexpath]; detailvc.testtask = task; [[self navigationcontroller] pushviewcontroller:detailvc animated:yes]; } each detailviewcontroller has timer property gets time interval task object correlates cell @ given index path in tableview. h...

mobile - How to do image processing with Phonegap in JavaScript -

i want know how manipulate pixels can within c# code in javascript phonegap lib. i not sure whether possible. far have found nothing related image processing in phonegap library.(it provide image, capture helper something, it's not enough.) when manipulate pixels it's not simple methods crop, resize, rotate etc. should down level of having access of individual pixels in image more complicated computation can conducted. thank you. ps: guys thank leaving "-1", please give reasons @ same time. thx since javascript, done same on browser: using <canvas> here fastcanvas , phonegap plugin using it. haven't use it, hope useful.

objective c - UIActivityViewController Messenger not working on iOS Simulator -

Image
i'm getting following result when try initialize messenger component of uiactivityviewcontroller : i'm using code instantiate uiactivityviewcontroller : nsstring *texttoshare = @"text shared"; nsarray *itemstoshare = [[nsarray alloc] initwithobjects:texttoshare, nil]; uiactivityviewcontroller *activityvc = [[uiactivityviewcontroller alloc] initwithactivityitems:itemstoshare applicationactivities:nil]; activityvc.excludedactivitytypes = [[nsarray alloc] initwithobjects: uiactivitytypeprint, uiactivitytypecopytopasteboard, uiactivitytypeassigntocontact, uiactivitytypesavetocameraroll, uiactivitytypeposttoweibo,uiactivitytypeposttofacebook,uiactivitytypeposttotwitter, nil]; [activityvc setvalue:@"my subject text" forkey:@"subject"]; [self presentviewcontroller:activityvc animated:yes completion:nil]; i following error in logs when attempt send message launch services: unable find app identifier c...

Grails countrySelect tag - default value -

this code <g:countryselect name="country" value="${customerinstance?.country}" noselection="['':'-choose country-']"/> in show view(page) displays value, instead of want display selected option for example, -choose country- afghanistan albania here in above example want show page display option ("afghanistan") instead of value ("alg"), question me out of problem you have override countryselect tag or create own. import org.codehaus.groovy.grails.plugins.web.taglib.countrytaglib class formstaglib { static namespace = "bootstrap" closure countryselect = { attrs -> if (!attrs.from) { attrs.from = countrytaglib.country_codes_by_name_order } if (!attrs['valuemessageprefix']) attrs.optionvalue = { countrytaglib.iso3166_3[it] } attrs.optionkey = { countrytaglib.iso3166_3[it] } if (!attrs.value) { attrs.valu...

infinite loop of http redirect in asp.net mvc action filter -

i using asp.net mvc 3 developing web application. have written custom global action filter getting triggered whenever invoking of pages in mvc site. in filter, checking conditions, if conditions met, redirecting user "unavailable" page. working fine in cases expect one. it not working on home/index, default route. when first launch application can see home/index in fiddler status code 302 (redirect application/unavailable). browser tries redirect application/unavailable page. surprise can see 302 in fiddler page again home/index. keeps continue till time , getting below error in firefox "firefox has detected server redirecting request address in way never complete." i can see there infinite loop of 302 in fiddler. don't know why happening. doing wrong in routing? my code working other pages of website. here code: routes.maproute("application", "application/unavailable", mvc.application.unavailable()); routes.maproute(...

windows - Run external command from within Perl -

i using doxygen generate html documentation , run perl script function names. to run doxygen configuration need run doxygen file_name in cmd. but want run perl. i tried code my $cmd = "perl -w otherscript.pl"; $result = system( "start $cmd" ); but opens cmd window. need execute cmd code directly through perl (not perl command line through perl ide). there way achieve this? your usage of system , start ok. from description in comment, think it's because you're not using correct escaping method when giving configure files doxygen throw such error: error: configuration file c:sersghoshbcd not found! try my $result = `doxygen c:\\users\\aghosh\\abcd`; in 2 back-slashes, former 1 escape latter 1 it's recognized windows directory separator.

ios - I want to display a videothumbnail image of a video from url in my uiimageview for iphone -

is possible first image frame of video , display in uiimageview . video saved in server. need call url play video an example: nsurl *videourl = [nsurl fileurlwithpath:videopath]; avurlasset *asset = [[avurlasset alloc] initwithurl:videourl options:nil]; avassetimagegenerator *generate = [[avassetimagegenerator alloc] initwithasset:asset]; generate.appliespreferredtracktransform = yes; nserror *err = null; cmtime time = cmtimemake(1, 60); cgimageref imgref = [generate copycgimageattime:time actualtime:null error:&err]; uiimage *img = [[uiimage alloc] initwithcgimage:imgref]; [yourimageview setimage:img]; hope helps..

c# - Android Authentication with SqlServer using web services -

i begineer..how can compare values(email & pass) entered in texboxes of android , compare values stored in sqlserver database using webservices? i did not understand looking for, want interact sql via php link you. http://android-am.blogspot.in/2012/10/android-login-screen-by-connecting-to.html

Django-allauth with multiple profile models -

i have django project in there multiple profile models, each having foreign key user model. uses django-allauth registration. currently, when registering using social account, user registers, user , socialaccount created, user redirected form fill out, depending on profile type s/he chose earlier, , after filling out form correct profile type created. i'd if user, socialaccount , profile type instances created in same step, after user fills out profile specific form. there anyway can without changing allauth's code? wouldn't hard modifying allauth, i'd rather not maintain custom copy of 3rd party app if can helped. using custom adapter out, because not have access request. take @ allauth.account.signals.user_signed_up signal, triggered after user (social or normal) signs up. can stuff account there: from django.dispatch import receiver allauth.account.signals import user_signed_up @receiver(user_signed_up) def do_stuff_after_sign_up(sender, **kw...

javascript - SPA - search html table -

i'm building single page application in have html table , need implement search box loops through rows of table , hides ones don't match search-box text. problem being spa javascript code found on internet thing based on $(document).ready(function() doesn't work. tried folowing approach: in viewmodel.js have: function filter2(search, tbldata) { window.phrase = document.getelementbyid(search).value; var words = window.phrase.tolowercase().split(" "); var table = document.getelementbyid(tbldata); var ele; (var r = 1; r < table.rows.length; r++) { ele = table.rows[r].innerhtml.replace(/<^>+>/g, ""); var displaystyle = 'none'; (var = 0; < words.length; i++) { if (ele.tolowercase().indexof(words[i]) >= 0) displaystyle = ''; else { displaystyle = 'none'; ...

eclipse - Mylyn jenkins connector gives always Service Unavailable -

i have installed hudson/jenkins mylyn connector eclipse (as mentioned here: https://stackoverflow.com/a/11543067/863180 ) i have configured jenkins, error: server validation failed: unexpected error: unexpected response server while logging in: service unavailable this complete error: eclipse.buildid=unknown java.version=1.7.0_13 java.vendor=oracle corporation bootloader constants: os=win32, arch=x86_64, ws=win32, nl=en_us framework arguments: -showlocation -product com.jboss.jbds.product.product command-line arguments: -os win32 -ws win32 -arch x86_64 -showlocation -product com.jboss.jbds.product.product error wed jul 31 08:39:16 cest 2013 server validation failed: unexpected error: unexpected response server while logging in: service unavailable org.eclipse.core.runtime.coreexception: unexpected error: unexpected response server while logging in: service unavailable @ org.eclipse.mylyn.internal.hudson.core.hudsoncoreplugin.tocoreexception(hudsoncoreplugin.java:61) ...

mongodb - Map not compiled -

i have collection of following : { "_id" : objectid("51dfb7abe4b02f15ee93a7c7"), "date_created" : "2013-7-12 13:25:5", "referrer_id" : 13, "role_name" : "physician", "status_id" : "1", "demographics" : { "date_created" : "2013-7-12 13:25:5", "first_name" : "jjjjkk", "last_name" : "jjjjkkjjjjkkjjjjkk", "birthdate" : "11-07-1980" } } i creating following map function: "map" : "function map(){emit(this._id,{demographics:{first_name\":this.demographics.first_name,middle_name\":this.demographics.middle_name,last_name\":this.demographics.last_name}});" as per documentation , getting error "errmsg" : "exception: couldn't compile code for: `_map`" please try: var map = function(){ emit(this._id, { ...

uiimageview - Animate image from array with animation style -

i have 3 images in array sample code animate without style .i want animate fade in fade out style. nsarray *imarray = [[nsarray alloc] initwithobjects: [uiimage imagewithcontentsoffile:[nsstring stringwithformat:@"%@/lady1_open.png", path]], [uiimage imagewithcontentsoffile:[nsstring stringwithformat:@"%@/lady1_open2.png", path]], [uiimage imagewithcontentsoffile:[nsstring stringwithformat:@"%@/lady1_open3.png", path]], nil]; bingo_girl.animationimages=imarray; bingo_girl.animationduration=5; bingo_girl.animationrepeatcount=0; [bingo_girl.layer addanimation:transition forkey:nil]; [bingo_girl startanimating]; you may animate images transition manually example using category @implementation uiimageview (animatetransition) - (void) assignimage:(uiimage *)image withtransition:(nsstring *)withtransition withdirection:(nsstring *)withdirection{ if(image == nil) { [self setimage:nil]; return; } if ([uiimagepngrepresentation...

oracle - Update Query issue for multiple rows -

i have below update query set values , controle data flow.but getting error "too many values" condtion(subquery)when execute bellow query. update mtb ----- table name set mtb_extr_flag='n', mtb_aloc_process='dc1' mtb_i in --- primary key ( select * ( select mtb_i ,row_number() on (order rowid) rn mtb ) rn between 100 , 500 ) here intension selecting different set data per processing of 1 job. want set mtb_extr_flag='n',mtb_aloc_process='dc1' each time before running of job different set of data. can please me resolve error issue or propose different query. thank you. i think matter of number of columns not matching (2 - mtb_i , rn - instead of 1 - mtb_i ): update mtb set mtb_extr_flag='n', mtb_aloc_process='dc1' mtb_i in --- primary key ( select mtb_i -- else rn taken !! ( select mtb_i ,row_number() on (order rowid) rn mtb ) rn between 100 , 500 ) you can't where x in (...)...

Are google's AdMob advertisements free to show in your android app? -

i've been trying show ads in android app. i've used tapit , soma(www.smaato.com) library im having issues both of them tapit not free use , soma using async task update adds whereas want ads run on thread. i'm trying admob now, i've created account, gives me 2 options: 1) start campaign 2) add site/app in both cases i've pay. there way can have ads on app don't have pay. trial version developers or kindly suggest other library can use. thank in advance. ps: app isn't on google play yes google's admob advertisement free show in app - go through admob docs - https://developers.google.com/mobile-ads-sdk/download login google admob site. after login check - > sites & apps add site/app fill details. use publisher id in code for don't have pay anything. you've ads on android application. you can participate in google admob competition. grand prize winner score week-long trip san francisco, including visi...

jquery - $(this) child element css change not working at all -

i have little question. $('.item').mouseenter(function() { settimeout(function() { $(this).find('.item-overlay').css('z-index', '-1'); }, 300); }).mouseleave(function() { $(this).find('.item-overlay').css('z-index', ''); }); <div class="item"> <div class="item-overlay"> </div> <iframe>...</iframe> </div> everything works fine, except 1 small thing. z-index isn't changing. can guys me out this? i've tried "next", "child", "find" - none worked :( this within function you're passing settimeout window , not element. ( this depends on how function called, not it's used.) you can save this value event handler got (or actually, you're going jquery-wrap it, var outside settimeout function), e.g.: $('.item').mouseenter(function() { var $this = $(this); settimeout(func...

"git pull" returns error in Windows command prompt -

now have git repository on windows machine, , run automatic tests on repository perl. make sure every time launch test repository latest, use: system("git pull"); before test. but returns error: fatal: uh oh. system reports no git commands @ all. however, when run git show same methodology, like: system("git show"); the output ok, windows command prompt recognized git command (and exist in system path). why of git commands succeed while others can't? ps: i'm using git bash , if launch perl script git bash, both git pull , git show work. expectation double click perl script run instead of calling git bash shell. make sure isn't path issue, explained in this link (for windows, valid other os too). check if don't have active git alias might prevent git pull work properly. regarding path issue, op aladine confirms in comments: i discover after reinstall git, works normal.

Uniqueness Not Maintained On MYSQL Database Rails 3.2 -

i have simple form submission. on model have added validates_uniqueness_of :field but somehow in database records duplicate value of field . and controller methods follows def create field_obj=model.find_by_field(params[:model][:field]) if field_obj.nil? @model = model.new(params[:model]) if (@model.save && params[:commit] == "submit") @model.is_submitted=true @model.submitted_timestamp=time.now @model.save elsif (@model.save(:validate => false) && params[:commit] == "save") @model.last_saved_timestamp=time.now @model.save end respond_to |format| if (@model.save || (@model.save(:validate => false))) format.json { render json: @model, status: :created, location: @model } format.js else format.js format.json { render json: @model.errors, status: :unproc...

gwt - Setting -XdisableCastChecking to true -

i need set -xdisablecastchecking true building gwt application (with eclipse). i know how compile application i'm not able set -xdisablecastchecking true building war file (i'm using build.xml , file). does know how include flag ant file? thank in advance. alsila if using standard build.xml generated wepappcreator , should have @ top of build.xml block below. modify gwt.args line adding arguments want pass gwt compiler: <?xml version="1.0" encoding="utf-8" ?> <project name="myproject" default="build" basedir="."> <!-- arguments gwtc , devmode targets --> <property name="gwt.args" value="-xdisablecastchecking" /> [...]

visual studio 2012 - The JavaScript language service has encountered an error and has been shut down -

Image
suddenly receive error message: the javascript language service has encountered error , has been shut down. there no intellisense in javascript! what do? in case have: latest vs 2013 upd.3 latest web essential 2013 latest resharper 8.2.1 sometimes see errors on opening first js-file after running solution. have spent 2 days on it. removing web essentials helps (also clean appdata\local\microsoft\visualstudio\12.0\extensions folder: extensions.en-us.cache extensionsdks.en-us.cache "webessentials" folder - contain file webessentials2013.pkgdef then have tried reset vs settings , helped. month) today have updated solution git via vs git tools (commit contained lot of js , css changes) , have seen again!!! new solution steps: export vs settings. reset vs settings restart vs. check if has no errors. import vs settings except options => texteditor. turn on line numbers languages (and if have other custom settings - them too) ...

javascript - Arguments of self executing function -

this question has answer here: how javascript/jquery syntax work: (function( window, undefined ) { })(window)? 5 answers (function (global, undefined) { ... code doesnt use arguments array } (this)); i see module pattern done in way. i question why there's second argument undefined ? these examples buggy or there special meaning of undefined here? undefined global property used. in older versions of javascript possible change value of (for example, true ). breaks everything. changing scope local "module" (i.e. function), other modules prevented interfering it. this allows code safely use undefined instead of having use global.undefined . mdn reference

java - read and jlabel set icon a image with different extension .001 -

file file = new file("c:\\registro_sql\\imagens\\livro02\\0000\\000011.001"); bufferedimage bufferedimage = null; try { bufferedimage = imageio.read(file); icon icon = (icon) bufferedimage; lblimageicon.seticon(icon); } catch (ioexception ex) { joptionpane.showmessagedialog(null, "erro!"); } error: exception in thread "main" java.lang.error: unresolved compilation problem: unhandled exception type ioexception @ certidoesorganizado.executor.main(executor.java:6) i have files extesion .001, .002, .003, files image, cant rename since software use they, want use java display images files, idea since bufferedimage not showing nothing, retunr error the error has nothing code in question shows ioexception has try/catch block. error produced code not shown. also statement icon icon = (icon) bufferedimage; will result in classcastexception bufferedimage not icon type. replace lblimageicon.se...

python - How to escape single quotes in reStructuredText when converting to HTML using Sphinx -

Image
for documentation project writing need include table date format strings. works fine, @ end have slight problem want print literal ' quote , 2 literal quotes (separately , between other quotes). sphinx changes these up/down quotes, looks neat, in particular case makes text unreadable. best come was: ====== =========== ====== ===================== ``'`` escape | " ``'`` hour ``'`` h" -> "hour 9" text delimiter ``''`` single | "ss ``''`` sss" -> "45 ``'`` 876" quote literal ====== =========== ====== ===================== this produces right quotes, inserts spaces before , after, see removed, since example not syntactically correct way. 1 rephrase question as: how remove spaces before , after literal quotes when using backticks. i have tried standard ways of escaping. backslashes have no effect, since ' not restruc...

android - conflict between ksoap2 and actionbarscherlock using Proguard -

i experienced problem trying obfuscate app code using proguard tool. seems conflict occur using both ksoap2 , actionbarsherlock in same project. to narrow down debug opeartions created simple android project used these 2 libs. if use actionbarsherlok can succesfully exported app. same thing if use ksoap2 adding in proguard-project.txt following lines: ignorewarnings -keep class org.kobjects.** { *; } -keep class org.ksoap2.** { *; } -keep class org.kxml2.** { *; } -keep class org.xmlpull.** { *; } by adding these lines avoid proguard generates bunch of warnings org.xmlpull class. when try use both libs leaving above lines in proguard-project.txt get: [2013-07-31 10:47:46 - testproguard] warning: library class android.content.res.xmlresourceparser extends or implements program class org.xmlpull.v1.xmlpullparser [2013-07-31 10:47:46 - testproguard] warning: library class android.content.intent depends on program class org.xmlpull.v1.xmlpullparser [2013-07-31 10:47:46 - te...

jquery auto complete not receives data -

var projects2 = <?php include_once "autocompletehandler.php"; ?>; var projects23= <?php include_once "autocompletehandler.php"; ?>; $("#p_name").autocomplete({ minlength: 2, source: projects2, focus: function(event, ui) { $("#p_name").val(ui.item.label); return false; }, select: function(event, ui) { return false; } }) .data("ui-autocomplete")._renderitem = function(ul, item) { return $("<li>") .append("<a>" + item.label + "/" + item.p_gender + "/" + item.p_age + "</a>") .appendto(ul); }; $("#p_tp").autocomplete({ minlength: 2, source: projects23, focus: function(event, ui) { $("#p_tp").val(ui.item.label); retur...

asp.net - How to insert HTML Editor in Grid? -

Image
hello, using 'trial of tekerik controls', building grid. now, want insert html edit control in grid when press 'edit' , select row shortdescription. want html control open, can edit information inside. you can see here example. here code <telerik:radgrid id="radgrid1" runat="server" showgrouppanel="true" gridlines="none" datasourceid="datasource1" allowfiltering="false" allowautomaticdeletes="true" allowautomaticinserts="true" allowautomaticupdates="true" allowfilteringbycolumn="true" autogeneratedeletecolumn="true" autogenerateeditcolumn="true" cellspacing="0"> <mastertableview grouploadmode="client" showgroupfooter="false" groupsdefaultexpanded="false" autogeneratecolumns="false" datakeynames="id"> <columns> ...

linux - FFmpeg-php installation error on CentOS 6 64x bit -

i trying install ffmpeg , ffmpeg-php. ffmpeg installed perfectly.when trying install ffmpeg-php. when ran command ./configure configuare fine. when ran command make give me below error. tried way @ last facing error. make: *** [ffmpeg_movie.lo] error 1 os: centos 6.4 x86_64 virtuozzo – vps please, give me suggestion or solve error. thanks in advance..!!

visual studio 2010 - How can I find out why a trivial Word add-in doesn't load? -

i'm using macbook pro clean install of windows 8.1, office ultimate 2007 , visual studio pro 2010. activated. i begin visual studio , create word 2007 application add-in ("wordaddin1"). press f5 , word loaded. check in word options -> add-ins, , wordaddin1 appears under "inactive". activating via "com add-ins" results in "load behaviour:" (displayed below list of add-ins available) becoming "not loaded. runtime error occurred during loading of com add-in". there nothing in event log pertaining office , setting environment variable vsto_suppressdisplayalerts 0 doesn't help. identical actions identical versions of office , visual studio on 2 other machines results in "wordaddin1" being loaded , appearing under "active" add-ins. how can debug this? i came across same problem, it's hard find out why loading of addin fails. in case version mismatch of addin-dll, there more possibiliti...

java - not able to use the comparator in my program -

in program not identifying compartor , don't want use compareto . class testtreeset { public static void main(string args[]) { buildobject build = new buildobject(); treeset treeset = new treeset( new compared()); treeset = build.sendastreeset(); iterator itr = treeset.iterator(); while(itr.hasnext()) { obj object = (obj) itr.next(); system.out.println(object.getname() + "\n " + object.getage() + "\n " + object.getsalary()); } } } this comparator class compared implements comparator { public int compare(object , object b) { obj 1 = (obj) a; obj 2 = (obj) b; double salaryone = one.getsalary(); double salarytwo = two.getsalary(); int ageone = one.getage(); int agetwo = two.getage(); if( ageone == agetwo) { if(salaryone > salarytwo) { ...

jquery - Paring XML that is equal to a parsed field -

having played around wondering i'm going wrong? parsing xml file returns lots of fields within xml file , want return rows of xml equal or greater referenced field. the 'occ' field trying reference figured needed state integer using parseint. xml parser looks under "fault' category , brings data, stated want show occurances (occ) greater or equal 5, within normal scope of xml there 1's through 10's example. here's code have: $(xml).find("fault").each(function () { liv = $(this).attr("live"); var partname = $(this).find("part").text(); var defect = $(this).find("defect").text(); var model = $(this).find("model").text(); var location = $(this).find("location").text(); var causal = $(this).find("causal").text(); var occ = parseint($(this).find("occ").text()); var wkzero ...

timer - How do I know my whole android application is not running anymore or closed? -

i have timer perform task instance, every 10 seconds. the problem want know application has been closed in activity in, end runnable timer , task within it. implemented using ondestroy on activity current activity in, tried onterminate in application class it's not triggered , it's discouraged. so how this? there ondestroy equivalent in application class?

matlab - How to display image with axes using Simulink? -

i want display image axes labelled xdata , ydata possible imshow . my simulation generates new image each step. i found no way neither video viewer nor matrix viewer . may possible hook them somehow?

Java reflection multiple parameters -

i trying use java reflection , have 2 different methods call. 1 of them has single string parameter , second 1 has 2 string parameters. i've managed first 1 working, still struggling second one. i've checked references 2 other questions ( java reflection: getmethod(string method, object[].class) not working , how invoke method variable arguments in java using reflection? ), unfortunately had no luck them. keep getting following exception: java.lang.nosuchmethodexception: controllers.inventorycontroller.combineitems([ljava.lang.string;) @ java.lang.class.getmethod(unknown source) here working part of code: class[] paramstring = new class[1]; paramstring[0] = string.class; try { class cls = this.getclass(); method method = cls.getdeclaredmethod(commandparts[0], paramstring); method.invoke(this, new string(commandparts[1])); } catch (exception ex) { system.out.println("doesn't work"); ex.printstacktrace(); } now here part can't w...

oracle - duplicating entries in listagg function -

i have table in 2 fields id, controlflag.it looks like id cntrlflag 121 sssssrnnnssrssnnr 122 sssnnrrssnnrsssss 123 rrsssnnsssssssssssssss i have output in following form( occurences of r) id flag 121 6,12,17 122 6,7,12 123 1,2 i tried oracle query( obtained forum): select mtr_id,listagg(str,',') within group (order lvl) flags ( select mtr_id, instr(mtr_ctrl_flags,'r', 1, level) str, level lvl mer_trans_reject connect level <= regexp_count(mtr_ctrl_flags, 'r'))group mtr_id; it gives result 2nd , 3rd occurrences(not 1st one) duplicated no. of times. looks id flag 123 6,12,12,12,12,17,17,17,17,17. can know what's wrong here? it avoided select distinct keyword.is there other way? yes, there is, 1 little bit heavier(distinct cost less): with t1(id1, cntrlflag) as( select 121, 'sssssrnnnssrssnnr' dual union select 122, 'sssnnrrssnn...

ios - delegate assigning in objective c++ -

i want assign delegate of asyncsockket in project. in objective c, can assign delegate follow: asynsocket *socket = [[asyncsocket alloc] initwithdelegate:self]; how similar thing in objective-c++ self assigning can't done in it.

c++ - What is the best way to implement a threshold into a hash? -

i want implement following in c++: hash x(ballpark figure: 1 digit millions) 64 bit integers output elements occurrence >= y (user specified) binary file right now, code hashes & outputs every element , not regard low occurrencies. the obvious solution refactor code in way hashes not integer struct. contains integer , counter, checked being >=y before outputting elements binary file. bottomline memory footprint increase x*size_of(counter). is there more sophisticated way of accomplishing task?

nlp - Why there is a difference in parse tree output generated from api and GUI provided in stanfordNLP -

i using 'stanford-corenlp-full-2013-06-20' api generate parse tree given below private string text= "heart attack causes reduced lifespan average"; annotation annotation = new annotation(text); corenlp.annotate(annotation); list<coremap> sentences = annotation.get(sentencesannotation.class); (coremap sentence : sentences) { tree tree = sentence.get(treeannotation.class); tree.pennprint(); } it showing sub sentence 's' shown below (root (**s** (np (nnp heart) (nn attack)) (vp (vbz causes) (**s** (np (vbn reduced) (nn lifespan) (nn average)))))) but when try parse same sentence using gui provided 'stanford-parser-full-2013-06-20' giving different tree (it seems right one) given below (root (**s** (np (nnp heart) (nn attack)) (vp (vbz causes) (vp (vbn reduced) (np (nn lifespan) (nn average)))))) can 1 point out why both showing 2 different outputs though both belong ...

lua - ScreenShot (CORONA SDK) -

i have take screenshot of desired screen group not working , totally black image saved in documents directory . how can save screenshot ? local function takesnapshot(event) timer.performwithdelay( 100, capturewithdelay ) end function capturewithdelay() local basedir = system.documentsdirectory display.save( stagegroup, "entiregroup.jpg", basedir ) end i think using lower version of graphics drive.try in mac latest.

python - how to install virtualenv and/or pip -

Image
someone please tell me i'm not crazy, becuase feel right now. ok so, i'm trying setup webapp python , django using heroku, i've hit quite odd obstacle. it wants me setup virtualenv using command $ virtualenv venv --distribute , , except: yeh, naturally googled how install virtualenv , found this: but, of course: so continued search trying find out how install pip , found this: aaaaaaand that's when lost marbles because apparently need install pip install virtualenv install pip. (maybe not, that's why i'm noob , need help). but took @ vitualenv installation guide, , found download , install manually, extracted files downloaded archive python33 folder , used setup.py install . , got this: so changed line in file except valueerror e , got error different python file in same folder reverted change made , decided not idea meddle scripts. please, @ setting free server python , django appreciated. furthermore, sorry if question stupid...

iphone - How can i pass special character(like #,@,%,$) in NSRequestURL with GET method JSON Objective C -

how can pass nsrequesturl http://ww.a.com/account/checkvaliduser?username=abc&password=abc123# through json http method server?. passpword contain # chracter. how can send nsurlrequest in objective c. you can consult link provides types of html special character codes present : - html special characters code list

Auditing Tables in Informatica -

we want maintain auditing of tables , question 1)will commit interval in informatica stored anywhere in variable , can maintain record count every commit interval. 2)is there method/script read stats session log , save in audit table. 3)if there multiple targets in mapping in monitor after executing show target success count , target reject count total targets in mapping. how individual target success , reject count . you need use informatica metadata tables informatica doesn't recommend(still mentioning reference). options create sh/bat script these info session log or create maplet collects kind of statistics , add maplet in every infa mappings. answers questions - yes, commit intervals stored in informatica table opb_task_attr attr_id=14 , select attr_value. nope, either can use infa mapplet collct such stats or shell script. yes possible. use infomatica view rep_sess_tbl_log purpose. here can each target's statistics of particular session's run. ...

android - GoogleCloudMessaging PHP script always returning invalidregistration -

i know there lots of posts same issue, after read of them not find reason of problem. i wrote gcm client register device receive messages server. working , can store registration id in database. my problem in server side. i'm using script found somewhere googling, receive error result: {"multicast_id":7341760174206782539,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"invalidregistration"}]} the php code (i'm using browser api instead of server api told on tutorial, trying both keys returns same message): <?php // replace real browser api key google apis $apikey = "aizasyacln4edhszw30xcmypqomz_gcrcc1ifjy"; // replace real client registration ids $registrationids = array( "apa91bedf1w4dqtsuqpt1jhhwepvrpxzb1yrpl3rvtkrvxfzxfg2-yl-pwhorsnmsnkqywq8g90ycgeboqcjgqu8cnja0n7mowf8bhmhhas4ty46pptx8yh6esasqvu3jtmmb-p0ma90ebg0rsqqbuh3ax895kxiti3lcigoyqrfe5pzq"); // me...

How to create Google app engine project which access google prediction Api -

i have work on google prediction api.i have create google training model work fine when first train it->check status it-> predict using google own interface prediction api.mean here https://developers.google.com/apis-explorer/#s/prediction/v1.6/ but want train model or prediction google app engine project using java pls have idea how done it..the google give example python want java pls me... take @ java api client example found @ https://code.google.com/p/google-api-java-client/wiki/apis#prediction_api the direct link code @ https://code.google.com/p/google-api-java-client/source/browse/prediction-cmdline-sample/src/main/java/com/google/api/services/samples/prediction/cmdline/predictionsample.java?repo=samples

Android: Concept behind KeyHash of Facebook SDK? -

i using facebooksdk , following steps generate new keyhash, keyhash generated using debug keystore working charm keyhash generated using our own couple of keystores not working, tried function given in troubleshooting it's still not working. have tried using following code in oncreate // add code print out key hash try { system.out.println("inside try keyhash"); packageinfo info = getpackagemanager().getpackageinfo( "com.myapp.facebookint", packagemanager.get_signatures); (signature signature : info.signatures) { messagedigest md = messagedigest.getinstance("sha"); md.update(signature.tobytearray()); log.d("keyhash:", base64.encodetostring(md.digest(), base64.default)); system.out.println("keyhash:"+base64.encodetostring(md.digest(), base64.default)); } } ...

javascript - for each element of a class, check the contents to see if it contains a string, and then update only that element if it does -

code version 1: var 1 = "one"; $.each($(".buttons"),(function() { if ($("this:contains(one)")) { $(this).addclass( "currentbutton" ); }; })); code version 2: var 1 = "one"; $(".buttons").each(function(a, e) { if ($("e:contains(one)")) { $(e).addclass( "currentbutton" ); }; }); i think see i'm trying do. problem updating specific element text matched, elements updated when 1 matches. edit: html below: <input type="submit" class="buttons" value="one"> <input type="submit" class="buttons" value="two"> <input type="submit" class="buttons" value="one & two"> i using inputs programmatically added buttons using asp.net/c# i have attempted couple of solutions , i'm s...

javascript - Avoiding dialog box on beforeunload.. Is it possible? -

i using jquery bind: $(window).bind('beforeunload', function() { //code return ""; } if not give return "", works fine in mozilla firefox, ie8. not give alert box saying "are sure want navigate away page?" in google chrome, beforeunload event not work without return "" statement. and if use return"", gives alert box in broswers. i not want dialog box , want beforeunload event work. please help. please suggest if there other alternative solution this. thanks. onbeforeunload has not behaviour consistent across browser you should set ajax calls async false inside function call in beforeunload event , try ugly hack: $(window).on('beforeunload', function (e) { if (e.originalevent) //call function updating omniture site else //this provide enough time other requests send $.get("", { async: false }); $(this).trigger('beforeunload'); //wil...

asp.net mvc - AntiForgeryConfig.RequireSsl causes random errors when using without SSL -

our security team requires cookies set secure=true. to set secure property mvc antiforgery, using following code: protected void application_beginrequest(object sender, eventargs e) { antiforgeryconfig.requiressl = httpcontext.current.request.issecureconnection; } but have problem on our test server not using ssl. have spontaneous errors the anti-forgery system has configuration value antiforgeryconfig.requiressl = true, current request not ssl request. when looking in asp.net mvc code pinpoint location of exception, found following private void checksslconfig(httpcontextbase httpcontext) { if (_config.requiressl && !httpcontext.request.issecureconnection) { throw new invalidoperationexception(webpageresources.antiforgeryworker_requiressl); } } it seems correct , should work because execution sequence is antiforgeryconfig.requiressl = httpcontext.current.request.issecureconnection; // ... happens in between ...

javascript - How can I get all <tr>-s from a <tbody> and convert it to String? -

i have html table: <table id="persons" border="1"> <thead id="theadid"> <tr> <th>name</th> <th>sex</th> <th>message</th> </tr> </thead> <tbody id="tbodyid"> <tr> <td>viktor</td> <td>male</td> <td>etc</td> </tr> <tr> <td>melissa</td> <td>female</td> <td>etc</td> </tr> <tr> <td>joe</td> <td>male</td> <td>etc</td> </tr> </tbody> </table> <input type="button" onclick="gettbodystring();" value="get it"/> i want jquery/javascript, can inside of tbody string. like: ...

tfs2010 - All project Files get read only attribute after download from TFS 2010 -

i using team foundation server vs 2010. facing problem when mapping new folder download code tfs, after download code, files/folder in new folder automatically read attribute , have remove attribute explicitly after able build solution other wise giving me "access denied" error. there tfs setting making project files read only. not tfs 2010, called "local workspaces" , available tfs 2012 onwards , works subversion. what doing, removing read flag, fighting tfs. should perform checkout on file before editing. if using visual studio edit solutions/projects happen automatically providing have solution , project bindings setup . if editing files outside of visual studio, can perform checkout by: using source control explorer in visual studio. using team foundation server power toys install shell extension windows can right click. opening file in visual studio , using text editor. using tf checkout command line. by removing read flag, allowing edi...

perl - How to increment (alter) a string for each passage in a loop -

aim: a tab separated file contains different strings. elements identical, not. "concatenate" specific elements on same line. however, in operation need make changes specific element separate them each other, e.g. adding number end. input (in @input ): file1 2 range-2 operation execute:error 12345444,294837,298774 file2 3 range-1 default range:error 349928,37224 ... i concatenate "field" execute:error 12345444,294837,298774 , range:error 349928,37224, give this: output: execute:error-1 12345444 execute:error-2 294837 execute:error-3 298774 range:error-1 349928 range:error-2 37224 perl code: thinking of performing foreach loop on elements in @input, using e.g. hashes count number of "strings" in last "column" separated commas, , somehow add number (e.g. equal total hash -1, making counter?). but, bit on head. how, can done? tried bit below, have stopped after 2 hours of trying , reading , searching similar questions. maybe should ...

ruby on rails - Including partial in every view -

i'd add olark every page on website, i've stuck code partial in shared folder. how can add every page? i've noticed theres footer partial included on every page, tie in somehow? you can include partial inside application.html.erb layout file <%= render 'partial_folder/partial_name' %>

Illegal string offset 'handler' in PHP -

this question has answer here: reference - error mean in php? 29 answers please how can correct error: warning: illegal string offset 'handler' in /home/***************/public_html/whois/phpwhois/whois.gtld.php on line 95 on following code: function parse($data, $query) { $this->query = array(); $this->subversion = sprintf("%s-%s", $query["handler"], $this->handler_version); $this->result = generic_parser_b($data["rawdata"], $this->reg_fields, 'dmy'); please check if $query string if code not work. make sure pass $enquiry array or fire exception.

c# - Dynamic build query & SQL Injection & DLLs files -

i have read lot of things sql injection , many arguments why should avoid build query dynamically using plain code/concatenations within cs.file however, have question , need advice more experience me. i created dll files in order re-use code in different projects , reason thinking generic. i created these dll files contained logic/code of building sql queries in dynamic way + concatenation of statement. thereafter, add these dll files reference project. this vulnerable sql injection ? insufficient procedure (time consuming/insufficient maintenance)? any advice appreciated. if not processing input passing query (built @ run time) vulnerable sql injection. adding dll or not doesn't makes difference. to overcome need use parameterised queries. have multiple advantages part security. one reason can think of right have text box. , query is "select * table1 name = '" + textbox1.text; not lets assume in textbox1 user enters ehsan's . que...

c# - FileHelpers Library: AfterReadRecord Compilation Error -

i'm hoping there's expert in using filehelpers library here. i'm using 2.9.9 stable version nuget , trying use afterreadrecord event handler test if fields empty. the code have shown in simplified form below: public class test { public class myclass { public string name; } public static void engine_afterreadrecord(enginebase engine, filehelpers.events.afterreadeventargs<myclass> e) { if (string.isnullorwhitespace(e.record.name)) { throw new invaliddataexception("name required"); } } public void readcsv() { filehelperengine engine = new filehelperengine(typeof(myclass)); engine.options.ignorefirstlines = 1; engine.errormanager.errormode = errormode.saveandcontinue; engine.afterreadrecord += new filehelpers.events.afterreadhandler<myclass>(engine_afterreadrecord); } } there's compilation error on last line in readcsv file. error is: cannot implicitly convert type 'filehelpers.events.afterreadhandler<...

jquery - Javascript .find() not working under all the IE browser -

Image
i have js code converts html dropdown bootstrap dropdown: jquery(function($){ $('#primary').each(function(i, e) { if (!($(e).data('convert') == 'no')) { $(e).hide().wrap('<div style="display:inline-block;" class="btn-group" id="select-group-' + + '" />'); var select = $('#select-group-' + i); var current = ($(e).val()) ? $(e).val(): 'category'; select.html('<input type="hidden" value="' + $(e).val() + '" name="' + $(e).attr('name') + '" id="' + $(e).attr('id') + '" class="' + $(e).attr('class') + '" /><a data-toggle="dropdown" style="border-radius:4px 0px 0px 4px; margin-right:0px;" class="btn" href="javascript:;">' + current + '</a><a class="btn dr...