Posts

Showing posts from April, 2015

How do I declare a file type for removable storage access in Windows UAP? -

i have windows universal app declaration in app manifest removable storage access. how declare file type access ? <capabilities> <capability name="internetclient" /> <uap:capability name="removablestorage" /> </capabilities>

Xcode C++ Console: Is there a limit on number of input characters? -

Image
when paste or type string contains ~1000 characters console, ¿'s (upside down question marks) start appearing in input. once start appearing, can't delete characters i've entered, , pressing enter yields more ¿'s. program continues after hitting delete once , pressing enter again. when cout << string obtained input , amount of characters equal number of ¿'s appeared in input missing string. there no missing characters in input, strange ¿'s. it's not issue unknown characters, happens simple letters , digits. doesn't happen when input entered in pieces. there sort of limit on how many characters can entered console @ once, or different error? , can fixed? thanks!

datatables with fixedheader: row click function giving error on fixed cols -

i have on click function storing row data in console log if click on first 2 columns, you'll notice function returns undefined, of unfrozen columns returns data object i know has todo fact fixedcolumns created in cloned table, wondering if there workaround this? // server-side processing object sourced data var $table; $(document).ready(function() { $table = $('#example').datatable( { "processing": true, "serverside": true, "ajax": "/ssp/objects.php", dom: "<'row'<'col-md-6 'l><'col-md-6 pull-right'>r>t<'row'<'col-md-6'i><'col-md-6'p>>", "columns": [ { "data": "first_name" }, { "data": "last_name" }, { "data": "position" }, { "data": "office" }, ...

php - URL issues with domain masking -

i have domain masking turned on through domain registrar displays foo.org in address bar. discovered after customers sign via paypal, , returned site along post data site process, variables automatically appended url this: foo.org/success.php?txn_id=kb0099898yp&txn_status=sdlkfjbsdkljfbsdkjb&etc . trouble is, these variables remain in address bar indefinitely, if click on link , page loads! if refresh page, no matter go on site after this, resubmits data server processing! this happens if customer manually appends url. never goes away. i have looked on , google, , i'm either not asking right question, or no 1 else has had problem before :) how remedy this?

java - Get automatically a CSV from external server using Spring MVC -

i have scheduled task (using cron) inside spring mvc application. inside programmed task have csv external server in following link: http://www.aemet.es/es/eltiempo/observacion/ultimosdatos_6172o_datos-horarios.csv?k=and&l=6172o&datos=det&w=0&f=temperatura&x=h24 and once have parse it. problem comes when getting file, when click on previous link can download computer, don't know how using spring.... can give me hint?? update: don't have code yet, guess must similar following code: url stockurl = new url("http://example.com/stock.csv"); bufferedreader in = new bufferedreader(new inputstreamreader(stockurl.openstream())); csvreader reader = new csvreader(in); but problem url not .csv. whe put url in browser looks redirect. thank indeed. thank comments. if url doesn't have csv extension, tried following code (in java, not spring) works!! url stockurl = new url("http://www.aemet.es/es/eltiempo/observacion/ultimosdato...

Typescript: How to reference jquery-easyui library? -

i'm new typescript. trying work jquery-easyui library not have d.ts definition file in defintelytyped repo. not have time (or skills) write d.ts file library. how go using in typescript file? in test.ts file, tried doing a: /// <amd-dependency path="libs/easyui/jquery.easyui.min.js"> function newuser(){ $('#dlg').dialog('open').dialog('settitle','new user'); ... etc. but webstorm reports error on "$" symbol "unresolved method or function $()". tried replacing amd-dependency .. reference.. still did not work. library path correct. code works fine if put in .js file. step 1 include declare file jquery. @ least type info vanilla jquery. put following @ top of js files using jquery /// <reference path='jquery.d.ts' /> next want create file jquery.easyui.d.ts , add this: interface jquery { dialog: any; } the code above means jquery interface (initially defined i...

swift - Limit the scaling of pinch gesture method to the height of screen -

i have 2 background images: background.png (1920 x 1280) , background@2x.png (3840 x 2560). also, app works on landscape mode. at run time size of background image @ max. problem: try print console height , of background image using pinch gesture method on each print, both values remain @ 4001.999.. x 2668.0, though, size of background image gets resize while pinching in , out. what i'm trying accomplish is: access width , height of skspritenode containing background image can check if height equal of screen. if is, disables effect of pinch gesture of further zoom in. manage same effect zooming out. if can suggest better algorithm doing this, please, feel free share. thanks!! this code: // background backgroundnode = createbackground() self.addchild(backgroundnode) println("anchorpoint = \(self.anchorpoint)") } override func didmovetoview(view: skview) { let pinchrecognizer = uipinchgesturerecognizer(target: self, action: selector(...

Android plugin 1.3 error -

