Posts

Showing posts from January, 2012

ios7 - clear text UISearchBar -

i have uisearchbar odd behaviour (ios 7). these steps take: 1) search , select result table. 2) clear search text code (either line) -(void) tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { [[[self searchdisplaycontroller] searchbar] settext:nil]; [[[self searchdisplaycontroller] searchbar] settext:@""]; //other stuff } 3) second search. no results shown unless first hit "clear button" inside search field. after hitting "x", behaviour returns normal. how supposed clear search string after user selects 1 of search results?

javascript - Node script doesn't ever end -

i have node script below copy contents of files , insert them mongo. the script never seems end , though data gets inserted successfully, have ctrl+c kill it. is there i'm supposed use in node.js end script? var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/testdb'); var dir = './seeds'; var db = mongoose.connection; // show connection error if there 1 db.on('error', console.error.bind(console, 'database connection error:')); // if connected mongo db.once('open', function callback() { var fs = require('fs'); // used files in directory // read files in folder fs.readdir(dir, function(err, list) { // log error if went wrong if(err) { console.log('error: '+err); } // every file in list list.foreach(function(file) { // set filename without extension variable collection_name var collection_name =

WPF get ListView height in C# when Window Size is changed -

i have following question: have layout grid , listviews. these listviews contain 5 items. these items should fill complete height of listview. thought height of listview devide 5 , set height of each row result. listview.height property returns strange values. listen window sizechanged event. hope can tell me how it, or if there better alternative. <window x:class="kalenderdesingtest.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="kalender" height="600" width="800" sizechanged="window_sizechanged"> <grid> <grid.resources> <style targettype="{x:type listviewitem}"> <style.setters> <setter property="template"> <setter.val

wav - pause() from audio library not working in r project -

