Posts

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...

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": ...

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...