this error got when updated sdk , build tool android m android build tools found incompatible build tools , android plugin versions: * module 'app' using android plugin 1.2.3 , build tools 23.0.0 rc1 please use android plugin 1.3 or newer, or older build tools version. otherwise project won't build. when classpath 'com.android.tools.build:gradle:1.2.3' changed 1.3 i got error. error:could not find com.android.tools.build:gradle:1.3. searched in following locations: file:/applications/android studio.app/contents/gradle/m2repository/com/android/tools/build/gradle/1.3/gradle-1.3.pom file:/applications/android studio.app/contents/gradle/m2repository/com/android/tools/build/gradle/1.3/gradle-1.3.jar https://jcenter.bintray.com/com/android/tools/build/gradle/1.3/gradle-1.3.pom https://jcenter.bintray.com/com/android/tools/build/gradle/1.3/gradle-1.3.jar what should ? the because @ time android gradle plugin 1.3 had not been released...

javascript - Angular ng-repeat $index -

i'm creating list of items user can click go next picture. <ol class="indicators"> <li ng-repeat="img in pics" ng-click="slideto($index)"></li> </ol> this code works problem doesnt fill in $index in ngclick directive. resulting html: <li ng-repeat="img in pics" ng-click="slideto($index)" class="ng-scope"></li> if put $index in between {{ }}, work, error in console. resulting html: <li ng-repeat="img in pics" ng-click="slideto(0)" class="ng-scope"></li> error: error: [$parse:syntax] http://errors.angularjs.org/1.3.15/$parse/syntax?p0=%7b&p1=invalid%20key&p2=10&p3=slideto(%7b%7bnanndex%7d%7d)&p4=%7b%index%7d%7d i've seen examples of dont use curly brackets $index used in child element , not element itself. could tell me i'm doing wrong , when should use {{ }} when using angular expressions. ...

c# - Memory leak in MediaPlayer -

can please explain why following program runs out of memory? class program { private static void threadroutine() { system.windows.media.mediaplayer player = new system.windows.media.mediaplayer(); } static void main(string[] args) { thread athread; int iteration = 1; while (true) { athread = new thread(threadroutine); athread.start(); athread.join(); console.writeline("iteration: " + iteration++); } } } to fair, specific exception system.componentmodel.win32exception , "not enough storage available process command." exception happens on attempt create new mediaplayer. mediaplayer not implement idisposable interface i'm not sure if there other cleanup necessary. didn't find in mediaplayer documentation. my guess thread objects created aren't garbage collected in time. as stating in comment are out of luck resp...

clearcase - Allow Label Type Creation only within AdminVOB and Disallow in ClientVOB using Trigger -

i want have trigger within client vob disallow creation of label type [mklbtype]. label types must created within adminvob using mklbtype command -global , -acquire options. in client vob mklabel command used attach release label defined within adminvob. problem client vob trigger mklbtype gets invoked during mklabel operation in clientvob. how solve issue? may there clearcase_environment variable there check mklbtype trigger invocation during mklabel command. appreciated. another approach define pre-op trigger on mklabel, check if lbtype exists. if not, means mklbtype invoked, exit in error, denying mylabel command.

bootstrap grid xs becomes 18 columns not 12 columns -

<div class="row"> <div class="col-xs-12 col-sm-6 col-lg-8">.col-xs-12 .col-sm-6 .col-lg-8</div> <div class="col-xs-6 col-lg-4">.col-xs-6 .col-lg-4</div> i have read in bootstrap grid, grids should equal 12 columns totally. in bootstrap site in grid examples have mentioned above code.. col-xs-12 , col xs-6 equals becomes 18 not 12. please clarify confusion . the markup in question "correct", doesn't explain why. basically, if choose use more 12 columns, columns after initial 12 wrap onto next line. example: <div class="row"> <div class="col-xs-12">...</div> <div class="col-xs-6">...</div> </div> will produce similar result following: <div class="row"> <div class="col-xs-12">...</div> </div> <div class="row"> <div class="col-xs-6">...</div...

twitter - Cloudera Twiiter Hive Query failure -

team, curious know if succeeded in executing query twitter cloudera example? i added mentioned serde jar in beewax file resources jar, still getting error query. query: select t.retweeted_screen_name, sum(retweets) total_retweets, count(*) tweet_count (select retweeted_status.user.screen_name retweeted_screen_name, retweeted_status.text, max(retweet_count) retweets tweets group retweeted_status.user.screen_name, retweeted_status.text) t group t.retweeted_screen_name order total_retweets desc limit 10; your query has following error(s): error while processing statement: failed: execution error, return code 2 org.apache.hadoop.hive.ql.exec.mr.mapredtask info : number of reduce tasks not specified. estimated input data size: 1 info : in order change average load reducer (in bytes): info : set hive.exec.reducers.bytes.per.reducer= info : in order limit maximum number of reducers: info : set hive.exec.reducers.max= info : in order set constant number of reducers: info : se...

database - is it a good way to use 1-1 relationship in this case? -