after using play() function sound plays continuously. how stop it. code below shows used pause() function gives me error message, i've tried using close() function. > pause(saw) error in usemethod("pause") : no applicable method 'pause' applied object of class "c('wave', 'wavegeneral')" i guess use these 2 different packages: tuner import wave file audio for playback functions unfortunately these packages each have own object classes: wave class in tuner , audiosample class in audio . if want use playback functions of audio first need object of class audiosample . can importing wave file audio's own import function mywav <- load.wave("myaudiosample.wav") but since tuner can import mp3 files , has more import options may necessary create own audiosample object manually wave object. simple mono file example converted following way: mywave <- readwave("myaudiosample.wav&qu

python - project nested columns in mongodb -

i have collection in mongo data looks this: { "myinput": "myinput", "myoutput": { "result": { "crossdata": { "crossdto": [ { "col1": "11", "col2": "12", }, { "col1": "21", "col2": "22", }, { "col1": "31", "col2": "32", } ], "reqpartnumber": "myinput" } }, "status": { "code": "0", "message": "successful operation", "success": &qu

java - Having problems with the recursion -

my goal program have bullseye colors switch , forth. colors not switch makes new colors instead. more pressing problem when try repeat in way. screen comes when program ran blank , nothing. when there no loop bullseye comes up. import java.awt.color; import java.awt.graphics; import java.util.random; import javax.swing.jpanel; public class bullseye extends jpanel { public void paintcomponent( graphics g ) { super.paintcomponent( g ); random rand = new random(); int top = 2; int r = rand.nextint(256); int b = rand.nextint(256); int h = rand.nextint(256); int t = rand.nextint(256); int u = rand.nextint(256); int v = rand.nextint(256); color randomcolor = new color(r, h, b); color randcolor = new color(t,u,v); //sets colors first bullseye g.setcolor(randomcolor); g.filloval( 10, 10, 200, 200 ); g.setcolor(randcolor); g.filloval( 35, 35, 150, 150 ); g.setcolor(randomcolor); g.filloval(60, 60,

SQL Subquery - return specific result -

edited: changes: reworded more ask question problem: trying update data. complications: the table updating is: p_far_sbxd.t_claim_service_typ_dim inner joining table table (p_far_stg_vw.v_claim_60_policy_stg) see missing in first table. i updating 2 fields. 1: coverage type code, found in second table. , 2: coverage type description found in lookup table, based on coverage type code the problem running updating description. code easy enough. example. m = cancer, f = ltc, etc. here logic: if row has code of m, looked table , field description populated correct description. query select p_far_sbxd.t_claim_service_typ_dim.*, p_far_stg_vw.v_claim_60_policy_stg.coverage_typ_cde stg_ctc, (select distinct p_far_cr_vw.v_rule_translation_element.translated_value_txt, p_far_cr_vw.v_rule_translation_element.input_value_txt p_far_cr_vw.v_rule_translation_element p_far_cr_vw.v_rule_translation_eleme

jquery - Jssor Slider: How to target specific slide with text/image link? -

can tell me how target particular slide using simple text/image link? specifically, using jssor slider cluster ( http://www.jssor.com/demos/slider-cluster.html ). currently slides can navigated using bullet navigator , arrow navigator in standard dimension and/or spaced equally apart. attempting create own links have different sizes/lengths. thank in advance. there 2 ways, 1. use api call play specified slide. jssor_slider1.$playto(2); //or jssor_slider1.$goto(2); 2. customize thumbnail navigator own format. please see 12 thumbnail navigator skins in package. note can compose thumbnail in format (html, text, image or combination)

java - While(rs.next()) not executing -

sorry code large. problem rs.next not seem execute @ because system.out.println("//////////////////////////////////"); not print anything. string temp2; temp2 = ""; //initialise variable system.out.println("*************************************************"); try { string filename = "database.mdb"; string database = "jdbc:odbc:driver={microsoft access driver (*.mdb)};dbq="; database += filename.trim() + ";driverid=22;readonly=false"; conn = drivermanager.getconnection(database, "", ""); for(int id = 1; id < 16; id++)//will repeat 15 times (for each player) { for(int x = 1; x < 18; x++)//will repeat 18 times (once each team fixture) { statement sta2 = conn.createstatement(); resultset rs2 = sta2.executequery("select * tblplayers playerid = "+ playerid +" , fixturenumb

c# - Calling Method only once from a Threading.Timer -

i have system.threading.timer fires (let's every second simplicity), in callback need call action (which passed in via constructor, sits in class) within processing (let's takes 2+ seconds), how prevent processing logic being called multiple times? seems lock() doesn't work within action call? i using .net 3.5. public testoperation(action callbackmethod) { this.timer = new system.threading.timer(timer_elapsed, callbackmethod, timerinterval, timeout.infinite); } private void timer_elapsed(object state) { action callback = (action) state; if (callback != null) { callback(); } } // example of callback, in class. private void callbackmethod() { // how can stop running every 1 second? lock() doesn't seem work here thread.sleep(2000); } thanks! there's nothing pretty having solve problem. note using lock bad idea, make threadpool explode when callback consistently takes time. happens when machine gets loaded. us

formula - SINGLEVALUEQUERY and MULTIVALUEQUERY with Pentaho Report Designer -

i have multiple data sets drive pentaho report. data derived handful of stored procedures. need access multiple data sources within report without using sub reports , believe best solution create open formulas. singlevaluequery believe return first column or row. need return multiple columns. as example here stored procedure named header in pentaho (call stored_procedure_test (2014, header)), returns 3 values - header_1, header_2, header_3. i'm uncertain of correct syntax return 3 values open formula. below tried unsuccessful. =multivaluequery("header";?;?) the second parameter denotes column contains result. if dont give column name here, reporting engine take first column of result. in case of multivaluequery function, various values of result set aggregated array of values suitable passed multi-select parameter or used in in clause in sql data-factory. for more details see https://www.on-reporting.com/blog/using-queries-in-formulas-in-pentah

php - Facebook API not returning message_tags to application -

i have created application using facebook api. application plan on getting user feed of authenticated users. have set extended permissions read_stream know that's not problem. have checked in graph explorer running following query: /me/feed?fields=id,message,message_tags,likes.fields(id,name),created_time,shares,from&limit=3000 when run above query in graph explorer returns request fine when run following query php sdk in application doesn't return message_tags here query: $user_feed = $facebook->api("/{$user['userid']}/feed?fields=id,message,message_tags,likes.fields(id,name),created_time,shares,from&limit=3000&access_token={$user['accesstoken']}"); and yes have valid accesstoken , userid, because when put query in graph explorer return should. so, question why isn't being returned when query application? thanks. ps: have 1 file authenticating user app , file using userid , accesstoken data of user ... above pro

c# - Setting Property Doesn't Set Its Inner Property -

i took address: http://csharpindepth.com/articles/chapter8/propertiesmatter.aspx , reason not head around it. can explain me why console.writeline(holder.property.value); outputs 0. void main() { mutablestructholder holder = new mutablestructholder(); holder.field.setvalue(10); holder.property.setvalue(10); console.writeline(holder.field.value); // outputs 10 console.writeline(holder.property.value); // outputs 0 } struct mutablestruct { public int value { get; set; } public void setvalue(int newvalue) { value = newvalue; } } class mutablestructholder { public mutablestruct field; public mutablestruct property { get; set; } } class mutablestructholder { public mutablestruct field; public mutablestruct property { get; set; } } is equivalent class mutablestructholder { public mutablestruct field; private mutablestruct _property; public mutablestruct property { { return _property; }

c++ - CMake: The C compiler identification is unknown -

i trying build project cmake 2.8.12 visual studio 10 in 32bit architecture. getting these error , cmake unable create project. can please suggest me solution. thanks. this error showing in cmake-gui window: cmake error @ c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/cmakedeterminecompilerid.cmake:446 (execute_process): execute_process given command argument no value. call stack (most recent call first): c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/cmakedeterminecompilerid.cmake:48 (cmake_determine_compiler_id_vendor) c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/cmakedetermineccompiler.cmake:131 (cmake_determine_compiler_id) cmakelists.txt:3 (project) c compiler identification unknown cmake error @ c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/cmakedeterminecompilerid.cmake:446 (execute_process): execute_process given command argument no value. call stack (most recent call first): c:/program files (x86)/cmake 2.8/share/

django - "python manage.py syncdb" not creating tables -

i first ran python manage.py syncdb and created database , tables me, tried add more apps, , here's did: create apps by python manage.py startapp newapp then added 'newapp' installed_apps in setting.py: installed_apps = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'newapp', ) at last ran syncdb : python manage.py syncdb and here's result get: creating tables ... installing custom sql ... installing indexes ... installed 0 object(s) 0 fixture(s) i checked db , there no table named newapp , no table's name including newapp . if run: python manage.py inspectdb > somefile.txt you can check out if database structure matching django models.

java - JavaFX8 Accordion animation low framerate -

i'm using accordion-control contains 2 titledpanes. in first pane there spreadsheet-view controlsfx , in second there standard tableview containing custom controls. when open or close second titledpane (with tableview) animation's framerate low. other one's performance okay. fix animation's performance?

javascript - How to use LIMIT and OFFSET for pagination in MYSQL? -

by code can able retrieve first 5 records database. but need display remaining 5 rows database after pressing pagination arrow. doing 1 video sharing website same youtube. <?php include "config.php"; $q = mysql_query("select * register r join videos v on r.id = v.video_id order r.id limit 5") or die (mysql_error()); $headers = $col = ""; $row=mysql_num_rows($q); $s=null; echo "<h1> top videos </h1>"; while ($row = mysql_fetch_array($q)) { if($row['id']!=$s) { $s = $row['id']; echo "<div class='property'>"; echo "<div class='property1' >"; echo "<a href='#'><video src=\"".$row['path']."\" height='100' width='170' style= margin:5px; controls='controls'></video></a>"; echo "</div>"; echo "<div class='p

Covariance with C# -

i met interesting covariance problem in c# code. i have generic matrix<t> class, , it's been instantiated example matrix<int> , matrix<object> , matrix<apple> . for business logic, i've wrapped them generic wrapper<t> . wrapper implements non-generic inongenericwrapper interface. so, have wrapper<int> , wrapper<object> , wrapper<apple> . my problem is: define container 3 wrapper s. can't list<wrapper<object>> , because can't insert wrapper<int> collection. can't list<inongenericwrapper> , because inside foreach, access generic matrix<t> parameter. cheesy part: wrappers (de-)serialized definite type: myserializer<wrapper<apple>>.serialize(_myinstanceofwrappedapple) . i think it's clear avoid huge switches of typeof when serializing.. what possible workarounds? i'm kinda stuck. thanks in advance, recently i've come across such limit

javascript - HTTP Live Streaming detection on mobiles -

i want detect if mobile phone/tablet can play http live streaming (m3u8). i'm testing script: function ishlsenabled() { var videoelement = document.createelement('video'), canplayappmpeg = videoelement.canplaytype('application/x-mpegurl'), canplayapplempeg = videoelement.canplaytype('vnd.apple.mpegurl'); return ( (canplayappmpeg == 'probably' || canplayappmpeg == 'maybe') || (canplayapplempeg == 'probably' || canplayapplempeg == 'maybe') ); } but doesn't work on samsung browsers (stock, dolphin, etc) - returns false (because canplaytypes empty strings) able play video. are there bulletproof(ish) solutions detecting kind of streaming support? i not sure if there bulletproof solution available @ point. using video element's canplaytype method thing 'works'. there around +/- 5/6 media formats have oke support modern browsers. so create list of

jquery - Changing textContent using javascript, Cushy CMS -

ok, i'm going bad rep here asking many questions. have javascript dynamically changes content on page. works fine. issue need able tag text 'class="cushycms"' in order allow access site owner easy content changes. here basic code script, there more 1 set give idea of i'm doing. tried adding class tag inside innerhtml, cushy couldn't see it. <script language="javascript" type="text/javascript"> function changetext(idelement) { if(idelement==0){ document.getelementbyid('tagmain').innerhtml ='<class="cushycms">default text display on page load.'; document.getelementbyid('tagtext').innerhtml ='<class="cushycms">more default body text on page load.'; } </script> i looking way put these text fields in hidden div , pull textcontent there. example of section works cushy <h2 class="cushycms">preventative maintanence</h2

java - How to go back to steps in a program? -

i have bank account program rewriting when wrote in school , wondering how go step within program. so, after create account, , choose option withdrawl, go , prompt option once again, how done? (see comment in code) thanks.. main class: import java.text.*; public class bankaccounttest { public static void main (string args[]){ numberformat formatter = numberformat.getnumberinstance(); formatter.setmaximumfractiondigits(2); // helps formatter format final output formatter.setminimumfractiondigits(2); consolereader console = new consolereader(system.in); system.out.println("hello, make new bank account?"); string newa = console.readline(); if(newa.equalsignorecase("yes")){ system.out.println("how deposit initially?"); double init = console.readdouble(); bankaccount account = new bankaccount(init); system.out.println("your account created,

Google Analytics medium : "banner" and "Banner" (not in the same channel group) -

Image
i'm exploring google analytics features , i've noticed surprising. unless i'm mistaken, banner medium associated default system channel group display , although banner medium associated ground (other) . according default channel definitions , display group use regex ^(display|cpm|banner)$ the filters on regex seems case-insensitive(as explained here ). result, when try data google analytics api when filter ga:medium=~^(display|cpm|banner)$,ga:addistributionnetwork==content;ga:adformat!=text , results both "banner" , "banner" medium. however, when check on google analytics website, banner medium in display group, , banner in (other) group. could please confirm me point (and explain if possible :)) ? thanks lot ! banner being placed under (other) because capitalized. can create filter convert campaign parameters lowercase. to this: create new filter > select "custom filter" select lowercase filter and dr

c - Allocating memory using malloc in a function, segmentation fault -

i trying run following program, in dynamically allocate memory variable using function called reserve. when run application, segmentation fault because of allocating memory in separate function empty pointer, if want allocate memory in main, don't error. doing wrong? here code: #include <stdlib.h> #include <stdio.h> #include <string.h> typedef struct{ unsigned char state; /* socket fd of client */ int fd; /* file path requested client */ char file_path [255]; /* current file offset */ unsigned long int offset; } state; void reserve(int length, void *context_data ,void *buffer) { context_data = (char *) malloc(length); memcpy(context_data, buffer, length); } int main() { state test; int length = sizeof(state); char buffer[1500]; char *ptr = buffer; test.state = 10; strcpy(test.file_path, "hello how you"); memcpy(ptr, &test, length); ptr += length; char *context_data; reserve(length, c

java - how to sove chinese garbled with ajax request in jquery.validate.js remote function -

example:name = 资源 rules: { name: { required: true, remote: { url: location.href.substring(0,location.href.lastindexof('/'))+"/resourcename/check/exists", datatype: "text", beforesend: function(req) { req.setrequestheader ("contenttype", "text / html; charset = uft-8"); }, type: "get" } }, url: { required: true, url: true }, menu_id: "required" } in controller got name èµæº ,how can solve problem? @requestmapping(value = "/resourcename/check/exists", method = requestmethod.get) public void isresourcenameexists(httpservletresponse response, @requestparam(value = "name", required = false) string name) throws ioexception { name

java - Object in arraylist printing null -

i'm trying make diary stores list of diary entries (diary) each title, date , entry. these added, deleted , displayed diarybook class. right i'm trying test printing out fields printing null. i've looked through similar questions , still can't work out why. i'm new java help/comments appreciated. public class diarybook { arraylist<diary> diarylist = new arraylist<diary>(); static scanner scanner = new scanner(system.in); public void adddiary () { string title; string content; calendar date; string[] splitdate; system.out.print("entry title: "); title = scanner.nextline(); system.out.print("entry date (dd/mm/yyyy): "); splitdate = scanner.next().split("/"); scanner.nextline(); int day = integer.parseint(splitdate[0]); int month = integer.parseint(splitdate[1]); int year = integer.parseint(splitdate[2]); date = new gregoriancalendar(year,month-1,day); syste

ios - Camera Overlay View on Just Capture Section -

Image
i trying add cameraoverlayview on uiimagepickercontroller , want overlay cover part of screen shows captured camera, not "cancel" button, take photo button, flash settings, or that. how can dynamically determine frame of uiimageview of overlay should be? i've attached image illustrate section i'm talking about. you can use avcamcapturemanager overlay cover part of screen shows captured camera , not buttons

html - No word break in two floating divs -

Image
<table class="project-table"> <thead> <tr class="align-top"> <td class="short-col heading">project name</td> <td class="short-col heading align-center">project id</td> <td class="short-col heading">date &amp; time</td> <td class="short-col heading">student</td> </tr> </thead> <tbody> <tr class="bottom-row-dashed"> <td class="long-col"> <div class="achievement-box float-left">winner</div> <div class="float-left margin-left">intrusion detection system in cloud architecture</div> <div class="clear"></div>

sql server - MSSQL 2005 Request Mode is S and Request Type is Lock -

my problem database.i use mssql 2005 , management studio. can see blocked processes using activity monitor , there see list of blocked processes. killed process blocked using process_id time process being blocked. killing blocking continues loop. blocked process' attirubites request mode=s request type=lock , request status=grand. theere me this? first of all, if request granted, not blocked; blocking occurs when request waiting on lock. second, when @ process blocked which, there hierarchy, example, spid 63 blocked spid 128, spid 128 being blocked spid 98, in turn blocked spid 101. need identify last one, head of blocking chain, 1 blocking others not being blocked itself, , deal it. here's query identify head blocker: select r.session_id, r.host_name, r.program_name, r.login_name, r.nt_domain, r.nt_user_name, r.total_elapsed_time/1000 total_elapsed_time_sec, getdate() vrijeme, (select text sys.dm_exec_sql_text(c.most_recent_sql_handle)) sql_tex

ios - Alarm is not ringing after 3 minutes when its running in background -

i working on alarm application. faced problem last 2 weeks. problem is: application running in background.first time install application , set alarm & close app. if alarm time more 3 minutes current time not ringing means after 3 min alarm not ringing in background process. if application on alarm working. this code: self->bgtask = 0; nsassert(self->bgtask == uibackgroundtaskinvalid, nil); bgtask = [application beginbackgroundtaskwithexpirationhandler: ^ { nslog(@"beginbackgroundtaskwithexpirat"); dispatch_async(dispatch_get_main_queue(), ^ { nslog(@"dispatch_async"); [application endbackgroundtask:self->bgtask]; self->bgtask = uibackgroundtaskinvalid; }); }]; dispatch_async(dispatch_get_main_queue(), ^ { nslog(@"dispatch_get_main_queue"); //start bg timer [self start_update_timer]; self->bgtask = uibackgroundtaskinvalid;

c# - Setting the charset of html response content to 1252 -

i'm trying send data encoded in windows 1252 (it's csv file) in http response, somewhere along way it's getting re-encoded utf-8 (no bom). how can make sure data stays in correct encoding? var sb = new stringbuilder(); // build file windows-1252 strings in sb... httpcontext.current.response.clear(); httpcontext.current.response.clearheaders(); httpcontext.current.response.clearcontent(); httpcontext.current.response.addheader("content-disposition", string.format("filename=\"{0}\".csv", filename)); httpcontext.current.response.contenttype = "text/csv;charset=windows-1252"; httpcontext.current.response.charset = "windows-1252"; httpcontext.current.response.write(sb.tostring()); httpcontext.current.response.flush(); httpcontext.current.response.end(); when call httpcontext.current.response.write(somestring) the input somestring in .net's internal string representation (actually utf-16). send output has c

google analytics - How to select number only regex -

i using following code select pages hotel id in url $ga->requestreportdata(ga_profile_id,array('pagepath'),array('visitors'),'-visitors','pagepath=~'.$hotelid,$startdate,$enddate,1,100); the problem if im looking hotelid 10, selects pages hotelid 1002 example how can solve this? you can test in google analytics query explorer : if string ?hotelid=10 should work. place following line filters in query explore. note: [^0-9] tells next char cant number. need test still works if next char doesn't exist, think should work. ga:pagepath=~hotelid=10[^0-9] your code should think: $ga->requestreportdata(ga_profile_id,array('pagepath'),array('visitors'),'-visitors','pagepath=~hotelid='.$hotelid.'[^0-9]',$startdate,$enddate,1,100);

c++ - Iterator and templates -

i try manipulate iterators. template <typename mytype> class myclass { public: myclass ( const mytype & myarg) { this->data=myarg; } ~myclass ( void ){} set<int> test ( const mytype & myarg ) const { set<int> result; typename mytype::iterator it=myarg.begin(); return result; } private: // mutable mytype data; }; this code compiling.but when want use it, no longer compiling: here example: int main() { myclass <string> t0 ( "caacaa" ); set<int> r=t0.test("a"); return 0; } i error: test.cpp: in member function ‘std::set<int> myclass<mytype>::test(const mytype&) const [with mytype = std::basic_string<char>]’: test.cpp:38:26: instantiated here test.cpp:25:48: error: conversion ‘std::basic_string<char>::const_iterator {aka __gnu_cxx::__normal_iterator<const char*, std::basic_string<char> >}’ non-scalar

html - (Bootstrap 3) Text and images with jumbotron get distorted when changing screen sizes -

today have made webpage using bootstrap 3, have change 'jumbroton' coding make this: http://www.bootply.com/103783 although background image shows through, when resize page doesn't not resize instead puts text , image within 'jumbotron' underneath else. i have tried putting 'container' around the'jumbotron' no luck... :( my website: http://warfacecommunity.bugs3.com/ try scrolling in , see meant! css code in 'style.css' .bg { background: url('/img/bg.jpg') no-repeat center center !important; position: fixed !important; width: 100% !important; height: 350px !important; /*same height jumbotron */ top:0 !important; left:0 !important; z-index: -1 !important; } .jumbotron { margin-bottom: 40px !important; height: 350px !important; color: white !important; text-shadow: black 0.1em 0.3em 0.3em !important; background:transparent !important; html 'jumbotron' <div class="jumbotron&quo

javascript - how to add array into array's and as its property -

add second , third array main's array properties http://jsfiddle.net/erj9v/ var main = [{ 'id': 1, //'second':[ // {'something':'here'}, //{'something':'here 2'} // ], /*'thrid' : [ {'something':'here '}, {'something':'here 2'} ] */ }] var second[{ 'something': 'here' }, { 'something': 'here 2' }] var thrid[{ 'something': 'here ' }, { 'something': 'here 2' }] one more question, i'm building single page application, should @ or front end better? just add them - var second = [{ 'something': 'here' }, { 'something': 'here 2' }] main['second'] = second; for more help- how push associative item array in javascript?

java - Running batch file as a thread not a process -

am trapped in situation need ... infinitely , create process i.e batch file converts given file.pdf file.txt problem facing ,,, in order on files , program creating process run batch file , waits finish , create process ... , on , consuming resources how can save resources ? string[] arg = { "cmd", "/c", "bat.exe", "-layout", arg0, arg1}; try { processbuilder builder = new processbuilder(arg); builder.redirecterrorstream(true); process p2 = builder.start(); bufferedreader reader = new bufferedreader(new inputstreamreader( p2.getinputstream())); string line; while ((line = reader.readline()) != null) { system.out.println(line); } p2.waitfor(); } catch (ioexception e) { e.printstacktrace(); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } where arg0 , a

python - pyprocessing doesn't quit on Windows -

here quote pyprocessing usage instructions wiki : in principle, run() not return, can terminate application typing esc key. if start pyprocessing interactively (not using subprocess.call per this question ), escape key nothing stop process: >>> pyprocessing import * >>> # @ point, nothing close pyprocessing window except force-quit ... # making debugging pyprocessing app pretty hard is there way kill pyprocessing process once it's started interactive python shell?

javascript - How to generate google autocomplete address api dynamically -

i need generate n number address grabber , formatted output in json, can via ajax on button click. not getting how can use google api generate autocomplete dynamically , things separately. i need show same type of design attached in fiddle. http://jsfiddle.net/6bcud/ initialize(); var placesearch, autocomplete; var componentform = { street_number: 'short_name', route: 'long_name', locality: 'long_name', administrative_area_level_1: 'short_name', country: 'long_name', postal_code: 'short_name' }; function initialize() { autocomplete = new google.maps.places.autocomplete( /** @type {htmlinputelement} */(document.getelementbyid('autocomplete')), { types: ['geocode'] }); google.maps.event.addlistener(autocomplete, 'place_changed', function() { fillinaddress(); }); } function fillinaddress() { var place = autocomplete.getplace(); (var component in componentform) {

css - How to specify an element to re-appear after a page break? -

background: have php script generates long html/css document gets converted pdf wkhtmltopdf. at 1 point in document, enter dynamic area variable number of entries, of include large images. want redraw header on every page. point of clarification: repeated header in print view of section of webpage, not header entire page. how want via css. example (pseudocode): #some_region:pagebreak { background-color: #fcc; border-color: #000; border-style: solid; border-width: 0 0 1px 0; content: "our header here"; } of course, fictitious css3 selector not exist! are there clever css hacks can used display element after page-breaks within container? to illustrate: https://scott.arciszewski.me/public/23277702.php what position: fixed; header in @media print ? force header on each printed page. like: @media screen { .print-header { display: none; } } @media print { .print-hea

c# - Adding data to a list inside a class -

i want fill list<int> inside class can't work. (some / of code here the class: class fiu { public int feleseg { get; set; } public list<int> preferencia { get; set; } public fiu (int _feleseg) : this() { feleseg = _feleseg; } public fiu() { this.preferencia = new list<int>(); } } the code: (int = 1; < 4; i++) { fiu ujfiu = new fiu(0); (int j = 1; j < 4; j++) { ujfiu.preferencia[j-1] = 1; } } the main goal filling excel, right doesn't put 1-s in. don't know what's wrong. "argument out of range exception unhandled" error. replace this: ujfiu.preferencia[j-1] = 1; with this: ujfiu.preferencia.add(1);

symbols - how to solve two equal symbolic equations in matlab -

i define symbol that va = sym('va'); vb = sym('vb'); after calculations, get vb = somenumbers*va + someother numbers; then , got result's backup , keep vbbackup and again after calculations vb becomes different number respect va , 2 equations shown actually meant ; vb = 6*va + 3; vbbackup = 8*va + 2; how can value of va ?

objective c - NSSegmentedCell Subclass and Custom Geometry/Layout Impossible? -

Image
a tale of 2 subclasses by ben stock prologue i'm in process of making nice looking set of controls automatically change appearance depending on type of window they're used in (e.g. if drop button in normal window, looks other standard aqua button. if drop on nspanel window mask of nshudwindowmask , however, it'll automatically switch style on hud background. far, i've subclassed nsbutton , nstextfield , nsslider , , nssearchfield . last night started on nstabview , slammed down lack of customizability. it's real pain in ass, i'm developer, i'm used finding own way. first thing think add instance of nssegmentedcontrol in place of private tabs used nstabview . far, good. i've got buttons selectable, automatically update when new nstabviewitem 's added, , work real thing. and pain begins … finally, start style segments, , … wtf have gotten myself into‽ should've gone acting or something. objective-c development taking years off life.

objective c - iOS: UIImagePicker or AVCam for this functionality -

i looking way add custom button on camera preview , don't know go. ios native camera, on left of capture button, can click on , access photo library. how can add button camera preview view? kind enough give directions? in advance. take @ uiimagepickercontroller's cameraoverlayview . lets lay own interface on top of default camera interface.

javascript - .children(":first-child") - ajax - multiple first children? -

i have simple yet strange problem - when select .children(":first-child") multiple results given, 1 alert after another. // ... $.post(ajaxurl, data, function (response) { //alert(response); tinymce.get('geqqo-editor-new').setcontent(''); $('#geqqo-modal-new').modal('hide'); $('#geqqo-modal-new').on('hidden.bs.modal', function (e) { $('#timeline').prepend(response); var new_status = $('#timeline').children(":first-child").attr("id"); alert(new_status); }); // ... how select first-child (that is, appended one) instead of multiple ones such doing. try using one method instead of on method , :first instead of :first-child $('#geqqo-modal-new').one('hidden.bs.modal', function (e) { $(&#

java - Admob not receiving ads (started randomly, no known changes) -

i noticed evening apps not generating more ad requests tonight. unusual. has been several hours of admob not showing new ad traffic. so attempted coax app loading ad , not. checking logcat shows this: adrequesturlhtml: <html><head><script src="http://media.admob.com/s dk-core-v40.js"></script><script> ......... </head><body></body></html> this has "ads" tag , more information contained. then in logcat (also "ads" tag: adloader timed out after 60000ms while getting url. and finally: onfailedtoreceivead(a network error occurred.) any ideas? it's not device (tried on several), , others not receiving ads (number of impressions not increasing evening). have working network connection on devices (and no, adblocker not installed). this started randomly; did not update application. did not change within admob. possible admob having brief outage? let me know if can provide more inform

Re-Arranging file array contents using Java -

i have file array have list of file names folder. e.g. file file = new file("/path"); file[] arr = file.listfiles(); so arr has file names inside file path. say arr [folder1 , folder2, folder3]. also have string array list contains ( folder3 , folder1 , folder2). i need change arr contents per arrraylist order. (i.e) after processing arr have [ folder3 , folder1 , folder2]. i need because , have read folders based on hierarchy. am new please how can achieve it. if have folder names string list in desired order, why use file.listfiles()? just create file objects names in order listed, this: list< string > arraylist = arrays.aslist("folder3", "folder1", "folder2"); file parent = new file("/path"); file[] arr = new file[arraylist.size()]; ( int = 0; < arr.length; i++ ) arr[i] = new file(parent, arraylist.get(i)); // arr contain file objects in order listed in arraylist

How can i write the results of SAS fullstimer option to a dataset? -

we evaluating time taken 2 set of codes in sas. there way can write/ tabulate option fullstimer results in sas dataset, without copying entire log file notepad? i go this. create separate sas program files containing code each approach. include options fullstimer @ top of both. batch submit programs , write logs permanent files using -log command line option. create simple program reads in both logs , compares results. the last step can accomplished using data steps infile statement , restricting input records standard output fullstimer. can compare created datasets wish, e.g. via proc compare.

Is there a release event for HTML select element when the dropdown is released -

as title says, need event when dropdown released restoring something. tried onblur , may miss releases. you can use onclick . fires whenever click on select box select or not.

image processing - how to place functions in main file in matlab? -

i have small question, have created functions zoom, nni, bilenear displaying picture is: zoom.m function [out]= zoom(n,factor) ----- --- ---- end nni.m function [out]= nni(n,factor) ----- --- ---- end bilenear.m function [out]= bilenear(n,factor) ----- --- ---- end what trying: main.m function [out]= answer(n, factor) clc function [out]= zoom(n,factor) function [out]= nni(n,factor) function [out]= bilenear(n,factor) end i want main function display zoomed picture, nni pic , bilenear separately to build on schorsch's answer since mention want main function display these images try following: function [out] = compare_interpolations(n,factor) clc zoomed = zoom(n,factor); nearest= nni(n,factor); bilinterp=bilinear(n,factor); figure; subplot(1,3,1);imshow(zoomed);title('zoomed'); subplot(1,3,2);imshow(nearest);title('nearest neighbor'); subplot(1,3,3);imshow(bilinterp);title('bilinear'); end

javascript - Angular UI Router resolve throwing provider error -

i seem having issue angular ui router , trying add resolve state. weird thing is, have in place , works fine. i'm separating code out different component areas, code structure this: /app /component-dashboard index.js /controllers dashboardctrl.js /component-chart-1 index.js /controllers chart1ctrl.js for example have root dashboard , works fine: // index.js angular.module('az-ci') .config([ '$stateprovider', function($stateprovider) { $stateprovider .state('dashboard', { templateurl: '/app/ci-dashboard/templates/dashboard.html', url: '/', controller: 'dashboardctrl', resolve: { chartlist: function() { return [{ name: 'chart 1', state: 'dashboard.chart1' }]; } } }); } ]); // dashboard ctrl angular.module('az-ci') .controller('das

Android String color manipulation -

Image
i have 1 text view in android text "hi how you?" my query can keep color of "hi how" blue , "are you?" red in 1 line below cause using 2 text view show "hi how" , "are you" respectively want show in 1 text view above requirement? can give 2 color code @ time 1 text in string file? reference? try this: string text = "<font color=#0000ff>hi how</font> <font color=#ff0000>are you</font>"; mtxtvw.settext(html.fromhtml(text));

Get all dates between two dates in SQL Server -

how dates between 2 dates? i have variable @maxdate storing maximum date table. want dates between @maxdate , getdate() , want store these date in cursor. so far have done follows: ;with getdates ( select dateadd(day,1,@maxdate) thedate union select dateadd(day,1, thedate) getdates thedate < getdate() ) this working when trying store these values in cursor set @datecursor=cursor select thedate getdates compilation error incorrect syntax near keyword 'set'. how solve this. thanks in advance my first suggestion use calendar table , if don't have one, create one. useful. query simple as: declare @mindate date = '20140101', @maxdate date = '20140106'; select date dbo.calendar date >= @mindate , date < @maxdate; if don't want to, or can't create calendar table can still on fly without recursive cte: declare @mindate date = '20140101'

ios - Finding owner's phone number in 2014? -

this question has answer here: programmatically own phone number in ios 9 answers i've been researching how find owner phone number of ios device, no luck. there post around showing thirdparty frameworks allow that, rejected apple. in app i'm accessing addressbook contact , getting phone contacts, name , phone. in case (with iphone, didn't test in other iphones) can see own number listed rest of contacts. there way find out/flag or recognize contact owner of iphone? here code: abaddressbookref addressbookref = abaddressbookcreatewithoptions(null, null); if (abaddressbookgetauthorizationstatus() == kabauthorizationstatusnotdetermined) { abaddressbookrequestaccesswithcompletion(addressbookref, ^(bool granted, cferrorref error) { abaddressbookref addressbook = abaddressbookcreate( ); }); } else if (abaddressbook