Posts

Showing posts from May, 2011

java - SAXParser - Escaping Special Characters -

i parsing below string using saxparser <xml> <firsttag>&amp;&lt;</firsttag> <secondtag>test</secondtag> </xml> i want same string retained getting converted below <xml> <firsttag>&<</firsttag> <secondtag>test</secondtag> <xml> here code. how can avoid being converted? saxparserfactory factory = saxparserfactory.newinstance(); saxparser saxparser = factory.newsaxparser(); myhandler handler = new myhandler(); values = handler.getvalues(); saxparser.parse(x, handler);

javascript - How to make the autocomplete search result contains hyperlinks -

hi doing search box search items in list. when users start type in words, original list fade out, while list of matched items fade in, , items in list contain hyperlinks. this right now, http://jsfiddle.net/x69chen/sbar6/5/ . i using fadein, fadeout change list, , autocomplete feature. this $(".form-search").keypress(function() { $("#nav-list123").fadeout({}); $("#search-result").fadein({}); $("#autocomplete").autocomplete({}}); however, not make hyperlinks search result, seems need customize autocomplete code. have no idea how it. could helps me please? thanks. you can manually open link that: $("#autocomplete").autocomplete({ source: source, select: function( event, ui ) { window.location.href = ui.item.value; //window.open(ui.item.value); // if want open in new tab } });

c# - asp.net mvc data logic structure -