i have database table ticket containing: [id, user_id, project_id, title, steps_to_reproduce_issue, expected_result, actual_result, additional_comments, ticket_attachment_id, status, priority, categories, date_created, date_modified] is way put following attributes [title, steps_to_reproduce_the_issue, expected result, actual_result, additional_comments] separate table ticketdescription, , use 1-1 relationship ticket-ticketdescription tables, , add ticket_description_id ticket ? i hope understood case. consider have 3 occasions of same show. (i.e. diffrent hours) - better reuse ticketdescription 3 occasions, right? so in point of view it's better use 1 many relation instead of declaring every time description. think distribution of fields.

c - Pass unsigned char pointer to atoi without cast -

on embedded device, have passed unsigned char pointer atoi without cast. unsigned char c[10]="12"; atoi(c); question: defined? i saw somewhere ok string functions, not sure atoi . edit: btw. concerns have been expressed on 1 of answer below might not ok string functions such strcpy - if got right (?) author meant can in practice can ok. also here, ok following assignment unsigned char pointer ok too? because used tool complaining "type mismatch (assignment) (ptrs signed/unsigned)" unsigned char *ptr = strtok(unscharbuff,"-"); // assignment ok unsigned char? no, it's not defined. it's constraint violation, requiring compile-time diagnostic. in practice it's very work expect, it's not guaranteed so, , imho it's poor style. the atoi function declared in <stdlib.h> as: int atoi(const char *nptr); you're passing unsigned char* argument function expects char* argument. 2 types not comp...

Java:Double Datatype Value Doesn't Give Exact Answer -

this question has answer here: how nicely format floating numbers string without unnecessary decimal 0? 20 answers i'm finding logarithm of value 1 equal 0 not 0.0. when user enter point values give exact answer. problem value not consist in points give answer of value in points.i try parsing , typecasting nothing happen.is there function in java can stop this. code. public class new { public static void main(string[] args) { scanner s = new scanner(system.in); double num = 0; double result; system.out.print("value:"); num = s.nextdouble(); result = math.log(num); system.out.print("answer:"+result); } } compiler output: value:1 answer:0.0 the 0.0 how double value representing 0 printed default. also, math.log method returns double . 0.0 equal number 0. logarithm, positive base, of 1 0. if you'd not print decim...

ruby on rails - ActiveRecord: How to find parents whose ALL children match a condition? -

suppose have parent model has many child , , child belongs otherparent . how can find parent of child belongs otherparent ? in pure sql parent.find_by_sql(<<sql) select * parents p not exists ( select * children parent_id = p.id , other_parent_id null ) sql (from here ), i'd prefer taking advantage of activerecord if possible. thanks! i'm using rails 4.2.1 , postgresql 9.3 using arel can pretty far. tricky part how not write entire query using arel 's own query syntax? here's trick: when building query using where , if use arel conditions, methods free. instance, can tail subquery have there .exists.not , (not ( exists (subquery))) toss parent's where -clause , you're set. the question is, how reference tables involved? need arel that. could use arel's where ugly conditions a.eq b . why? since it's equality condition, can use rails' conditions instead! can reference table you...

undefined - "ReferenceError: handler is not defined" in Node.js -

this first line of node.js app: var app = require('http').createserver(handler); when try start doing node index.js result is: /home/username/public_html/index.js:1 var app = require('http').createserver(handler); ^ referenceerror: handler not defined my node.js version 0.12.4 you that's first line of code. problem not define handler variable. should function responds request event. since optional, can (if wish) leave out entirely , add handlers events later on. var app = require('http').createserver();

jsf - @FacesComponent on shared library -

i'm trying use custom jsf component on websphere 8.5. component class annotated @facescomponent. the component on shared lib jar on server. have faces-config inside jar meta-inf folder. if jar inside ear file works expected, when on sharedlib gives me "undefined component type myuiactionlist" error. any ideas on how make work? web fragment jars belong in war/web-inf/lib , absolutely not in ear/lib nor server/lib . see a.o. chapter 8.1 of servlet 3.0 specification (emphasis mine): 8.1 annotations , pluggability in web application, classes using annotations have annotations processed only if located in web-inf/classes directory, or if packaged in jar file located in web-inf/lib within application. ... end of story.

svg - D3.js change x-axis path line style -

Image
in d3.js charts, x-axis line (black line between bars , bar labels) sort of looks default: |----------------|, see screenshot below: how change straight line (no vertical lines on either end)? looking @ generated svg, code seems determining style: <path class="domain" d="m0,6v0h824v6"></path> , auto-generated d3. thanks! this controlled axis.outerticksize() : an outer tick size of 0 suppresses square ends of domain path, instead producing straight line. all need set axis.outerticksize(0) .

android - Navigation Drawer not closing -

i have implemented navigationdrawer in android.i don't understand how close drawer when item drawer list selected.the foolowing code gives me null pointer exception. mainactivity: public class mainactivity extends actionbaractivity { string[] planet={"earth","mars","jupiter"}; listview lv; drawerlayout mdrawerlayout; navigationdrawerfragment navigationdrawerfragment; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); if(savedinstancestate==null){ earth earthfrag=new earth(); fragmentmanager fragmentmanager=getsupportfragmentmanager(); fragmenttransaction transaction=fragmentmanager.begintransaction(); transaction.add(r.id.mainactivity,earthfrag,"earth").commit(); } toolbar toolbar = (toolbar) findviewbyid(r.id.app_bar); setsuppor...

