Posts

Showing posts from May, 2011

java - Why is my post not give data to my controller from my form? -

i developing sprin mvc application , have form containing table in 1 of ui jsp's, (welcome.jsp) , when submit button clicked, trying print out data in form web applications console.from there intend parse checkboxes selected , have controller send 'selected' data databased updated next status in applications flow. so far form 'successfully' posting in no error or exceptions being thrown, printed statement in console blank makes me think no data being sent, , welcome fix this. here setup of have, not actual code rough set of elements , methods. welcome.jsp: <form action="<c:url value="/postpage" />"method="post" modelattribute="rtable"> <br/> <table> <thead> <tr> <th>title1</th> <th>title2</th> <th>title3</th> <th><sele

jquery - looper.js plugin - images invisible in between crossfade animations -

i've been trying use looper.js loop through various words or images inside div ( examples ) everything seems work ok except when use crossfade animation option ( class="xfade" ). the content appears during animations, , otherwise invisible. this fixed commenting out position: relative in .looper .looper-inner : .looper .looper-inner { overflow: hidden; width: 100%; height: auto; /*position: relative;*/ z-index: 2; } but not acceptable solution since messes responsive layout on mobile. i guess must noob mistake on part since i'm using default official examples... demo: jsfiddle thank help. it seems looper plugin not stable, , support on far excellent. ended using other plugin called cycle2 , more popular , highly customisable. cycle2 comes many fancy transitions, feel free check out cycle other more traditional transitions. edit : concerning looper.js, solution specified height of .looper .looper-inner every single anima

sql - Saving fields to database using Java -