so have bunch of entity models. lots of controllers , views , controllers go , linq query , making available view. however lets have model users and have linq query active users putting in controller might fine if done once, want repeat it, im wondering correct place putting model specific queries. ideally controller says users.getactiveusers() or similar. you should repository pattern. the repository pattern allows abstract database logic , reduce redundancy of common data calls. since formulating linq queries often, why not put them 1 common class? public class userrepository { private readonly _dbcontext mydbcontext; public ienumberable<user> getactiveusers() { // whatever find active users return _dbcontext.where(user => user.active == true); } } now can inject repository controller. public class homecontroller : controller { private readonly userrepository _userrepo; public homecontroller

sql - Counting Policy Ages with a Query in tsql -

i have table containing insurance policies (let's call policies) in 1 field, along policies off of renewed in field: policy_id | prior_policy_id =========================== abc | abd | abc afp | anr | abd brc | afp fkz | i write query count total number of prior policies each policy, result looking this: policy_id | num_prior_policies ============================== abc | 0 abd | 1 afp | 0 anr | 2 brc | 1 fkz | 0 any suggestions appreciated. you need recursive cte this: with cte ( select p.policy_id, 0 num_priors policies p prior_policy_id null union select p.policy_id, 1 + cte.num_priors cte join policies p on p.prior_policy_id = cte.policy_id ) select * cte; here sql fiddle showing working.

Node.js & avconv — real-time video conversion -

i'm working on real-time video conversion demo app. video file parsed node-multiparty , file's part piped avconv.stdin , when processed, chunk pipes write stream . here's part of source code: var form = new multiparty.form(), args = ['-i', 'pipe:0', '-f', 'webm', 'pipe:1'], avconv = spawn('avconv', args), output = fs.createwritestream(filepath); form.on('part', function (part) { if (part.filename) { part.pipe(avconv.stdin); part.on('end', function() { console.log('===== video has been uploaded! ====='); avconv.stdin.end(); }); } }); avconv.stdout.pipe(output); i'm interested in end event attached file's part . event should fired when part parsed, means has been uploaded. i have test video file (~800kb) , low-level laptop testing. while running test on localhost, end event firing @ end of avconv conversion process, lasts ~15s. 800kb v

ruby on rails - What is the process of creating a joining table which resolves a many-to-many relationship using migrations? -

i understand process can followed create models , migrations in turn create joining table within database resolve many-to-many relationship. instance. if have course table, students table , want create joining table called studies id course , students along data such grade , date started. process doing this? if use generate model command each of above 3 table names, create separate migration of them. if go models , add relevant associations not affect how database created? please give me guidance on steps must take in order create required foreign key relationships here examples? use has_many :through association . set manually. step 1: generate models separately. joining model study contain foreign keys, remember include columns. rails g model course title:string rails g model student name:string rails g model study course_id:integer student_id:integer start_date:date grade:string step 2: set associations: # models/course.rb class course has_many :studies

html - Linking an IMG inserted from CSS to another page when clicked? -

just wanting know if it's possible insert link html page when click image have inserted via css. width : 50%; height : 40px; float : left; background-image:url(buttons/btn_name.png); background-repeat: no repeat; background-size : 100% 100%; for example, when click "btn_name" image when it's displayed in div have inserted into, how link "home" page via css? appreciated. your requirement not clear far understood want make div clickable linked page. if so, there many ways way want this. put css rules in class .link { width : 50%; height : 40px; float : left; background-image:url(buttons/btn_name.png); background-repeat: no repeat; background-size : 100% 100%; } and anchor tag above class name <a class="link" href="page.html">link text</a> if don't want text visible add following property in .link css class text-indent:-9999px; now image linked "page.html". if

design - Collection data modeling in mongoDB -

i want design model profiles interaction, example <-> interact <-> b , interaction contains common fields , b. lets have collection called interactions, have few thoughts in mind , looking best practice solution. separate interaction 2 different documents, 1 each profile { pid:"a id" commonfield1:"" commonfield2:"" .. } { pid:"b id" commonfield1:"" commonfield2:"" .. } pros: fast read cons: each update common field should performed on both of documents maintain 1 document interaction { pids:['a id','b id'] commonfield1:"" commonfield2:"" .. } pros: update common field once cons: tricky read the thing there lot of reading lot of updating , collection should designed lot of millions of documents. common queries in scenarios: retrieve profile interactions update specific profile interaction i leaning second choice relying on multi

Jquery Function, Not quite right -

just need couple of pointers on how i've "messed up" calling function. here's code: $(document).ready(function() { var update = function(element, url) { $('element').fadeout('slow', function() { $('element').load('url'); $('element').fadein('slow'); }); } var refresh_div = setinterval(function() { update(".element-one", "../logs/url-one.txt"); update(".element-two", "../logs/url-two.txt"); }, 5000); $.ajaxsetup({ cache: false }); }); so can see have function (probably faulty) fades out, loads fades in. next, trying call function within setinterval function, did go wrong? element , url variables holding values, not strings use them such $(document).ready(function () { var update = function (element, url) { $(element).fadeout('slow', function () { $(element).load(url); $(element).fadein('slow'); })

eclipse - can't change action menu icon in android app -

it's less can't change it, (since did), , more , issue can't change back. so i'm using eclipse learn android app development. in 1 of tuts on android developer website, says have add own ic_action_search.png file action bar find. (else won't compile). made own goofy looking icon. added it, , it's there. ok. so afterwards, found android design icon pack google. looks better , decided plug in. thought easy. took new file, (with exact same names), , plugged them source folder others were. overwrote other files , have confirmed correct icons in there. when run program using usb debugging on phone though, old icon still there. tried refreshing folders inside eclipse. tried uninstalling app phone , re-installing fresh using usb debugging in eclipse. still no go. i'm worried device stored images somewhere in phone , isn't overriding them on new install. need here. ideas? refresh project f5 go project > clean if doesn't work delete

javascript - Jquery resizeable only works on the recent(last) dynamically created div -

so have small application in clicking button , adding div dynamically. here's jsfiddle . when click "text button" you'll see bootstrap panel being generated. can re-size right or left. but once add panel clicking button again, second 1 (just added) resizeable old 1 not resizeable more. why happening? i want them resizeable. have tried best keep id's unique don't clash or create sort of problem. below javascript code have written button click. var richtextdiv = 0; richtextlink.onclick = function (e) { e.preventdefault(); richtextdiv++; sortable.innerhtml +='<article id="rich_text_' + richtextdiv + '" class="text">' +'<div class="panel panel-info richtext_panel **texts** rich_text_panel' + richtextdiv + '">' +' <div class="panel-heading">' +' rich text' +' <but

php - How to store the sql result into a variable? -

why isn't working me: $item_id = "select item_id items item_id=(select max(item_id) items)"; i'm trying insert sql query result variable item_id . if write echo"$item_id"; sentence in between quotes output. you must have connection out var , need fetch array try this: // connection data // $link = mysql_connect("localhost", "youruser"); mysql_select_db("yourdb", $link); // select // $result = mysql_query("select yourvalue yourtable", $link); $row = mysql_fetch_array($result) your item var $item_id = $row ["yourvalue"] regards

sql - MySQL if where not found then insert -

as appear classic "on duplicate key update" question - not. i have table meta values goes like: meta_id | user_id | meta_type | meta_value thing there can more entries same user_id && meta_type must not repeat entries same user_id && meta_type && meta_value . add unique index these, afraid of 1 thing - meta_value longtext contain larger data. so when want create unique key (so use on duplicate key update), error: #1170 - blob/text column 'meta_hodnota' used in key specification without key length and when tried add limit popped out: #1071 - specified key long; max key length 767 bytes that low possible entry. question how key work: it saying how long part of column mysql check duplicity , not modify posibility of having max. column value size (max(longtext)) note: care tripple duplicity smaller entries, dont care duplicity big entries (not in place) it cutting possibility of having max. column value size

postgresql - Converting the result of a dynamic query to json -

i'm trying convert dynamic query result json , return json result of function (this simplified version, where clause in actual code considerably longer). create or replace function get_data_as_json(tbl regclass, p_version_id integer) returns json $$ begin return to_json( execute 'select * '|| tbl || ' version_id = p_budget_version_id' ); end; $$ language plpgsql; however, code results in type "execute" not exist error. how run dynamic query, , convert result json? if returning setof you'd need use return query execute construct, producing dynamic query returns want. since you're not, use regular execute ... into variable return. untested, in vaguely right direction: create or replace function get_data_as_json(tbl regclass, p_version_id integer) returns json $$ declare my_result json; begin execute format('select to_json(*) %i version_id = p_budget_version_id',tbl) my_result

javascript - Opacity colors in Highcharts (with default color) -

in highcharts there possibility add color series. particular data in series, has color: 'rgba(150,100,50,0.5)' series: [{ name: 'tokyo', data: [95.6, 54.4] }, { name: 'new york', data: [106.6, 92.3] }, { name: 'london', data: [59.3, 51.2] }, { name: 'berlin', data: [46.8, 51.1], color: 'rgba(150,100,50,0.5)' }] however, want tell highcharts set opacity in particular data. want use default color use. can that? as can see in demo code in gradient fill can customize colors want use. can put rgba colors here.

GATE annotation counting -

i trying figure out way of counting annotations in gate e.g. if have annotations occurring multiple times in text document , if want count it, there sort of plugin can me? thanks another option use groovy script. code here : sum = 0 docs.findall{ // documents loaded def filteredannots = it.getannotations("filtered") num = filteredannots["anatomy"].size() sum += num println it.name + " " + num // or print file here } println "total:" + " " + sum you can put code in groovy plugin (pr) , run part of pipeline, described here .

javascript - how to insert upload fileurl as image into ckeditor by jquery -

hey guys trying populate uploaded image ckeditor getting image outside of ckeditor. me set of codes below! many thanks!! heres ck editor: @html.textareafor(model => model.questioncontent, new { @id = "ckecontent" }) <script type="text/javascript"> ckeditor.replace( "ckecontent" ) window.onload = function () { var sbasepath = '@url.content("~/content/ckeditor/")'; var ofckeditor = new fckeditor( "ckecontent" ); ofckeditor.basepath = sbasepath; ofckeditor.height = 300; ofckeditor.replacetextarea(); }</script> heres set of jquery call image <script type="text/javascript"> $(function() { $("#browser").click(function() { var ckfinder = new ckfinder(); ckfinder.selectactionfunction = function ( fileurl ) {

java - How can I switch between jpanels? -

Image
i'm still new java programming, please me correct mistakes might have overlooked or give tips on how improve program. okay, lot of problems have been solved, , have cardlayout, still have questions how should make pipes show inside it. when tried add in refresh rate timer , speed timer, have problems how need declare , initialize boolean variables. also, when compile , run game, files such game$1.class . there way me clean up, , explain why happens? these have affect on finished product? (when game compiled , packaged jar.) i want set playerisready true when play button clicked. , there, when if statement true, switch panel displays pipes, , start moving pipe across screen. preferably 3 instances of pipe, each starting @ different times, whatever can fine. some of code needs work, have commented parts out , left notes. my other questions game can found here . this current code game.java import java.awt.*; import java.awt.event.actionevent; import java.awt.ev

json - combobox databinding by JsonConvert in winforms C# -

i had set properties of combobox in designer. combobox property datasource : dataset_code displaymember : table1.code_desc combobox work use data bounding items : check datasource : dataset_code show member : table1.code_desc value member : table1.code_value in winform.cs code //1. code don't shows combobox item table1 = jsonconvert.deserializeobject<datatable>(jsonarraycolletion.tostring()); //2. code shows combobox item datarow dr; dr = table1.newrow(); dr["code_desc"] = "one"; dr["code_value"] = "1"; table1.rows.add(dr); do know reason?

encoding - PHP: Need the lightest/most-efficient way to generate a signature from a string -

quick summary/straight point: what's lightest , fastest way convert large block of html code/text/data short signature string? i tried $data_signature = md5($htmloutput); where $htmloutput html formatted table w/ 100 rows of name, age, address data.. , resulted in nice short string: $data_signature = 'e33fbcb944648eca3d5ce9ed69bfd3cc1391648400'; w/c need, since app running every second (data refresh) interested know if there's better way of doing this, has minimal processing impact on server (if ever md5 processor hungry - dont know) .. or "ok" already? worth noting: not need safety/encryption, need way create signature of output comparative purposes. details (just wondering) i have web app (jquery) loading json data php. json data coming 2 objects: status="ok" output= html formatted output (rows of divs etc) the web app reloads data php every second... , writes html output div on page = typical. but make app more effi

What is the UML version supported in visio 2010? -

i trying find out uml version in microsoft visio 2010 cannot find information. did not download 2.2 template, used default uml model diagram under software , databases. visio nice instrument drawing diagrams. if need draw pretty diagram, know nothing better. not modelling, because doesn't support diagrams cooperation or checking. you can draw correct up-to-standard uml diagram in visio , because can draw diagram there. can create beautiful diagram not correct. it never supported real standard , inner microsoft logic. so, if want impress high manager beautiful picture, visio choice. has presentation possibilities, read. not work of , programmers. the tool tries standard , maybe it, , free, eclipse papyrus. raw yet. of proprietary ones closest standard ea of sparx. month had choose tool , had compare. hard go these ugly thingies after pretty visio, have to. because work real code , coders. if need modelling on high, common levels, visio better, because needn't

having trouble in get authentication twitter API with R -

first of all, i`m not english speaker. please understand if make wrong expression. i`m trying authenticate twitter api using r i follow instruction on internet. doesn`t work. error messages keep appear on screen library(twitter) library(roauth) library(rcurl) library(bitops) library(digest) library(rjson) consumerkey = "mykey" consumersecret = "mysecret" requesturl <- "url" authurl = "url" accessurl = "url" twitcred <-oauthfactory$new(consumerkey=consumerkey,consumersecret=consumersecret,requesturl=requesturl,accessurl=accessurl,authurl=authurl) error in envrefsetfield(.object, field, classdef, selfenv, elements[[field]]) : ‘consumerkey’ not field in class “oauth” somebody tell how figure out??

How do I convert this Time integer to a Date in Ruby? -

this question has answer here: how convert unix timestamp (seconds since epoch) ruby datetime? 6 answers i'm getting stamp external api: 1391655852 and need convert date. have seen lot of conversion pages on internet , on so, seem going other way. i'm not familiar integer format @ all. why not duplicate question * this question should not marked duplicate because referenced question mentions seconds since epoch . while number looking for, had no idea called that. judging quick up-votes , favorite 40 views in less 1 week, judge seconds since epoch time format not universally known among programmers. users benefit question being asked both ways. use time.at this: t = time.at(i)

c - getenv returns null when asked for the username? -

i want username using stdlib functio getenv () however null here code have written: #include<stdio.h> #include<stdlib.h> main() { char *hai; printf("the current user name is\n"); hai="user"; printf("%s\n",getenv(hai)); exit(0); } does value getenv () returns depends on machine using compile code, , why value returned null ? on windows, you'll need use getenv("username") . user / username environment variable not standardized, , won't find environment variable named user on windows unless set yourself.

Programming Game of Life in C - Issue with bitwise operations -

i'm trying program conway's game of life in c stumped how store alive or dead cell. the board stored in array of 32 unsigned longs (32x32 board) each bit representing cell (1 = alive, 0 = dead). can't change design. so far, have code determining how many neighbors particular cell has need change state based on game's rules (a 1 may need become either 0 or 1, 0 may need either 1 or 0). i assume can use bitwise operations (|, &, ^) don't know how isolate particular bit in row , store iterate through rest of row , store new, re-calculate row 1 unsigned long. i.e. if 10011...0 needs 01101...1. how can this? i realize code need additional loops trying wrap head around particular problem before proceeding. any appreciated. #include <stdio.h> #include <stdlib.h> unsigned long columnmask; int compass = 0; int totaliveneighbors = 0; int iterator = 0; int iterator2 = 0; #define array_size 32 #define neighbors 8 unsigned long grid[array_size

jquery - BlueImp fileuploadsubmit serializeArray() sends 1 character response -

with successful upload blueimp fileupload plugin, forms other data submitted well, however, json data response i'm receiving firebug shows response each input field truncated 1 character (byte?). expected response? using jquerymobile , blueimp fileupload plugin. please see specifics: var formdata = $('#uploadform'); console.log( formdata.serializearray() ); result console.log [object { name="image_name", value="don"}, object { name="image_description", value="testing"}, object { name="image_keywords", value="musician actor artists"}, object { name="image_nudity", value="0"}, object { name="cat_id", value="42"}, object { name="action", value="uploadimage"}] post response blueimp fileuploadsubmit {"files":[{"name":"image2.jpeg","size":114688,"type":"image/jpeg",&q

jquery - PHP: How do I get the middle of my $_GET variable? -

i have $_get variable combination of md5('currentdate') + id + encrypted random string. this, can secure url somehow. example url: create_pdf.php?goto=qredit&qrid=1e02b73e2b1cb88685499f38508cf6e84317e62166fc8586dfa4d1bc0e1742c08b ^^ i need middle of $_get['qrid'] variable, in case 43 . tried using substr() don't desired result. update: here's how yield $_get variable. <a href="create_pdf.php?goto=qredit&qrid=<?php echo md5($today).$_get['qrid'].md5($_get['qrid']); ?>" target="_blank" id="upload_button">-random whatnot-</a> assuming first , second strings fixed 32 characters, try retrieve id value string: // characters last 32 chracters, starting @ 32nd character $id = substr($_get['qrid'], 32, strlen($_get['qrid'])-64);

javascript - Removing row from table results in TypeError -

i have reactjs html table component , update content (cell values) setstate method. here basic code: var cell = react.createclass({ render: function () { return (<td>{this.props.cellvalue}</td>); } }); var row = react.createclass({ render: function () { return (<tr>{this.props.row}</tr>); } }); var table = react.createclass({ getinitialstate: function() { return { data: this.props.data }; }, render: function () { return ( <table> { this.state.data.map(function(row) { var r = row.map(function(cell) { return <cell cellvalue={cell}/>; }); return (<row row={r}/>); }) } </table> ); }}); you use this: var initialdata = [[1,2,3],[4,5,6],[7,8,9]]; var table = react.rendercomponent( <table data={initialdata} />, document.getelementbyid('table') ); this working of time. can

YIi Active Record selecting fixed fields -

i using active record queries below fetching records query below selects possible columns. wanted select 2 columns ( firstname, lastname ) profile::model()->findbyattributes(array('id'=>'1')) to select firstname below works, how can add lastname select in statement without using cdbcriteria. $first = profile::model()->findbyattributes(array('user_id'=>'1'))->firstname second, have used relations lazy load records , when needed , there selecting fields needed improve performance overall. without using cdbcriteria, can below $first=profile::model()->find(array( 'select'=>'firstname,lastname', 'condition'=>'user_id=:uid', 'params'=>array(':uid'=>1), ));

java - Add touch gestures to legacy swing application -

i have legacy swing application need add touch gestures to,specifically pinch zoom , touch , drag. i tried swingnode of jdk 8 , can run swing application there, display performance cut more 50% won't work. swingtexturerenderer in mt4j has same issue , without trying redispatch touch events mouse events. i thought glass pane approach using javafx layer on top , capturing touch events , attempting dispatch them mouse events swing app underneath. does have alternative approach? target platform windows 8. bounty coming stackoverflow opens up. need 1 pretty rapidly. edit: here tried swingnode (the mouse redispatch didn't work). swingnode stuff might distraction best solution ignore if have better idea getting touch swing: @override public void start(stage stage) { final swingnode swingnode = new swingnode(); createandsetswingcontent(swingnode); stackpane pane = new stackpane(); pane.getchildren().add(swingnode); stage.setscene(new scene(pane,

php - can't get file content for url when grab latitude and longitude -

i want convert given postcode latitude , longitude integrate in cart project. when try grab latitude , longitude google api showing error like, "we're sorry... ... computer or network may sending automated queries. protect our users, can't process request right now." what wrong code? code shown below. function getlatlong($code){ $mapsapikey = 'aizasyc1ky_5lfnl2zq_ot2qgf1vjjtgybluyko'; $query = "http://maps.google.co.uk/maps/geo?q=".urlencode($code)."&output=json&key=".$mapsapikey; //--------- // create new curl resource $ch = curl_init(); // set url , other appropriate options curl_setopt($ch, curlopt_url, $query); curl_setopt($ch, curlopt_header, 0); // grab url , pass browser $data = curl_exec($ch); // close curl resource, , free system resources curl_close($ch); //----------- //$data = file_get_contents($query); // if data returned if($data){ // convert readable format $data = json_decode($data

python algorithm for prime numbers -

assume availability of function is_prime . assume variable n has been associated positive integer. write statements needed find out how many prime numbers (starting 2 , going in increasing order successively higher primes [2,3,5,7,11,13,...]) can added before exceeding n . associate number variable k . def main(): n=int(input('n: ')) k=0 i=2 sum=0 while sum<=n: if is_prime(i): sum+=i i+=1 k+=1 print(k) def is_prime(n): divisor in range(2,int(n**0.5)+1): if n/divisor==int(n/divisor): return false return true main() would appreciate pointers. i modified code little bit , working fine program grades these codes says should using + sign where. have no idea. modified code is: while sum<=n: if is_prime(i): sum+=i k+=1 i+=1 print(k) output: n: 10 i: 2 2 i: 3 5 when should go upto i=5 , total =10

way to fetch column from mysql in Hibernate, Spring mvc web application -

//this query can used list of paymentattribute whicch payment details not null @query("select p.paymentdetailname paymentattribute p p.entityid=?1 , p.entitytype=?2 , p.paymentdetailname not null") list<string> getnonnullpaymenydetaisname(string entityid,string entitytype); my paymentattribute table contains column entityid, entitytype,paymentdetailsname etc. want fetch paymentdetail column per query stated above . getting error. there way in spring-mvc web applications , via can fetch column rather complete tuples. above code part of repository.

configuration - Hot reconfiguration of HAProxy still lead to failed request, any suggestions? -

i found there still failed request when traffic high using command this haproxy -f /etc/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid) to hot reload updated config file. here below presure testing result using webbench : /usr/local/bin/webbench -c 10 -t 30 targethproxyip:1080 webbench – simple web benchmark 1.5 copyright (c) radim kolar 1997-2004, gpl open source software. benchmarking: targethproxyip:1080 10 clients, running 30 sec. speed=70586 pages/min, 13372974 bytes/sec. **requests: 35289 susceed, 4 failed.** i run command haproxy -f /etc/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid) several times during pressure testing. in haproxy documentation, mentioned they receive sigttou 611 signal ask them temporarily stop listening ports new 612 process can grab them so there time period old process not listening on port(say 80) , new process haven’t start listen port (say 80), , during specific time period, caus

c++ - How to read DICOM file from buffer using MERGECOM tools? -

for reading simple dicom file, use following line. mc_open_file( applid, msgid, &cbinfo, mediatofileobj ); in case if have buffer cbinfo structure filled values, how use function??? i tried adding own function in mediatofileobj, became loop inside that.. how on come issue ? never work on library if need regarding gdcm library can tell you.

c# - Asp.net bug (Showing data during debugging in dataset but the data can not be assigned to Asp.net controls such as Gridview,TextBox,etc) -

asp.net debug mode showing data in dataset asp.net controls not getting able assigned dataset's value asp.net bug (showing data during debugging in dataset data can not assigned asp.net controls such gridview,textbox,etc) txttodate.text = ds.tables[0].rows[0][0].tostring(); //not assigning value textbox , yes data present @ ds.tables[0].rows[0][0].tostring(); i have added code in question. fyi, data in data table coming textfile , textfile created local drive , coming ftp server. when use textfile residing on local drive (older files) there working fine , controls such textbox showing data check update panels, button may in update panel , textbox may not there. if not solve question need give aspx file.

php - Laravel 4: Publishing a Package's Assets -

how publish package assets? i've found tutorial here: http://laravel-recipes.com/recipes/279 but when tried publish assets workbench, error: [runtimeexception] unable publish assets. asset:publish [--bench[="..."]] [--path[="..."]] [package] my command code is: php artisan asset:publish --bench=mypackage how can package assets published. thank you. when want publish assets developed , stored in workbench should use --bench flag. in case want publish package in vendor folder provide "myvendor/mypackage". publishing assets vendor package php artisan asset:publish "vendor/package" publishing assets workbench package php artisan asset:publish --bench="vendor/package"

ios - What is your way of cleaning up image resources in a project -

i'm doing huge cleanup in project, getting rid of old image resources. way go through every resource , search code match on resource name. how do it? i found quite helpful: tool finding unused images within excode project

nlp - How to configure arabic language POS tagging in stanfordNLP -

i have arabic pos tagger libs. able run english. not find configuration options setting arabic tagger or enable arabic pos tagging. please help. you can download arabic model http://www-nlp.stanford.edu/software/tagger.shtml - choose full version , works :)

c - Incoming array values into local registers? -

if have looks this: void func (unsigned long arr[]) { } in assembly, how values in arr[0] , arr[1] local registers , pass arr out? this tried: func: save %sp, -(92 + 8) & -8, %sp ! save 8 bytes st %i0, [%fp-8] sll %g0, 2, %l0 add %l0, -8, %l0 ld [%fp+%l0], %l0 ! value of arr[0] should in %l0 .......... ! similar load arr[1] ld [%fp-8], %i0 this didn't work. can tell me i'm doing wrong?

iphone - How to use multiple UIAlertView inside one IBAction with different button? -

is possible show different alerts different buttons in same ibaction based on different conditions?? have code in ibaction: - (ibaction)btnrecommendationtapped:(id)sender { uialertview *alert = [[uialertview alloc] initwithtitle: @"recommendation" message: @"it seems interested in %d of collection." delegate: nil cancelbuttontitle: nil otherbuttontitles: @"yes", @"no", nil]; [alert show]; } i have alert shows "sorry! unable provide recommendation" ok button. when condition has fulfilled shows 1 in ibaction otherwise shows one. -(ibaction)buttonclicked:(id)sender { if([sender tag]==0) { uialertview *alert = [[uialertview alloc]initwithtitle:@"button 1 clicked" delegate:self

javascript - Jquery ajax running twice -

so, have problem. using plugin named jrating, esentially rating system in jquery. problem is, onclick , ajax request fires twice . after searching lot, tried things: i checked , double checked $(document).ready(function(){} , jquery shortcut $(function() {}); not twice in page. i checked id of call unique. so, here code: jquery: $("#rating").jrating({ step:true, length : 5, canrateagain : true, nbrates : 3, onclick : function(element,rate) { var data = (rate, 1); $.ajax({ url: 'application/index/rate', type: 'post', datatype: 'x-www-form-urlencoded', async:false, contenttype: 'application/x-www-form-urlencoded', data: rate, success: function () { console.log('submit wor

java - Android and JNI, pipe data to FFmpeg -

i'm trying create metadata retriever based on ffmpeg. since raw android application resources accessible using file descriptor need way pipe data ffmpeg via jni. know ffmpeg supports "pipe" protocol: unix pipe access protocol. allow read , write unix pipes. accepted syntax is: pipe:[number] number number corresponding file descriptor of pipe (e.g. 0 stdin, 1 stdout, 2 stderr). if number not specified, default stdout file descriptor used writing, stdin reading. example: cat test.wav | ffmpeg -i pipe:0 my question is, how programmatically emulate cat test.wav | ffmpeg -i pipe:0 using jni , avformat_open_input using filedescriptor ? possible? people androidffmpeg project implemented "jni://" protocol stream data via jni, see https://github.com/appunite/androidffmpeg/blob/master/ffmpeglibrary/jni/jni-protocol.c i not know how it's used, came across file , saw question. think use same solution. you may want @ post: https://stacko

shell - How to add Terminal Object in your Website? -

website koding , codeschool , cloud9 , many others have ability access server via terminal. is terminal application in sandbox? how did that? read this the terminal access can provided having client server mechanism. here server running @ linux machine , client browser. server executes command on behalf of client. take @ ajaxterm

command line - How to find out if Windows installer is busy or not using delphi? -

i have windows service restarts windows in specific events have problem it. don't want restart windows when installing programs using windows installer. so how can fine out whether windows installer busy installing or not. any delphi or command line function acceptable. will please me ? i found these 2 classess don't know how use them. class1 class2 based on this article , quite outdated i've tried implement both suggested options. second 1 worked me on windows 7 sp1. principle query msiserver service status , check, if service running , accepts service_accept_stop control code. here's function wrapper that: uses winsvc; function iswindowsinstallerbusy: boolean; var service: sc_handle; servicemgr: sc_handle; servicestatus: service_status; begin result := false; servicemgr := openscmanager(nil, nil, sc_manager_connect); if servicemgr <> 0 try service := openservice(servicemgr, 'msiserver', service_query_sta

java - how to do auto minimize in swing -

i testing code using jwindow , hide jframe, have create minimize, maximize , close buttons user friendly. how can set state frame when click on created buttons. see jframe#setstate . can do: myframe.setstate(frame.iconified) as implementation of listener of buttons.

Oracle hierarchical query join to selection of all decendants -

i trying retrieve list of each descendant each item. not sure making sense, try , explain. example data: id | pid -------- 1 | 0 2 | 1 3 | 1 4 | 1 5 | 2 6 | 2 7 | 5 8 | 3 etc... the desired results are: id | decendant -------------- 1 | 1 1 | 2 1 | 3 1 | 4 ... 2 | 2 2 | 5 2 | 6 2 | 7 3 | 3 3 | 8 etc... this being achieved using cursor move through data , inserting each descendant table , selecting them. i wondering if there better way these, there must way right query bring desired results. if 1 has ideas, or has figured out before appreciated. ordering not important, nor 1 - 1, 2 -2 reference. cool have it, not crucial. select connect_by_root(id) id, id decendant table1 connect prior id = pid order 1, 2 fiddle

objective c - Enforcing to supply a completion block -

i'm wondering whether or not practice: i have method takes in parameters , callback block, let's along lines of: -(void)loginwithusername:(nsstring *)username andpassword:(nsstring *)password withcompletion:(loginmanagercompletionblock)completionhandler; now in specific case, there no use in calling method without completion handler, triggers redundant call login web service (also, not change state of - not client side nor server side). avoid these situations actively enforcing requirement of passing me completion block in order make web service call. sort of think of "@required" method in objective c protocol. questions are: is requiring completion block in order perform action practice in objective c? (edit: answered) how enforce requirement? there built-in language syntax can me out here? thanks you can use function attribute nonnull(params) , params 1 or more comma-separated parameter numbers, indicate parameter should not null ( nonnull

google api - GoogleApps java client information -

i in way of writing java client on googleapps managing users , groups.i worked on provisioning api , deprecated. info, admin sdk's directory api need used. went links given couldnt find sample client start working on directory api. please guide me on info or sample client start with thanks you right. there no (admin sdk) directory api sample follow ( list of api samples ) if i'd follow service account sample code (i guess it's need use) then can learn how client library works looking @ other samples , use following directory api reference edit: example of user password reset: user user = service.users().get(username + '@' + domainname).execute(); user.sethashfunction("sha-1"); user.setpassword(digestutils.sha1hex(newpassword)); service.users().update(username + '@' + domainname, user).execute();

c# - Error while installing Facebook.Client library -

i'm developing windows 8 facebook built in app in visual studio 2013. need insert login button app in order use facebook features... use facebook sdk .net , trying install facebook.client package using nuget console (install-package facebook.client -pre) annoying error: install-package : not install package 'facebook.client 0.8.5-alpha'. trying install package project tar gets '.netframework,version=v4.5', package not contain assembly references or content files compatible tha t framework. more information, contact package author. @ line:1 char:1 + install-package facebook.client -pre + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [install-package], invalidoperationexception + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.powershell.commands.installpackagecommand i tried change framework 4.0 (from 4.5) still same error.... must updated nuget latest version. thank's helping, gal.

asp.net - gridview cannot shown the item for shopping cart -

i creating shopping cart using asp.net i following tutorial i've found online, http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/shopping-cart . i'm using gridview view cart after i've added in. however, don't know why, when add item, doesn't show in grid view. i did calculation, adding items together. calculation show. it's item in grid view doesn't seems showing. can tell me what's wrong? here error code i've received @ system.web.ui.databinder.getpropertyvalue(object container, string propname) @ system.web.ui.databinder.eval(object container, string[] expressionparts) @ system.web.ui.databinder.eval(object container, string expression) @ system.web.ui.webcontrols.boundfield.getvalue(control controlcontainer) @ system.web.ui.webcontrols.boundfield.ondatabindfield(object sender, eventargs e) @ system.web.ui.control.ondatabinding(eventargs e) @ system.web.ui.control.databind(boolean

hash - How to compare two text files with value in ruby -

i have 2 text file, , have 1 same field(pet). want combine 2 file , output new file contain 3 fields(owner pet buyer). code depends on if both file have same pet(name , number of pets) add name of buyer field of buyer in new file. should print out if 2 file have same filed of pet. but code did not work want, need help, thanks. input_file_1 (.txt) owner pet michael dog, cat john pig, rabbit marry dog, cat input_file_2 (.txt) buyer pet sean cat, dog mark cat, dog joy dog, mouse tina cat, dog i want result this: owner pet buyer michael cat, dog sean, mark, tina mary cat, dog sean, mark, tina my code looks this: input_file_1 = argv[0] input_file_2 = argv[1] hash_1 = {} file.readlines(input_file_1, "\n").each |line| owner, pet = line.chomp.split("\t") hash_1[owner] = pet end hash_2 = {} file.readlines(input_file_2, "\n").each |line| buyer, pet = line.chomp.split("\t") hash_2[buyer] = pet end hash_1.each |key, value|

android - I dont find google-play-services_lib version 4.2.34 -

i wanna find google-play-services_lib library least version 4.2.34. because develope chromecast feature. cant find that. sdk manager in eclipse, revision 14..:( by country ever deployed sequentially on? thanks. i fired sdk manager , found in sdk version of google play services in 14. also, there no sign of update in 'status' column. so, don't know why want 4.x.x, latest version, of today, 14

Localization of Windows Pathname in Python or PyQT -

i seaching days solution can't find anything... hope can help. i need translated windows path in python. c:\programdata\microsoft\windows\start menu\programs\accessories\calculator.lnk is in windows explorer on german systems: c:\programdata\microsoft\windows\startmenü\programme\zubehör\rechner.lnk i need translated path/file name in python or pyqt - if use e.g. os.walk() gives me real (untranslated) file names - correct usage in special case need translated file/folder names... thank much the windows api shgetlocalizedname . this new function (windows vista onwards), , not seem available in pywin32 . however, can wrap function using ctypes module if there's not ready-made solution available.

android - Text to Speech Locale Hindi Indian -

i've created text speech engine android supports many languages, 1 of hindi. in android text speech settings, when user selects default locale, android number of checks including sending intent action_get_sample_text here list of supported locales: private static final string[] supported_languages = { "eng-gbr", "eng-usa", "fra-fra", "spa-esp", "deu-deu", "ita-ita", "kor-kor", "nld-nld", "dan-dnk", "fin-fin", "jpn-jpn", "nor-nor", "pol-pol", "por-prt", "por-bra", "rus-rus", "swe-swe", "zho-chn", "zho-hkg", "zho-twn", "ara-sau", "hi-in", "ces-cze", "ell-grc", "hun-hun", "ron-rou", "slk-svk", "tha-tha", "tur-tur", "cym-gbr", "isl-isl", "in-i

ssas - MDX query with multiple filters using OR -

i have following mdx query have been asked extend: select {} on columns, crossjoin( [waterbody].[waterbody code].[waterbody code], [waterbody].[waterbody name].[waterbody name], [waterbody].[waterbody type].[waterbody type], filter([waterbody].[waterbody full name].allmembers,instr([waterbody].[waterbody full name].currentmember.member_caption,'test waterbody name')>0) ) on rows [waterbody data] there column called "waterbody name" , need return rows the given value in either "waterbody full name" or "waterbody name". i'm handy enough @ sql mdx stuff new me. spent large part of yesterday trying different things got nowhere. i'd appreciate help. thanks john just put members want return set (noted curly braces), , that's it. no need filter : select {} on columns, crossjoin( [waterbody].[waterbody code].[waterbody code], [waterbody].[waterbody name].[waterbody name], [waterbody

html - First option in a dropdown shows blank in IE9 -

i came across strange error in ie9. here drop down code: <select> <option>1</option> <option>2</option> <option>3</option> </select> if don't mention 'selected' first option of dropdown, still gets selected across other browsers except ie9. works in ie8. is bug or have mention 'selected' first option?? could me please?? yes should mention select first option. otherwise, shows option not selected.

javascript - How to display JSON single level menu -

i have json file link images specific folder this ["http://img1.png","http://img2.png","http://img3.png","http://img4.png"] and want create <ul> list don't know how. can me small example? thanks using json can connect http://shared1.ad-lister.co.uk/getimageslist.aspx?contextid=c9d56aca-506c-40be-9068-037d0fba62c9&folder=_design/car-marques $.post("http://shared1.ad-lister.co.uk/getimageslist.aspx?contextid=c9d56aca-506c-40be-9068-037d0fba62c9&folder=_design/car-marques", function (json) { var html = '<ul>'; (var = 0; < json.length; i++) { html += '<li><img src="'+json[i]+'" /></li>'; } html += '</ul>'; $('.contents').html(html); });

visual studio 2010 - node-gyp: cannot open input file 'kernel32.lib' -

enviromnent : window server 2008 r2 standard service pack1 build 7601 (64bits) node js: v.0.10.25 (64 bits) npm: 1.3.24 i using visual studio 2010 express. have been trying build module days ... followed wiki on https://github.com/tootallnate/node-gyp/wiki/visual-studio-2010-setup i have have tried visual studio 2010 express + win sdk = cannot open input file 'kernel32.lib' . can produce module, when try use get node server.js module.js:356 module._extensions[extension](this, filename); error: %1 not valid win32 application. i using node v0.10.25 (64bit version) any welcome. i gave , used visual studio 2012. ok now.