java - Delete one scanner, Payroll program Week 3 -

Image
this question has answer here: scanner issue when using nextline after nextxxx [duplicate] how able rid of 1 scanner? if use 1 scanner after weekly_pay output is: employee name enter hours worked week. the program skips right on asking employee name variable. both scanners indeed loop asking employee name should. //week 3 assignment package weeklypay2; import java.util.scanner; // importing java utility class scanner public class weeklypay2 // class weeklypay { //main method public static void main(string[] args) { scanner scanner = new scanner(system.in); scanner scanner1 = new scanner(system.in); string employee_name = null; // variable employee name double hours_worked = 0, // variable weekly hours worked pay_rate = 0, // variable pay rate per hour weekly_pay = 0; // weekly pay = hours * pay_rate while (employee_name!="stop"...

Cannot access empty property error in php -

i have text stored in table. want replace expressions : [%parameter_name] corresponding value stored in table. all parameters , in column must fetch value stored in third column. i tried make function put needed patterns , value in array. however, gives me fatal error. why? here code : $search = $db->prepare(" select * table id = ?"); $search->execute(array($id)); $search->setfetchmode(pdo::fetch_obj); while($result = $search->fetch()){ $search2 = $db->prepare(" select parameter_name, read_from pattern type = ?"); $search2->execute(array(strtolower($result->type))); $search2->setfetchmode(pdo::fetch_obj); while($pattern = $search2->fetch()){ array_push($patterns, '/\[%'.$result->type.'\.'.$pattern->parameter_name.'\]/i'); $column = explode(',', $pattern->rea...

php - Trying to strip li tags from get_archives_link -

i'm creating wordpress theme , using get_archives_link list archive info. get_archives_link default displays archive list wrapped around <li></li> tags below. <li><a href='http://localhost/blog/?m=201505'>may 2015</a></li> but displayed href instead following example: <a href='http://localhost/blog/?m=201505' class="list-group-item">may 2015</a> any ideas on how can around this? thanks! you can use preg_replace achieve this, see example below :- $anchorwithli = "<li><a href='http://localhost/blog/?m=201505'>may 2015</a></li>"; echo preg_replace('#<li>(<a)(.*)</li>#i', '$1 class="list-group-item" $2', $anchorwithli); output: <a class="list-group-item" href='http://localhost/blog/?m=201505'>may 2015</a>

Perl DBI - Set schema name as bind variable in query -

i'm writing script executes same merge statement across several different databases. tables names , columns same in each schema connecting to, schema names different. rather define 2 separate queries, prefer define 1 merge statement string schema name set '?', , pass in needed schema name during execution: my $hostgroup_merge = "merge ?.hostgroups .... "; and later: my $dev_schema = 'dev'; $prod_schema = 'prod'; #do merge in dev schema $dbh = dbi->connect($dev_server,$user,$pass); $sth = $dbh->prepare($hostgroup_merge); $sth->execute($dev_schema); $sth->finish(); $dbh->disconnect; #now same merge prod schema $dbh = dbi->connect($prod_server,$user,$pass); $sth = $dbh->prepare($hostgroup_merge); $sth->execute($prod_schema); $sth->finish(); $dbh->disconnect; this fails invalid table name error: dbd::oracle::st execute failed: ora-00903: invalid table name (dbd error: error possibly near <*> indicato...

ruby on rails - How do I create a new/create action for items? -

i working on rails assignment asks create list of items. created controller , model item, still having trouble. keep receiving following error: undefined method `items_path' here of code: class itemscontroller < applicationcontroller def new @item = item.new end def create @item = item.new(params.require(:item).permit(:name)) if @item.save flash[:notice] = "item saved." redirect_to @item else flash[:error] = "there error saving item. please try again." render :new end end end items model: class item < activerecord::base belongs_to :user end new.html.erb in items class item < activerecord::base belongs_to :user end routes.rb: rails.application.routes.draw devise_for :users resources :users resources :items, only: [:new, :create] end 'welcome/index' root :to => 'welcome#index' end item.html.erb <%= form_for @item |f| %> ...

YouTube API v3 - How to Identify Client Specific Video Uploads -

is there property associated video or playlistitem youtube entities identify videos uploaded via application (for example, associated application's name, clientid, apikey, etc.)? if not, suggestions track/tag videos uploaded via application using youtube api v3? not content in user's channels managed through application. background info: i've used video categories in previous versions of api identifying managed videos, in v3 video limited 1 category. didn't find address in v3 migration document, admittedly using categories have been hack learned v1 happened work in v2. using google apis client library .net in application. the "fordeveloper"(bool) property on search:list request looks solution in youtube api v3 going forward. see related question more detail: does youtube data api v3 support custom developer categories/tags (like in v2)? if has suggestion identifying content uploaded before api v3 i'm ears. application's uploaded ...

QlikView - adding a value to an average trendline -

Image
i have bar chart in qlikview , have added in average line properties > expressions > trendlines > average . i want display value of average, not sure how... hope enough information, please let me know if not! you can display "equation" trendline selecting "average" , checking box right marked "show equation": this results in small piece of text added chart follows:

java - Query Does not return results Sqlite -

try { class.forname("org.sqlite.jdbc"); connection connit = drivermanager.getconnection("jdbc:sqlite://c://users//asus//dropbox//projectdata.sqlite"); string query1= "insert email (subject,message) values(?,?)"; preparedstatement pst=connit.preparestatement(query1); pst.setstring(1, subject.gettext()); pst.setstring(2, message.gettext()); joptionpane.showmessagedialog(null, "message sent"); pst.executequery(); pst.close(); connit.close(); } catch (exception e) { e.printstacktrace(); } hey guys, know it's silly mistake can't seem find it. can understand want send data on table. please help. error squery not return results.

javascript - Place text on the radii extending from the center of a circle D3 -

i've got (using d3) circular arc have number of evenly spaced points on. need place text on radius extending through center of circle, through center of point on arc. so visualize, text @ unit circle position 0 not rotated. text @ unit circle position 90 degrees rotated 90 degrees. text @ -90 degrees rotated 90... etc. i have tried doing this. var labeltextupdate = this.svg .select('#nodes') .selectall('text') .data(circledata, function(d) { return d.id;}); var labeltextenter = labeltextupdate.enter() .append('text') .style('text-anchor', 'start') .attr('x', function(d) { return d.coords.x;}) .attr('y', function(d) { return d.coords.y;}) .attr('transform', function(d) { return 'rotate(' + d.angle + ')'; }) .text(function(d) { return d.type; }); labeltextupdate .transition().duration(400) .attr('x', function(d) { retu...

ejb - Unknown JNDI Lookup String -

i new ejb concept. have seen following in different website : sample 1: @stateless @ejb(name="audit", beaninterface=anotherejblocal.class) public class employeebean implements employeeservicelocal, employeeserviceremote { @persistencecontext(unitname = "employeeservice") private entitymanager manager; public void doaction(){ try { context ctx = new initialcontext(); anotherejblocal audit = (anotherejblocal) ctx.lookup("java:comp/env/audit"); audit.doanother(); } catch (namingexception e) { throw new ejbexception(e); } } } sample 2: public static void main(string[] a) throws exception { employeeserviceremote service = null; service = (employeeserviceremote) new initialcontext().lookup("employeebean/remote"); service.doaction(); } sample 3: obj = ctx.lookup(ejb/cbdwebappear/cbdwebapp.jar/<ejb name>/<remote interface class name>); cbdwebapp project name in be...

javascript - Get ID of Table Element and open a modal with data with same id -

hy, have following table bootstrap have data php select: <div class="table-responsive"> <table class="table table-bordered table-hover"> <tr> <th>nome</th> <th>cognome</th> <th>telefono</th> <th>e-mail</th> <th>azioni utente</th> <tr> <?php while($contatto = mysql_fetch_assoc($risultati)) { echo "<tr>"; echo "<td>" .$contatto['nome']. "</td>"; echo "<td>" .$contatto['cognome']. "</td>"; echo "<td>" .$contatto['telefono']. "</td>"; echo "<td>" .$contatto['email']. "...

Handling cross domain preflight AJAX OPTIONS requests with Spring MVC 4 -

this simple answer, can't seem work. in cross-domain, preflight ajax request, client first makes options request set of headers figure out remote server accepts. right now, every spring controller post interface create, have create options interface, this: @requestmapping(method = requestmethod.options, value = "/addwebservice") public responseentity addwebserviceoptions() { return new responseentity(httpstatus.no_content); } @requestmapping(method = requestmethod.post, value = "/addwebservice") public ajaxresponse<webservice> addwebservice(principal principal, @requestbody webservice webservice) throws userserviceexception { ... } i read somewhere can make 1 simple method doesn't have mapping specific path handle options requests, this: @requestmapping(method = requestmethod.options) public responseentity handle() { return new responseentity(httpstatus.no_content); } however, when add method, every ...

c# - Refresh an open form from another open form -

i want refresh opened form ( form1 ) opened form's ( form2 ) button_click(). in form1 display data saved form2 , when form1 opened want refresh if new data saved on form2 in order display it. the problem i've tried iterating through `application.openforms`, turns out read-only , cannot access form once found , don't know how access *form1* *form2*, since can't find it. how can access *form1* *form2*? edit: form1 opened form2. the problem application.openforms , i've stated, read-only list of forms opened , cant access forms through it. don't have methods it, sugest try using application.openforms , if don't know how works. it's pointless show i've tried because includes application.openforms , sake of information: formcollection of = application.openforms; foreach (var f in of) { if (f.gettype().tostring() == "kontrl_doc.visualizar") { ...

javascript - How JQuery objects assigned to a variable detect changes? -

(first of sorry english) can understand assigning jquery objects found jquery selectors, variable has better performance using jquery selectors every time. part cannot understand how jquery detects changes not manipulated jquery? here example: <div id="divstate">first state</div> $(document).ready(function () { var testelement = $("#divstate"); alert(testelement.text());//alerts "first state". document.getelementbyid("divstate").innerhtml = "second state";//div has changed outside of jquery object. alert(testelement.text());//alerts "second state"??? how variable detects changes. }); as understand it, jquery object contains dom node, live object. changing properties of dom node reflected in jquery object. if .clone() jquery object, you'd behavior you're expecting: $(document).ready(function() { var testelement = $("#divstate").clone(); // copy object...

ios - How can I get the "row" from indexPathsForSelectedRows? -

i trying "row" value indexpathsforselectedrows. nsarray *selectedcells = [self.storetableview indexpathsforselectedrows]; nslog(@"%@",[selectedcells objectatindex:0]); this nslog prints out <nsindexpath: 0xc000000000008016> {length = 2, path = 0 - 4} how can number '4' integer in example? i've tried objectforkey@"path". did not work. you can do nsarray *selectedcells = [self.storetableview indexpathsforselectedrows]; nsindexpath *firstindexpath = [selectedcells objectatindex:0]; nsuinteger row = firstindexpath.row and row 4 in case.

excel - If cell = #N/A, use another vlookup -

i have excel vba macro runs well sub pcmslookuptool() dim lastrow long sheets("lookup tools") '<-set worksheet reference lastrow = .range("a" & cells.rows.count).end(xlup).row .range("j10:j" & lastrow) .formula = "=vlookup(a10, 'pcms-dump'!a:b, 2, false)" .cells = .value2 end end end sub but need make if not find value (returns #n/a) run vlookup ("=vlookup(a10, 'imported in pcms'!a:c, 3, false)" how go this? what need iferror statement: .formula = "=iferror(vlookup(a10, 'pcms-dump'!a:b, 2, false),(vlookup(a10, 'imported in pcms'!a:c, 3, false)))"

Kernel memory dump size Linux -

i know size of kernel memory dumps depends on amount of kernel memory allocated , drivers loaded. on systems more ram, reasonable expect dump file larger. limit of kernel dumps? yes, reasonable unless you're getting dump in boot process. otherwise dump of whole physical memory used. linux kernel uses memory available (if it's not needed else, use cache) dumps larger.

java - Array vs. ArrayList - Why would you use one over the other? -

this question has answer here: benefits of arrays 9 answers so understand arraylist has variable length unlike array, of advantages of using 1 on other? array takes less space , typically faster, arraylist lets add , remove elements array (can useful lot of reasons).

JQUERY EasyUI - $.messager.alert position -

i using easyui messager.alert control. is there way show $.messager.alert on top center of screen? $.messager.alert({ title: title, msg: message, icon: 'info', width: 550, }) use style option on messager. see here: message box position example $.messager.show({ title:'my title', msg:'the message content', showtype:'slide', style:{ right:'', top:document.body.scrolltop+document.documentelement.scrolltop, bottom:'' } }); or in case of specific example: $.messager.alert({ title: title, msg: message, icon: 'info', width: 550, style:{ right:'', top:document.body.scrolltop+document.documentelement.scrolltop, bottom:'' } })

gmail - Apps Script GmailApp archiving not working -

i have function wish tie daily time trigger in google apps script. function supposed take e-mails in inbox marked read older 14 days , archive them. here code, got here function batcharchivea() { var batchsize = 100 // process 100 threads @ once var threads = gmailapp.search('label:"inbox" is:read older_than:14d -label:"delete me"'); (j = 0; j < threads.length; j+=batchsize) { logger.log("thread " + j); gmailapp.movethreadstoarchive(threads.slice(j, j+batchsize)); } } i have run function manually test out few times. however, none of changes seem reflected when open inbox in gmail. still have 890+ e-mails in inbox dating 2012 (plus more under promotion, update etc. sub-labels) thing is, execution output reported no errors, , see lot of threads being loaded , dealt in loop. however, when run script, there no threads loaded. search returns empty array , function exits. i'm curious doing wrong. i've looked @ goog...

How do I create a local database inside of Microsoft SQL Server 2014? -

forgive me if question asked before. i installed microsoft sql server management studio 2014. want create database can start building tables scratch. getting ability connect database. not create new database. as per comments, first need install instance of sql server if don't have 1 - https://msdn.microsoft.com/en-us/library/ms143219.aspx once installed must connect instance (server) , can create database here - https://msdn.microsoft.com/en-us/library/ms186312.aspx

angularjs - Ionic $state.go not working on device -

i'm working on app, build using ionic. problem $state.go working in browser not on phone. seem common problem, after reading lot of answers same questions, still can't figure out how fix it. the general fix seems to ensure you're using relative urls explained here: using angular ui-router phonegap still can't work. missing? link plunker: http://plnkr.co/edit/qfj1ld6bhkvkmksmyqc8?p=preview app.js structure: .... $stateprovider .state('parent', { url: "/", templateurl: "parent.html" }) .state('parent.child', { url: "child", templateurl: "child.html" }) $urlrouterprovider.otherwise("/") }) .... for state.go work have inject $state dependency controller app.controller('parentctrl', ['$scope', '$state', function($scope, $state) { $scope.$state = $state }]); app.controller('menuctrl', ['$...

node.js - express server unresponsive after 5 POST's -

Image
i using express serve single page webapp, , rest endpoint said app. works fine static page serving, after 5 posts server becomes unresponsive. have seen lot of other posts problem make sure call res.send() or res.end() in every call somewhere, regardless of how logic branches. app.js code below. /** * module dependencies. */ var express = require('express'), http = require('http'), path = require('path'); var app = express(); var auth = require("./controllers/authentication.js"); http.globalagent.maxsockets = 100; app.configure(function(){ app.set('port', process.env.port || 3000); app.use(express.logger('dev')); app.use(express.bodyparser()); app.use(app.router); }); app.configure('development', function(){ app.use(express.errorhandler()); }); app.get('/', function(req, res) { res.sendfile('./public/index.html'); }); app.get('/public/*', function(req, res) { r...

SQL Query to Relational Algebra -

i have query: select distinct a.aanbieding_id aankoop 2 <= (select count(*) aankoop a.aanbieding_id = aankoop.aanbieding_id) order aanbieding_id and wanne make relational algebra scheme of query, solution is: πid(f(count)(aanbieding_id)>=2(aankoop)) but i'm pretty sure wrong, can me please

what is the use of angular.bind in angularjs? Where to use it? -

what use of angular.bind in angularjs. please provide example. cant understand https://docs.angularjs.org/api/ng/function/angular.bind angular.bind utility function combines functionality in function.bind , partial function application . binding (in general) idea want bind current context function, execute @ later time. this can useful in angular when making http calls $http , handling promises: $http.get('url').then(angular.bind(this, function(response) { this.response = response; //use (which bound context) }); in above example, this inside function not refer this in $http context unless explicitly bind it. common javascript issue (in callbacks) because of dynamic binding of context (which unlike popular class-oriented languages). partial application used when want make function has been passed some of arguments. simple example: function add(x, y) { return x + y; } var add10to = angular.bind(this, add, 10); conso...

java - Cant refresh the shown JTable after inserts -

Image
i have problem. i'm pretty new java , @ moment try learn basic stuff. so created little gui textfield vor input , button fire query database query (that contain input variable). i filled resultset result of query , want display result in jtable . tryed this: public class appwindow extends jframe { private resultset rs = null; jtextfield textfield_where_1; jtextfield textfield_where_2; jtable tabellenspass; jbutton button; public appwindow() { this.getcontentpane().setlayout(null); this.initwindow(); protected void initwindow() { // instanzieren: textfield_where_1 = new jtextfield(); textfield_where_2 = new jtextfield(); tabellenspass = new jtable(); button = new jbutton("muh"); button.addactionlistener(new actionlistener() { public void actionperformed(actionevent arg0) { try { abfrage(); ...

php - Wordpress - Retrieve IMG's from the_content and clean it -

i'm trying build function wordpress website, retrive img's the_content, , clean bunch of operations: removing class (you know, e.g. class="alignnone size-full wp-image-707") replacing alt post's title + number avoid duplicate alts indenting match clean-code-obssession when echo the_content, call 'clean_image_set' function: add_filter("the_content", "clean_image_set"); the_content(); the function looks this: function clean_image_set($html) { $html = preg_replace( '/(class=")(.*?)(")/i', "class=\"img\"", $html ); $post_title = get_the_title(); $html = preg_replace( '/(alt=")(.*?)(")/i', '$1'.esc_attr( $post_title ).'$3', $html ); // replace alt post title return $html; } i think should use preg_match_all put imgs array , use loop put number in alt , add indentation, can't manage it. any thought? lot!

Android Fingerprint Scanning using Samsung device -

am looking write app store fingerprint of people using & later use authenticate them. now, app placed in public place, , there thousands of users. so, need store many fingerprints. tried simple app samsung pass sdk , , samsung tablet fingerprint recognition built in. worked, looks restricting 3 fingerprints only. so, maximum of 3 fingerprints can saved & authenticated with, see. true? possible save thousands of fingerprints & use them in app? or there other company (other samsung) offers capability? afaik, problem (totally intentional) limitation manufacturer (such samsung, apple...). have done job: prevent biometric data doesn't leave phone. simple that. don't know if there "illegal" method retrieve data work freely it. maybe can try approach: small device linux (such raspberry pi if don't mind desktop speed) usb fingerprint reader attached

c# - IS vs. AS vs. IsAssignableFrom - What are the differences when checking for objectTypes and Interfaces? -

i'm sort of new c# , wondering if me out. the scenario: public bool objectimplementsspecificinterface (object obj) { // 1. if (obj iexampleinterface) { return true; } // 2. var tmp = obj iexampleinterface; if (tmp != null) { return true; } // 3. if (typeof(iexampleinterface).isassignablefrom (obj.gettype ())) { return true; } } the goal: determine wether object o implements given interface-definition iexampleinterface or not. the questions: which implementation best practice? disregarding first question, 1 technically correct? what specific differences in operators? msdnaa isn't detailed on them. which call takes longest / shortest? var impinterface = obj isampleinterface; what mean "technically" ? work. if want ois know whether implments interface, that's is for. if want new variable cast interface, use as . is determines if object derives type ,...

cmd - "runas" command executes successfully but desired output is not achieved -

i executing runas command in cmd create new user administrator , executing without giving errors user not getting created. the command using runas /user:administrator "cmd /c net user /add username password" your /user:administrator argument has wrong format. it should in form: /user:<administratoraccountname>@<computername> /user:<computername>\<administratoraccountname> /user:<administratoraccountname>@<domainname> /user:<domainname>\<administratoraccountname> source runas - execute program under different user account syntax ... runas [ [/noprofile | /profile] [/env] [/savecred] ] /smartcard [/user:username] program ... key ... /user username in form user@domain or domain\user ... example runas /env /user:ss64dom\jdoe "mmc %windir%\system32\dsa.msc" see technet runas more information. "i tried runas /profile /user:yogi\administrator ...

java - How can I use a Maven project as a dependency to another Maven project? -

i'm new maven, therefore, sorry in advance if question general. have maven project, call projecta , resides in company's mercurial repository (let's call https://hg.mycompany.com/niceprojects/ ). recently, built separate maven project, call projectb in same repository. want use in projectb classes have in projecta . directory structure in repository currently: -----niceprojects | |__projecta | |__pom.xml | |__projectb |__pom.xml what neat way of doing this? avoid manually building projecta , adding jars in projectb . keep same directory structure. step-by-step instructions appreciated. many thanks! a general advice when using maven use maven repository manager such nexus. in case nexus has addtional benefit can host jars. so advice following: configure ci (e.g. jenkins) job build projecta , deploy jar nexus instance declare projecta dependency in projectb when building projectb, can download p...

Call mySQL procedure c# -

i have procedure, works in mysql workbench: create definer=`root`@`localhost` procedure `dane dla stacji`(in naz varchar(100)) begin select stacje.nazwa, parametry.nazwa, wyniki_pomiarow.wartosc, wyniki_pomiarow.data srodowisko.stacje, srodowisko.parametry, srodowisko.wyniki_pomiarow stacje.nazwa=naz , stacje.idstacji = wyniki_pomiarow.idstacji , parametry.idparametru = wyniki_pomiarow.idparametru; end now call in c# , display in datagrid. wrote that: public void display(string zapytanie_sql) { mcon = new mysqlconnection("datasource=localhost;port=3306;username=root;password=***"); mcon.open();; mda = new mysqldataadapter(zapytanie_sql, mcon); ds = new dataset(); mda.fill(ds, "stacje"); } public void docommand(string komenda_sql) { mcon = new mysqlconnection("datasource=localhost;port=3306;username=root;password=***...

Laravel 4.2 - PHP Error reporting turned off -

my laravel 4.2 application runs happily undefined variables or array indexes. i have placed ini_set('display_errors',1); error_reporting(e_all|e_strict); in many places in code in attempt happen. the php.ini contains error_reporting = e_all debugging true in app.php. i have grep'd of laravel , vendor code , code locations error reporting may have been turned off, none seems relevant. non-laravel web applications on same server crash and/or report these kinds of errors. php 5.6.8 on fedora , 5.5. on centos. why not see notices, warnings? level of error, php should throwing exceptions on undefined variables , array element accesses. e.g. $object['member'] array "$object" has no key "member" should cause error.

Adding the correct parameters to REST Request using RestSharp in C# -

i trying generate correct parameters using restsharp somehow either internal server error (500) or not acceptable (406) when making request. have made request using google chrome extension postman when using raw json format. looking way convert raw json format use restsharp service in c#. here raw json works. { "clitemplatecommand" : { "targetdevices" : { "targetdevice" : { "targetdeviceid" : "123", "variablevalues" : { "variablevalue" : { "name" : "interface", "value" : "gigabitethernet101/1/0/22" } } } }, "templatename" : "studentconfig" } } is there can me convert can feed request using restsharp. here code snippet using try accomplish this: request.requestformat = dataformat.json; request.addheader("authorization", "basic ...

c# - Datatable Comparison of - primary keys is not working -

i have written code block compares datatable scheme differences. this code: private static void validateschema(datatable originaltbl, datatable othertbl) { var primarykeydoesnotmatch = originaltbl.primarykey != othertbl.primarykey; if(primarykeydoesnotmatch) { throw new argumentexception("primary key not match"); } var primarykeydoesnotexist = originaltbl.primarykey == null; if(primarykeydoesnotexist) { throw new argumentexception("primary key not exist"); } var othertablehasadditionalcolumns = (from x in othertbl.columns.oftype<datacolumn>() !originaltbl.columns.oftype<datacolumn>().any(y => y.columnname == x.columnname) select x).any(); if (othertablehasadditionalcolumns) { throw new argumentexception("other table have additional columns."); } var columnsaremissinginother...