i have button inside application should saving database. can tell me if see wrong code? not saving @ all. savebutton.addactionlistener( new actionlistener() { public void actionperformed(actionevent e) { //gets text texfields , saves instance variables string fname = fnametextbox.gettext(); string lname = lnametextbox.gettext(); string email = emailtextbox.gettext(); string signupdate = signuptextbox.gettext(); try { //moves cursor new row //rs.movetoinsertrow(); //statement checks if user enters letters if(fname.matches("[a-za-z]+")) { //statement checks if user enters letters if(lname.matches("[a-za-z]+")) { //statement , actions if user enters

c++ - QTableView and unique IDs -

i'm new qt , coming c# .net. trying replicate simple program wrote in c# in qt learning tool. have data model inherits qabstracttablemodel , implements: rowcount, columncount, data, setdata, headerdata flags my data structure map std::map<int, cbdatarow> so idea each row have unique int id , struct containing rest of row information. what stuck on how update data model when user makes edit in qtableview object. setdata function called. here is: bool cbdatabasemodel::setdata(const qmodelindex &index, const qvariant &value, int role) { bool success = false; if(role == qt::editrole) { success = m_data.updaterow(index, value); } if(success) { emit datachanged(index, index); return true; } else { return false; } } now see updaterow() function gets called here on edit. function should find unique id in map , update appropriate members of cbdatarow struct. problem have no idea how unique id out of qmo

c - Using getchar() to exit a loop when user hits 'Enter'? -

i have read lot of other stack overflow topics on still having lot of trouble. have tried use do/while loop nested if statement. can't last if stop printing 'cards' when the 'player' hits 'enter'. ether getchar() holds if statement print if user continually presses enter (which not close intending) or continues print after pausing. void printdeck(card *deck, const char *faces[], const char *suits[], file *fp) { int loop, t; // print deck 1 card @ time fp = fopen("cardsprinted.txt", "w+"); t = ftell(fp); char c; { c = getchar(); (loop = 0; loop < 52; loop++) { // print face , suit of card stdout file printf("%s of %s\n",faces[deck[loop].face],suits[deck[loop].suit]); fprintf(fp,"%s of %s\n",faces[deck[loop].face],suits[deck[loop].suit]); fseek(fp, t, seek_set); // finds beginning of file fseek(fp,t,seek_end)

html - Overflow: hidden not working when TD, and TH width are specified -

i need help. it seems td cell not respecting overflow: hidden in css. i've done recommended fixed layout of table specifying widths of th's , td's any ideas? <!doctype html> <html> <head> <style type="text/css"> /*------------------------------------------------------------------ table style ------------------------------------------------------------------ */ table a:link { color: #666; font-weight: bold; text-decoration:none; } table a:visited { color: #999999; font-weight:bold; text-decoration:none; } table a:active, table a:hover { color: #bd5a35; text-decoration:underline; } table { font-family:arial, helvetica, sans-serif; color:#666; font-size:12px; background:#eaebec; border-collapse:collapse; border-spacing: 0; table-layout: fixed; } table th { padding:10px 10px 10px 10px; border-bottom:1px solid #e0e0e0; border-right: 1px solid #e0e0e0; width:

css - Bootstrap 3 responsive nav bar not reacting -

so have drop down items rather long , wrapping down next level otherwise overflowing. not familiar @media when go down mobile shows drop down collapse nav vs. tablet or smaller laptop not act responsively. there missing here? in advance. http://blog.sobecreative.com/clients/test/index2.html you must have 'jquery.js' called before 'bootstrap.min.js' in html code. else tapping on menu button in mobile view doesn't work.

vb.net - How to create radio button by String -

how create radio button string in vb.net ? i must create 1 table include multiple radio button. my code dim integer = 0 dim str string = "<table><tr><td><asp:radiobutton id='radiobutton" & & "' runat='server' text='" & & "' /></td></tr></table>" response.write(str) note: must use radio button control .net you can't use radiobutton way since it's server control. have write pure html on response: dim integer = 0 dim str string = "<table><tr><td><input id='radiobutton' type='radio' name='radiobutton' value='" & & "' />" & & "</td></tr></table>" response.write(str) or have use htmlgenericcontrol without writing directly on response: dim table new htmlgenericcontrol("table"); dim tr new htmlgenericcontrol("tr"

php - mysqli_fetch_array() on a non-object -

getting error on code can 1 tell me doing wrong , how solve or 1 suggest me more simple code after select query because don't want mess code , not helping here code if(isset($_get['id'])){ $page_id = $_get['id']; $page_id = mysqli_real_escape_string($con, $page_id); $select_query = ("select id, title, image, cost, vid, content mobs id=?"); $stmt = $con->stmt_init(); if(!$stmt->prepare($select_query)) { print "failed prepare statement\n"; } else { $stmt->bind_param("s", $page_id); { $stmt->execute(); $result = $stmt->get_result(); if($result === false) { die(mysql_error()); } while($row->mysqli_fetch_array($result)) { $post_id = $row['id']; $post_title = $row['title']; $post_image = $row['image']; $post_cost = $row['cost']; $post_vid = $row['vid']; $post_cont= $row['content'];

Is there a tidy way to define a large watch collection for AngularJS? -

i using code: $scope.$watchcollection('[config.examid, config.pagetype, config.createdby, config.modifiedby, config.reference]', function (newvalue, oldvalue) { if (typeof newvalue !== 'undefined' && typeof oldvalue !== 'undefined' && newvalue !== oldvalue) { _u.putconfigs($scope.config); //$scope.grid.data = null; }; }); now have add more items collection. there way can neatly spread these on multiple lines? understand (might wrong). watchcollection has string. well, looks use simple fields inside of configuration object can modify have multiple watch (which can more flexible in way). if have complex objects can watch them using deep flag: var app = angular.module('app', []); app.controller('configctrl', function($scope, $parse, $log) { $scope.config = {}; // initial configuration $scope.watchpr

Android: Remove hard coding of database path -

in application in sqlite data base helper class code of constructor follows: public databasehelper(context context) { super(context, database_name, null ,database_version); this.mycontext = context; //the android's default system path of application database. db_path = "/data/data/mypackage/databases/"; } where getting warning as: do not hardcode "/data/"; use context.getfilesdir().getpath() instead so tried: db_path = "/data/data/" + context.getpackagename() + "/databases/"; but getting same warning. should now. you can 1 thing. not hard core it. try as: db_path = mycontext.getdatabasepath(database_name).getpath(); this remove warnings.

php - Mysql Multiplication error -

i have code below , using mysql loop rows of database. $pages == 1 pages on /list.php?page=1 problem else section. if go page 2 both $pages2 & $pages3 echo out 40 & 80 mysql loop still get's results 41-120 out of database, why? want row 40 80 in output, nothing more. if($pages == 1) { $pages3 = 40; $pages2 = 0; echo $pages2; echo $pages3; } else { $pages3 = 40 * $pages; $pages2 = 40 * $pages - 40; echo $pages2; echo $pages3; } $currentpage = 0; $sql = "select * cake"; $numrows = mysql_num_rows(mysql_query($sql)); $getquery = mysql_query("$sql order id limit $pages2, $pages3"); while($rows=mysql_fetch_assoc($getquery)){ on limit first parameter first row start (starting 0) , second amount of rows fetched. so should like: $getquery = mysql_query("$sql order id limit $pages2, 40");

Problems with k-NN regression in R -

i trying run knnreg package caret. reason, training set works: > summary(train1) v1 v2 v3 13 : 10474 1 : 6435 7 : 8929 10 : 10315 2 : 6435 6 : 8895 4 : 10272 3 : 6435 9 : 8892 1 : 10244 4 : 6435 10 : 8892 2 : 10238 7 : 6435 15 : 8874 24 : 10228 8 : 6435 40 : 8870 (other):359799 (other):382960 (other):368218 while 1 won't work: > summary(train2) v1 v2 v3 v4 13 : 10474 1 : 6436 7 : 8929 christmas : 5946 10 : 10315 2 : 6436 6 : 8895 labor day : 8861 4 : 10272 3 : 6438 9 : 8892 none :391909 1 : 10244 4 : 6435 10 : 8892 super bowl : 8895 2 : 10238 7 : 6435 1

c# - Check user permissions -

this question has answer here: checking file/folder access permission 3 answers i have application running in server, takes username , file path. idea check if user can read file (the target user is not same user running program). so how check read permissions specific user ?? i can't take responsibility googled , answer james newton-king found here- how present credentials in order open file? you want impersonate user have rights access file. i recommend using class - http://www.codeproject.com/kb/cs/zetaimpersonator.aspx . hides nasty implementation of doing impersonation. using (new impersonator("myusername", "mydomainname", "mypassword")) { string filetext = file.readalltext("c:\test.txt"); console.writeline(filetext); }

android - Tablet development for a dedicated system -

i need make architectural decision developing (actually porting) embedded solution. try present case possible, , advice can appreciated. introduction i have embedded system, developed on arm11 architecture , archlinux os. implemented using kinds of technologies available under linux, including c, c++, bash , python. at time, port solution tablet, trying make decisions architecture, based on requirements of system. requirements the system modular, , runs multiple processes , threads. communicates remote servers , controls hardware peripherals. these basic requirements, @ moment, update discussion develops: primary: dedicated system (minimum amount of other applications running, in bg) multiple processes, ability set priorities ability assign process single cpu core (cpu affinity) inter-process communication mechanisms complete hardware control (wifi, 3g, gsm, mic, speaker, display, ...) creating sockets, etc. other: ability connect microphone directly 3.5mm

caching - Memcached passing data using php -

i have installed memcached 1.4.4-14 on windows systems. have started service , in order. trying test using .php served using iis. so right basic index.php page , browse through iis. can render page , general .php works. nothing happens memcache. there confusion out there pre-requisites need install. can't fathom ones essential. php installed new clean install php_memcache.dll extensions dumped in .php. it worth noting in phpinfo can see no reference memcache. would love basic assistance. here example using, believe standard test memcache session dump. session_start(); header("content-type: text/plain"); $memcache = new memcache; $memcache->connect("localhost",11211); # might need set "localhost" "127.0.0.1"5 echo $memcache->get(session_id()); thank you. if you're interested in using compression, please note that, @ least php version 5.3.2 , memcache version 3.0.4, when retrieving key who's value numeric

android - Adding drawable image to background of canvas -

i know possible paint background of canvas using mpaint = new paint(); mpaint.setcolor(color.red); im wondering how set permanent background it. ive tried using xml file nothing happens. ideas? this source code of project, ive been following tutorial how because im unfamiliar bitmaps. canvas class import android.content.context; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.graphics.canvas; import android.graphics.color; import android.graphics.paint; import android.graphics.rect; import android.util.attributeset; import android.view.view; import android.widget.imageview; public class gameboard extends view{ private int mflagx = -1; private int mflagy = -1; private bitmap mbitmap = null; private bitmap nbitmap = null; private paint mpaint = null; private boolean isflaghidden = false; private int mboundx = -1; private int mboundy = -1; //play these values make app more or less challenging pu

adding button to android application to quit app without using back button -

i'm new android programming,i want add button exits app. don't want use buttons exit app i have enough knowledge creating intents open new activity , other basics of android programming according android guidelines, should never ever put exit button on android application. have let os decide when kill activity. should android activity lifecycle , implement necessary callbacks. nevertheless, previous answers work well.

tsql - Inserting concatenated values in T-SQL -

ok, trying achieve: my script below supposed gather values across 3 tables , insert them in table b in sequence. there 2 columns being affected in table b indxlong , ddline. in ddline row attempting concatenate values different fields , store them one. my code below. please share insights: declare @nrowcount int, @indxlong int, @hdrlocal char(255), @cr char(255), @bldchkdt datetime, @bldchtime datetime, @hdrline int, @1strowline int, @2ndrowline int, @3rdrowline int, @bwp char(255), @compacc char(11), @bankcode char(11), @branchno char(11), @paydate datetime, @reference char(11), @totaamt numeric(19,5) @coname char(11), @beneficiaryacc char(11), @benbankbranchcode char(11), @salary numeric (19,5), @beneficiaryname char(23), @transref char(23), @outer_c int select @compacc =ddcoiden, @bankcode =ddimorig, @bran

html - Two column text with image in middle middle -

i have looked around lot cannot find tutorial or suggestion how place image in both vertical , horizontal center of page of two-column text. i've seen explanations straddling image across 2 columns, aligned @ top of text. want align image in middle middle.! is possible? prefer in css, consider works, (especially if comes instruction.) can offer (even if it's tell me give up.) (c; i've found technique described here , shown below effective: html <div class="container"> <div class="inner"> <img src="//placehold.it/200x200"> </div> </div> css .container { text-align: center; } .container:before { content: ''; display: inline-block; height: 100%; vertical-align: middle; } .inner { display: inline-block; vertical-align: middle; }

php - Wordpress breadcrumbs issue -

i have breadcrumb in website that's not working properly. when go product like equipment» products» railing» heavy railing» waterproof» superrail 2000 it shows me breadcrumb should. when same product through "non-waterproof" instead of "waterproof" shows me same breadcrumb (so basicly, follows 1 category). i wanted check in settings of breadcrumb plugin, shows me message "your settings out of date. migrate now.", , supervisor has adviced me not "migrate" it. does have solution uses either plugin or custom code works multiple categories? edit: i'm working wp 3.6, i'm not allowed update. url looks http://www.website.com/product/asl6109t32/ , means can't use url generate breadcrumb. if may, here nifty code snippet creating breadcrumb navigation, place in theme's functions.php file: /*********************************************************** * wsf_breadcrumbs() - shows breadcrumbs in template ******

How to adjust the position of dialog box at a specific position relative to the device in android -

i have android application in there dialog box opens result of button click.in this,i want set position of dialog box below button.when used verticalmargin,the position changes relative device when tested in more 1 devices different screen resolution.what need dialog box should appear below button irrespective of screen size. after searching in various post have found solution. the code posted below: private charsequence[] items = {"set ringtone", "set alarm"}; alertdialog.builder builder = new alertdialog.builder(this); builder.setitems(items, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int item) { if(item == 0) { } else if(item == 1) { } else if(item == 2) { } } }); alertdialog dialog = builder.create(); dialog.requestwindowfeature(window.feature_no_title); windowmanager.layoutparams wmlp = dialog.getwindow().geta

image processing - Stop imagecreatefromjpeg Error From Being Thrown in PHP -

i'm in process of converting images external websites references images stored in amazon s3 account. i'm running script conversion images need, script continues break error message: e_warning: imagecreatefromjpeg( http://www.site.org/.../i/ak04659a.jpg ): failed open stream: connection timed out is there anyway can have script continue running if there error? restarting script frustrating , counterproductive. script: <?php ini_set('memory_limit','2048m'); ini_set('max_execution_time', 30000000); ini_set("user_agent", 'mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.1.9) gecko/20071025 firefox/2.0.0.9'); ini_set('gd.jpeg_ignore_warning', 1); $cron = true; include('init.inc.php'); $query = 'select * city_images city_id > 0 order city_id'; $city_images = sql::q($query); //var_dump($cities); die; while ($row = sql::f_assoc($city_images)) { //var_dump($row); $city_id = $row['city_i

Remove array key from array in cakephp -

print array array( 'order' => array( 'id' => '1', 'base_price' => '65', 'min_price' => '95', ) ) is possible remove key('order') when retrieving data? if not how can use array_shift or end in 1 line , prevent below error? i getting error only variables should passed reference when remove key array. $orders = array_shift or end ($this->order->read(null, $id)); debug($orders); you want id following code you $arrorderid=set::extract("/order/id",$data); here $data array want delete "order" key. you following array when debug($arrorderid); [0]=>1 if want base_price write following code $arrorderid=set::extract("/order/base_price",$data);

What is an elegant way to display a four-tabbed table that changes its content based on the tab in HTML/CSS/Native JavaScript? -

a little bit of background: i developing tracker company each representative have access in order assist tracking daily statistics such calls, time spent after phone call before being available again, revenue, , various sales required make. each day consists of 4 "tours", or checkpoints throughout day @ statistics recorded. @ point, have completed representative tracker portion, having trouble coming way display data each representative in manager-view page. i'm thinking i'd 4 tabs represent each tour , fifth view totals. how build table using native javascript, css , html? closest feel have come solution use <iframe></iframe> , display 4 individual php pages inside, think may gaudy , awkward. i started this while ago; gives idea of i'm looking make, though has 4 tabs in example. a. use jquery tabs. great case. b. if dont want inmerse in jquery, use jquery logic: each "tab" , javascript display/hide contents. can whole cod

Incorrect Result When ANTLR4 Lexer Action Invokes getText() -

it seems gettext() in lexer action cannot retrieve token being matched correctly. normal behaviour? example, part of grammar has these rules parsing c++ style identifier support \u sequence embed unicode characters part of identifier name: grammar cppdefine; cppcompilationunit: (id_token|all_other_symbol)+ eof; id_token:identifier //{system.out.println($text);} ; crlf: '\r'? '\n' -> skip; all_other_symbol: '\\'; identifier: (nondigit (nondigit | digit)*) {system.out.println(gettext());} ; fragment digit: [0-9]; fragment nondigit: [_a-za-z] | universal_character_name ; fragment universal_character_name: ('\\u' hex_quad | '\\u' hex_quad hex_quad ) ; fragment hex_quad: [0-9a-fa-f] [0-9a-fa-f] [0-9a-fa-f] [0-9a-fa-f]; tested 1 line input containing identifier incorrect unicode escape sequence: dkk\uzzzz the $text of id_token parser rule action produces correct result: dkk uzzzz i.e. input interpreted 2 identifiers separated

vb.net - Copy SQL Server Table's Data to a New Table (in Code) -

i use advice on approach copying data between tables. i'm really trying avoid rdbms-specific sql... 2 tables same in respects except name. concept: my application uses data table (let's call tablea ). reference data changes daily, want copy yesterday's off make room toady's data. right now, use smo make exact copy of tablea (schema), unique (using date) names table, indices, keys, etc. no problemo. if there problems updating tablea today's data, can restore yesterday's tablea ( tablea_<yesterdaydate> ). both tables on same database. i can't use smo's .rename , because won't rename keys & indices... so premise. desired: a non-sql statement way so. heavily invested in ef6/code first in application, name of table changes each day, can't add tables/classes in dbcontext 'just in case'. i feel dirty using low level sql... sql server 2012 vb2012 ef6/code first p.s. i've tried few times in past impl

image - Implement puzzle game on Android -

i'm familiar android development, but not subject of manipulations on images, etc. i need implement puzzle game: let user mark , cut (non symmetric) piece of image. let user move , rotate piece. let user drag piece original place. , on... i heard opencv library (also android). best option start with? i have seen lot of questions/answers of issue, but android have official/unoffical library issue? one of opencv's android sample projects actually 1 of puzzle games . it not allow user cut pieces , rotate them, rest there. have source code if download android package, great starting point.

php - Google chart: I cant label my each (3 column) bar -

right code retrieved data 3 columns of database , display them row in column chart ( haxis ) , means:- there 3 bar ( called 3 columns of database) but want label each of bar (criteria1, criteria 2, criteria3..) clear example table below..i want retrieve percentage database stored in 3 columns.. criteria labeled manually.. ________________________ |criteria |percentage | |-----------------------| |criteria 1 | 64.1 | |-----------------------| |criteria 2 | 11.1 | |-----------------------| |criteria 3 | 21.1 | |-----------------------| thank u much.. edited :getdata.php: $table = array(); $table['cols'] = array ( array('label' => 'criteria', 'type' => 'string'), array('label' => 'criteria 1', 'type' => 'number'), array('label' => 'criteria 2', 'type' => 'number'), array('label' => 'criter

php - curl request and wait for a response -

i'm trying send request website http://bookonline.saudiairlines.com via curl session-dependent. example is: http://www.bookonline.saudiairlines.com/pl/saudiairlines/wds/override.action;jsessionid=mnqhtnnqcd12vjv7zt5lwlvm6bjh8kblhpb1bfqtpvxl4dtwlqqs!-2104883082!632911 ......... everything went except i'm receiving middle screen shows: please wait .... how can wait , actual results contains flight details. thank you. here code: <?php // curl resource $curl = curl_init(); // set options - passing in useragent here curl_setopt_array($curl, array( curlopt_returntransfer => 1, curlopt_url => 'http://www.bookonline.saudiairlines.com/pl/saudiairlines/wds/override.action;jsessionid=rq42tndfnl295lg9szfph16pl881c9gqjvbpw7w8vgwdtpdmsdjf!-2104883082!632911924?pricing_type=c&b_date_1=201403230000&b_date_2=201403230000&b_location_1=dmm&language=gb&embedded_transaction=flexpriceravailability&wds_e_location_1_display=riyadh&wds_b_locat

c# - SubmitChanges not updating -

first of precise read related subjects submitchanges issues couldn't find solving problem... have several tables working fine using same way (excepting composite primary keys) 1 doesn't, can't understand why. here's table : create table [dbo].[trainings] ( [playerid] int not null, [stepid] int not null, [value] int not null, constraint [pk_trainings] primary key clustered ([playerid] asc, [stepid] asc) ); the related class : [table(name = "trainings")] public class training { [column(isprimarykey = true)] public int playerid { get; set; } [column(isprimarykey = true, name = "stepid")] public int step { get; set; } [column] public int value { get; set; } public training(int playerid, int step, int value) { playerid = playerid; step = step; value = value; } } and database update call : public class database : datacontext { public table<training> trainings;

php - Single cache frontend and backend -

i want use tagging cache in yii. but turns out frontend using cache backend. when change model in backend, front of cache not cleared. there solutions this? sorry english. set distinct cache prefix frontend , backend in respective configuration files. i still using 1.1.x branch, 2.x branch should same thing. frontend configuration file: 'cache' => array( 'class' => 'system.caching.' . (!mw_debug ? 'cfilecache' : 'cdummycache'), 'keyprefix' => md5('frontend.' . mw_version . yii::getpathofalias('frontend')), ), backend configuration file: 'cache' => array( 'class' => 'system.caching.' . (!mw_debug ? 'cfilecache' : 'cdummycache'), 'keyprefix' => md5('backend.' . mw_version . yii::getpathofalias('backend')), ),

c++ - Startup of stm32f100rbtx -

i found problem running program on stm32f100rbtx. using eclipse + zadig + openocd. working fine until tried handle interrupts. looking through google think problem in startup file , assembler file. looked proper files without success. me repair file or 1 ? link assembler file link startup.s pastebin . com/wsrxr2yi -- vectors.c (have no reputation) my main: #include "stm32f10x.h" #include "mygpio.h" typedef my_gpio<gpioc_base,8> blueled; typedef my_gpio<gpioa_base,0> button; int main(void) { //gpio_inittypedef gpio_initstructure; volatile int dly; rcc->apb2enr |= rcc_apb2enr_iopcen | rcc_apb2enr_iopaen; rcc->apb1enr |= rcc_apb1enr_tim3en; blueled::setmode(pinmode_output_2mhz); tim3->psc = 23999; // set prescaler 24 000 (psc + 1) tim3->arr = 1000; // auto reload value 1000 tim3->dier = tim_dier_uie; // enable update interrupt (timer level) tim3->cr1 = tim_cr

vb.net - Find Item Of Structure in List (Of Structure) -

i have struct: private structure udtt9map dim keyboardkey string dim mobilebutton integer end structure they stored in private _list list(of udtt9map) i know if there fast way locate item in list giving keyboardkey. since e. g. "keyboardkey" theoretically occur multiple times, guess ms did not include such function because multiple items list returned. am wrong? thank much! a list doesn't have means of finding items. locating items in list o(n) operation, i.e. need loop through entire list , compare value each structure. fast lookup rather use dictionary of lists: private _dict dictionary(of string, list(of udtt9map)) by storing structures same keyboardkey value in list in dictionary using keyboardkey value key, can structures value fast. reading dictionary close o(1) operation. to list use: dim result list(of udtt9map) = _dict(key) if keyboardkey values known unique in collection, don't need dictionary of lists, can use

c++ - Debugging run time error of armadillo package -

i using armadillo c++ library developing rcpp package. finding debugging run time errors armadillo extremely cumbersome. have insert printout after every line fish out line @ errors coming. armadillo throw errors like: error: subtraction: incompatible matrix dimensions: 756x1 , 26x1 and not tell information line number. using gdb not particularly helpful because error might coming after many iterations. there better line number of error occurring. i not know rcpp integration, debug armadillo code using gdb. just make sure never catch exceptions std::logic_error in code. if run program within gdb, abort once error occurs , typing bt nice trace shows line blame. , inspect variable values etc. in stack frame. you not need step through code make use of advantages of debugger. if rcpp not allow avoiding catch exception, should able write simple c++ test program code not block debugger.

How to solve app Hang and Crash issue on Client Machine :: Windows 8 store apps -

i had developed windows 8 app using c#,xaml. development finished , app sent client.now problem app crashing on client machine crash not reproducible @ our end.so told client send event viewer log can insight it. so client sent below information regarding crash extracted event viewer. the program sonyliv.exe version 1.0.0.0 stopped interacting windows , closed. see if more information problem available, check problem history in action center control panel. process id: f54 start time: 01cf4736b70ce3f2 termination time: 35 application path: c:\program files\windowsapps\3b783157.sonyliv_1.0.0.8_x64__rgtht6n7rete4\sonyliv.exe report id: 19dfccdc-b32a-11e3-be7a-e9381cf07b0a faulting package full name: 3b783157.sonyliv_1.0.0.8_x64__rgtht6n7rete4 faulting package-relative application id: app and below details regarding above crash. - <event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> - <system> <provider name="application

actionscript 3 - Flex 4 - How to align FormItem Label and TextInput? -

Image
i have formitem label , textinput controls. sample code <s:formitem id="mobilelabel" label="mobile number"> <s:textinput id="mobileinput"/> </s:formitem> <s:formitem id="emaillabel" label="email id" required="true"> <s:hgroup> <s:textinput id="emailinput"/> <s:label id="bindinglabel" text="@xyz.com"/> </s:hgroup> </s:formitem> output this: how align label text bottom of label? this you can use hgroup's proberty verticalalign. hgroup statement like: <s:hgroup verticalalign="middle"> <s:textinput id="emailinput"/> <s:label id="bindinglabel" text="@xyz.com"/> </s:hgroup>

c# - expression encoder - does not capture system audio -

i'm trying capture webcam , system audio using expression encoder, webcam works fine system audio silent. i followed tutorial here: codeproject expression encoder tutorial isn't working me properly. when list audio devices, "speakers...", "microphone..." , "headphones..." listed (as in playback devices in system tray) if try , record either speakers or headphones nothing (i mic audio fine if select one). here code i'm using: job = new livejob(); livedevicesource lds = job.adddevicesource(ledv[0], leda[1]); filearchivepublishformat fileout = new filearchivepublishformat(); fileout.outputfilename = string.format("c:\\users\\user1\\desktop\\testvideo-{0:yyyymmdd_hhmmss}.wmv", datetime.now); job.publishformats.add(fileout); lds.previewwindow = new previewwindow(new system.runtime.interopservices.handleref(panel1, panel1.handle)); job.startencoding(); job.activatesource(lds); does have idea why doesn't record syste

xamarin.ios - Xamarin PCL and sqlite.net -

i have need, in pcl xamarin, pass function type, used perform query. code tried use this: public object sqlleggi(string sql, type mytype){ sqlitecommand cmd = db.createcommand(sql); var results = cmd.executequery< mytype > (); [..] } but not work, give me error: the type or namespace 'mytype' not found. does know if possible such thing? thank much the mytype in 2 statements play different roles: public object sqlleggi(string sql, type mytype){ here, mytype type object, referencing instance of type class . var results = cmd.executequery< mytype > (); here, mytype type identifier , syntactic construct referring specific type, 1 named mytype in case. now, there 2 ways handle specific problem: look @ object type in cmd , see if there overload or alternative method executequery takes type object parameter instead make method generic don't have type object begin with. the first case presumably written in way: var

c# - How to set the longitude and latitude from ViewModel in bing maps in windows phone 7 -

Image
i want give longitude , latitude viewmodel. now using like:- private void button1_click(object sender, routedeventargs e) { pushpin p = new pushpin(); p.background = new solidcolorbrush(colors.yellow); p.foreground = new solidcolorbrush(colors.black); p.location = new geocoordinate(double.parse(longitude.text), double.parse(latitude.text));//longitude , latitude p.content = "i'm here";//to show place located map1.children.add(p); map1.setview(new geocoordinate(double.parse(longitude.text), double.parse(latitude.text), 200), 9); } my xaml is:- <grid x:name="mappageuicontainer" grid.row="1" margin="2,0,2,0"> <my:map copyrightvisibility="collapsed" logovisibility="collapsed" credentialsprovider="" mode="aerialwithlabels" height="543" horizontalalignment="left" name="map1" verticala

python - Celery beat task stops fails after a few beats (opencv) -

i have celery task runs on beat every 60 seconds grab webcam, take still it, , write file server can serve on webpage later. image taking uses opencv via cv2 library in python. it looks this: @app.task # task , save webcam image def getwebcamimage() logger.debug("capturing image attempt") c = cv2.videocapture(0) #returns videocapture object flag, frame = c.read() #grabs , decodes next frame cv2.imwrite('file/loc/img.jpg, frame) #writes frame file logger.debug('saved image...hopefully') c.release() #releases videocapture object return 0 everything goes great first few minutes, spits out normal errors not being able webcam properties , stops. , never starts again! ...debug/beat] celerytest.getwebcamimage[process]:capturing image attempt vidoc_querymenu:invalid argument vidoc_querymenu:invalid