Posts

Showing posts from September, 2011

javascript - Stripping content from a website to my website -

i trying make website stream wiki page , take content down page. before saying illegal scrape website, mind wiki site, , under each page of site, there is: content available under attribution-noncommercial-share alike 3.0 unported. meaning free use , reuse info provided me. this wiki page: http://wiki.mabinogiworld.com/ basically trying make website take server online status table directly , put webpage, @ same time want keep updated, have re-get table next time webpage refreshed. with this, faced cross domain issue , found related yql seems able me, still cant figure out. this did far: yui().use("yql", function (y) { var query = 'select * html url="http://wiki.mabinogiworld.com/" , xpath="//div/table"'; y.yql(query, function(results) { var temp; var size = 0; temp = results.query.results.table; size = temp.length; (var = 0; < size; i++) { //loop

login - ruby conjunction and union operators -

this question has answer here: difference between “and” , && in ruby? 6 answers so have (accidentally) discovered ruby allows following syntax: if foo , bar or if foo or bar . how (if @ all?) different from if foo && bar if foo || bar are operators different? how? are operators different? yes per operator precedence. how? for more information see difference between “and” , && in ruby? , difference between “or” , || in ruby?

linux kernel - Undefined Instruction handler -

i need handle undefined instruction exception in loadable kernel module. use register_undef_hook(&my_undef_hook) in module initialization. have such compile error: ... building modules, stage 2. modpost 1 modules warning: "register_undef_hook" [/home/user/my_driver.ko] undefined! warning: "unregister_undef_hook" [/home/user/my_driver.ko] undefined! ... i wonder, can use these functions in kernel modules? these functions not exported (aka, there no export_symbol(register_undef_hook)) not usable in modules code. you have more details here

windows - Batch Make 100MB Archive max with all files contained into a folder (Recursive) -

i looking create program zip (using 7zip) files contained folder (recursivly) archive until archive hits 100mb. whenever does, join in .csv file associated file, delete it, create new 1 next number , create new archive. should until files archived archive (number doesn't matter long files added archive) my example not considering files inside sub-folders yet. (yeah, gotta start somewhere) the example little counter-logical, remove last added file archive once sees it's bigger 100mb. problem is, don't think batch can evaluate output of archive before creating it, therefore it's little workaround. way manages find size of archive , afterwards determine if it's ok go or if done one. i'm doing because need zip files being maxed out 100mb. doesn't matter if 10 or 20 .zip files, matters none bust 100mb. after we'll use output archives , upload them archive all. as can see echo name,type,file,event newer file because headers required .csv file. requ

How to get hyperlinks in BIRT report viewer -

Image
using birt 4.2 my database (postgresql) has many fields hyperlinks in , when displaying reports via birt report viewer, fields have hyperlinks displayed normal text in birt report viewer. want hyperlinks retained @ birt report viewer. how can achieve this. please suggest. select corresponding cell , go hyperlink property , click on edit , select uri radio button , click on javascript syntax button , find column bindings select value of column , hyperlinks

android - Scrolling down a scrollView slowly -

i've tried use scrollby , scrollto, scroll fast. there way can decide speed @ scrollview scrolls? you can try pass in interpolator adjust speed. subclass interpolator class create whatever function adjust speed by. edit: hmm, assumed there easy way in scrollview since it's constructor argument scroller object. might want scrolling scroller object using whatever interpolation choose. i'll try find more.

asp.net mvc 4 - How to explicitly deactivate Razor code -

i follow pattern quite bit using razor: @if (model.isalreadyconfirmed) { account has been confirmed. } but doesn't work because it's expecting code. i'm forced this: @if (model.isalreadyconfirmed) { @html.raw("this account has been confirmed.") } or this: @if (model.isalreadyconfirmed) { <span>this account has been confirmed.</span> } also, feel free correct improper use of jargon. @if (model.isalreadyconfirmed) { <text>this account has been confirmed.</text> } there special tag called text prints out put in it. actual tag omitted in rendered html.

Shuffle multiple javascript arrays in the same way -

i've got 2 arrays var mp3 = ['sing.mp3','song.mp3','tune.mp3','jam.mp3',etc]; var ogg = ['sing.ogg','song.ogg','tune.ogg','jam.ogg',etc]; i need shuffle both arrays come out same way, ex: var mp3 = ['tune.mp3','song.mp3','jam.mp3','sing.mp3',etc]; var ogg = ['tune.ogg','song.ogg','jam.ogg','sing.ogg',etc]; there's few posts on stackoverflow shuffle arrays in different ways-- this 1 pretty great --but none of them demonstrate how shuffle 2 arrays in same exact way. thnx! add argument fisher-yates shuffle. (assumes arrays equal length) var mp3 = ["sing.mp3", "song.mp3"]; var ogg = ["sing.ogg", "song.ogg"]; function shuffle(obj1, obj2) { var index = obj1.length; var rnd, tmp1, tmp2; while (index) { rnd = math.floor(math.random() * index); index -= 1; tmp1 =

html - Email images not lining up out look 2007/10 vs everything else -

i've checked out few posts, , tried them. didn't work. may become decision , tell clients is, don't want come that. so after testing litmus, main issue borders(left , right) vs top , bottom image not lining correctly on outbook 2007/10 vs else. <body> <style type="text/css"> body{ color:#415b7c; font-family:helvetica, arial, sans-serif; font-size:12px; padding:0; margin:0; } table {border-collapse: collapse;} </style> <table width="100%" bgcolor="#ffffff"> <tr> <td><!-- header --> <table width="600" align="center" cellpadding="0" cellspacing="0"> <tr valign="bottom"> <td> <table width="600" align="left" cellpadding="0" cellspacing="0" style="border-collapse:collapse;"> <tr><td>

android - Background of my custom button isn't transparent -

i created custom button , saved .png transparant background. code in xml <button android:id="@+id/btnreport" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" android:drawabletop="@drawable/report" /> and when run in emulator button grey background (i cannot post images yet, because reputation low. apologies this) how make background transparant? thanks. vincent you should doing android:background="@drawable/report"

javascript - How to check IF user has ALREADY liked the facebook page -

i used facebook after liked redirection code . cant find solution user liked. if user liked redirect page. the code <script type="text/javascript"> window.fbasyncinit = function() { fb.init({appid: 'xxxxxxxxxxxxxxxxx', status: true, cookie: true, xfbml: true }); fb.canvas.setsize({ width: 400, height: 80 }); fb.event.subscribe('edge.create', function(response) { alert('thank you'); // put redirect code here eg window.location = "http://www.example.com/facebookautoredirect.asp"; } ); **if liked { window.location = "http://www.example.com/facebookautoredirect.asp"; }** }; //load sdk asynchronously (function() { var e = document.

ios - xcode 4.6 2 textfield equals to 100 -

i'm using xcode 4.6, , have little problem where. in app have 2 text fields 1 says vg , other says pg (the vg , pg equal 100). user able put on each text field percentage amount, lets user inputs on vg text field number 10, automatically pg change whatever number has correct amount equal 100. calculates vg being 1 input , pg showing result, if try other way around, doesn’t work. if user wants change value pg , result on vg text field, show calculation result vg being input. make calculation go both ways. have set floats. -(void)textfieldshoudendediting (uitextfield *)textfield { float = [vg.text floatvalue]; float b = [pg.text floatvalue]; float result1 = (100 – a) pg.text = [nsstring stringwithformat:@”%.0f”, result1]; floar result2 = (100 – b) vg.text 0 [nsstring stringwithformat:@”%.0f”, result2]; } thank you you need test textfield parameter see 1 being edited. something like: if (textfield == pg) { //update vg } else if (textfield == vg) { //update

google cast - How to interact with RAMP in a custom receiver application for Chromecast -

i've created custom sender , receiver applications chromecast. sender should sending url (dash mpd) on wire. receiver should create video element , upon receiving dash mpd url create files interact video element. on sender i'm doing this: var request = new cast.launchrequest(app_id, receiver); request.parameters = params; cast_api.launch(request, onlaunch); followed by: var request = new cast.medialoadrequest("http://dash.edgesuite.net/envivio/dashpr/clear/manifest.mpd"); request.parameters = params; cast_api.loadmedia(cv_activity.activityid, request, onload); then in receiver have: var receiver = new cast.receiver.receiver(app_id, [cast.receiver.remotemedia.namespace]); var ramphandler = new cast.receiver.remotemedia(); ramphandler.addchannelfactory(receiver.createchannelfactory(cast.receiver.remotemedia.namespace)); ramphandler.onopen = onopen; ramphandler.onmessage = onmessage; ramphandler.onload = onload; ramphandler.oninfo = oninfo; ramphandler.

php - Presenting/editing checkbox values? -

hi baffling me because checkboxes in form textboxes also. enter following database new record: <form action="processmem.php" method="post"> <table width="800" align="center"> <tr> <td width="99" height="2">&nbsp;</td> <td width="100" height="2">&nbsp;</td> <td width="100" height="2">&nbsp;</td> <td width="100" height="2">&nbsp;</td> <td width="100" height="2">&nbsp;</td> <td width="100" height="2">&nbsp;</td> <td width="100" height="2">&nbsp;</td> <td width="100" height="2">&nbsp;</td> </tr> <tr>

angularjs - How do I move divs around? -

i have list of elements in html, this: <div>information div</div> <div>div 1</div> <div>div 2</div> <div>div 3</div> what need move information div around dom, appears after whichever div user clicks on. so, if user clicks on div 1 , new dom like: <div>div 1</div> <div>information div</div> <div>div 2</div> <div>div 3</div> this pretty easy jquery, gather direct dom manipulation frowned upon in angular. there way of doing angularjs? to add additional twist, information div should appear above final div, if user clicked div 2 *or div 3 , dom like: <div>div 1</div> <div>div 2</div> <div>information div</div> <div>div 3</div> you have content in ng-repeat. add orderby filter repeat sorts in order specify. add click event change sort order based on rules defined above. orderby: http://docs.angularjs.org/api/ng.fil

gawk - replace first occurrence of text using awk -

the code below replaces first occurrence of apple banana. how achieve same using awk / gawk? sed -i "0,/apple/s//banana/" myfile.txt this come with: awk '!x{x=sub("apple","banana")}7' file for example: kent$ cat f foo apple foo apple apple kent$ awk '!x{x=sub("apple","banana")}7' f foo banana foo apple apple for sed -i (change in place) part, if use gawk 4.1.0, have option too. otherwise, have use temp file.

Frame rate functions in python -

i hoping on piece of python code i've been working on. i'm trying assess frame rate during task on stimulus presentation software python-based. here's have : frame1 = 0.0152 frame2 = visual.getmsperframe(win, nframes = 60, showvisual=false, msg='', msdelay=0.0) frame3 = frame2 - frame1 the problem i'm having "frame2" yields set of numbers. specifically, yield average, median, , standard deviation. because of this, "frame3" crash. there anyway pull out average value out of getmsperframe() output "frame3" run? i'm pretty new programming i'm not familiar stuff. it looks using psychopy module, whihc according it's source code shows getmsperframe() returns: return mspfavg, mspfstd, mspfmed #, msdrawavg, msdrawsd, msfree the hash sign ( # ) comment in python means returned values tuple. can access desired value same way wold if return value array so: >>> print(getmsperframe()) (123, 90, 1

Uses for C# generics besides collections -

i read on msdn generics useful creating collections. pretty new c# , wondering if there cases of when use generics purposes other collections. if there provide example illustrate argument. generics feature major aims promote code reuse , type safety, concepts applicable broader segment of code collections. it easy see code reuse , type safety go hand-in-hand collections: linq uses generics provide algorithms can operate on type of enumerable sequence (code reuse) , various generic collection classes use generic type information provide type safety (e.g. program trying add int list<string> not compile). that said, there many more opportunities leverage generics. example, factory can use generics type safety: class factory { // can create type of widget, not allow e.g. create<string>() public widget create<t>() t: widget { ... } }

csv - Resume the previous aborted COPY in CQL -

when importing large csv file cassandra table using copy command provided in cql, there cases of fields mis-typed causes errors following: bad request: line 1:1033 no viable alternative @ input ',' aborting import @ record #277561 (line 277562). previously-inserted values still present. 277561 rows imported in 8 minutes , 20.296 seconds. after identifying , fixing mis-typed fields, next thing port rest of csv file table. can know there way resume previous aborted copy such inserted rows not re-inserted again? or, possible perform copy specified line of csv file instead of beginning of csv file? the parameter list doesn't seem have option specifying line start on in file, appears cant specify start. if think useful report issue , ask implementation of such functionality using cassandra jira . but, kind of functionality seems redundant, edit csv file removing data know has been inserted cassandra.

c# - Return a String with LuaInterface -

so, i'm trying implement lua scripting language in c#. it's simple enough, really, if use part of console application. want able create game console within xna. problem lua.dostring() seems return console line, rather string - which, said, fine console applications, want add output buffer string can display in-game, rather in console window. apologize if confusing - code clear up. using system; using system.collections.generic; using luainterface; namespace luaconsolelibrary { public class luaconsole { private lua lua; private bool isrunning = true; private string input; private list<string> outputbuffer; public bool isrunning { { return isrunning; } } public luaconsole() { this.lua = lua; } public void run() { int = 0; while(isrunning) { outputbuffer.add("> ");

php - Joomla countdown for all products -

i want write little code module show countdown product in module show 1 of countdown 1 product. code : <?php $ic = 1; foreach ($product $products) { $ic++; ?> <div class="slider-item"> <div class="sp-vmslider-counter"> <div id="sp-deal-countdown-<?php echo $ic ?>"></div> </div> <script type="text/javascript"> jquery(function($){ $('#sp-deal-countdown-<?php echo $ic ?>').countdown({ until: new date(<?php $m = jhtml::date($product->product_available_date , 'm', true)-1; $y = jhtml::date($product->product_available_date , 'y', true);

html - What front-end grid layout system supports both Fixed and Fluid at the same time? -

i've come across many popular grid system (ie: bootstrap, foundation, skeleton, neat, profound, etc...) none of them able support desired ui scenario: fixed sidebar (ie: 240px) rest fluid (ie: 100%). it appears grid layout @ pure css ( http://purecss.io/layouts/email/ ) capable of supporting fixed sidebars , rest fluid. the link shows sample layout achieves fixed-fluid support.

hashtable - looking for hash table C library -

i did check previous questions on topic couldn't find solution meets need. what need: supports both strings, , integer tuples (int arrays in c). if it's integer array, length fixed @ compile time. fast. memory efficient. need use process super large data sets. the capacity of hash tables grow dynamically. growth of size of hash tables handled library, instead of me. i need create large number of such hash tables. , these hash tables linked tree, in values in 1 hash table point other hash tables. my application both memory , cpu bound. -- how lucky am! :) i don't consider c++ implementations now, unless couldn't find solution in c. thanks! what uthash - a hash table c structures . supports both strings, , integer tuples uthash has no restriction vs. keys : key , structure can have any data type . it includes default macros hash common key types , namely integer , strings. in addition provides generic macros ( hash_add , hash_find )

scons error: no version of visual studio compiler found C/C++ -

i attempting build openwsn using scons , following output: scons: reading sconscript files ... ___ _ _ _ ___ _ _ | . | ___ ___ ._ _ | | | |/ __>| \ | | | || . \/ ._>| ' || | | |\__ \| | `___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org scons: done reading sconscript files. scons: building targets ... default(["default"], []) usage: scons board=<b> toolchain=<tc> project where: board: board build for. default: telosb actual: telosb toolchain: toolchain use. default: mspgcc actual: mspgcc jtag: location of board jtag binary to. default: actual: fet_version: firmware version running on msp-fet430uif. default: 2 actual: 2 bootload: location of board bootload binary on. default: actual: verbose: print complete compile/link comand. default: 0 actual: 0 scons: done building targets. it not appear have built anything, rather asking me board

java - Proper way to do jdbc calls from GWT? -

i doing rpc's in gwt query database , have memory leak in program , have strong suspicion in way have class set up. currently, have connect database within each method have , close out connection @ end of method. doing way cause memory leak? feel programming way leads more code , highly inefficient can't find many samples go off, can suggest better way work? names, ip's have been changed, , i've posted connect method sample of how other method's written. public class databaseserviceimpl extends remoteserviceservlet implements databaseservice { private connection con = null; string database = "ioma"; string host = "localhost"; string password = "foo"; string url = "jdbc:mysql://" + host + "/" + database; string user = "foo"; public string connect() { string connect = ""; try { class.forname("com.mysql.jdbc.driver"); con = drivermanager.getconnection(url, u

ios - Dispatch on main queue, type issues? -

i've been using code few months: dispatch_async(dispatch_get_main_queue(), ^{ // }); but in new target warning dispatch_get_main_queue returns dispatch_queue_s when in fact need dispatch_queue_t . however, code works. is problem? if so, easiest solution?

php - Is javascript validation enough to keep my forms secure? -

i building website , have questions forms on login/registration page. have few standard javascript validations on login page. questions should disable login button if javascript disabled or should keep php validations on server side code? which better approach in terms of security? planning keep login/registration button disabled , enable javascript. way can avoid writing php side validation of same javascript there. secure way of doing it? thanks overall, use php. javascript can fooled and/or turned off entirely. @ point server gets supplied whatever mr malicious end user wants have, , won't stopping them. use php validation, , if want fancy, put javascript on top. server-side validate.

java - eclipse example template with an editor or multi-page editor not running due to following errors -

eclipse example pde template editor or multi-page editor not running. error log show following errors in new workerbench window. 1.warning: environment variable home not set. 2.warning: egit couldn't detect installation path "gitprefix" of native git. hence egit can't respect system level where , how set these values. thanks in advance help. those not errors. not overreact. said, it's looking environmental variable home have been set, can go fill in information guess in git preferences. these messages not appear in newer versions of egit. and because opened runtime workbench not mean editor automatically opened. if it's not opening when try open 1 of supported fie types, open question stack traces of failures.

javascript - Need to encode/decode a JSON response for passing it to another webpage -

i having website application, need pass 1 json response(in string format) across site. have used hidden type value , passing on submit of link/button triggers page. when checked on waf, throwing cross-site scripting error. since, response contains special characters, suspect root cause of issue. now, want pass json response in encoded format , decode on next webpage. have read many articles , post on this. can suggest best practice implementation on this. code snippet: <input type="hidden" name="empstatus" id="empstatus" value=""> //in jsp $("#empstatus").val(json.stringify(empstatus)); //in js you use encodeuricomponent before sending $("#empstatus").val(encodeuricomponent(json.stringify(empstatus))); //in js and decodeuricomponent when receiving, thus protect special enclosing characters "

objective c - How can I continue my count from the correct spot once I load the saved count? -

i new @ coding, , practicing , making simple tally/counter app. trying save , load number users can continue left off once close app. the save , load buttons work actually...except once load saved number, , press +1 or -1 buttons, starts 0 if fresh load of app without saved data. how can make when user loads saved number, +1 , -1 buttons can read loaded number? this +1 button..haven't changed it: -(ibaction)up:(id)sender; { number = number + 1; count.text = [nsstring stringwithformat:@"%i", number]; } these save , load buttons: -(ibaction)save { nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; [defaults setobject:@(self.number) forkey:@"number"]; [defaults synchronize]; } -(ibaction)load { nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; [defaults setobject:@(self.number) forkey:@"number"]; self.number = [[defaults objectforkey:@"number"] integervalue]; }

Json array in php code -

i need use json array in php code. problem i'm in loop , need separate array in 2 , want merge it. far didn't work. use have graph (jqxchart). here code for($i = 0; $i < $nb; $i++){ if ($i%2 == 1){ $time[$i] = (hexdec($hour[$i])); $orders1[] = array( 'orderdate' => $time[$i], ); }else{ $hour[$i] = $hour[$i] + 1; $orders2[] = array( 'productname' => $hour[$i], ); } } $orders[] = array_merge_recursive( $orders1[], $orders2[] ); } echo json_encode($orders); thanks try code, $orders1 = array(); $orders2 = array(); for($i = 0; $i < $nb; $i++){ if ($i%2 == 1){ .... $temp1 = array( 'orderdate' => $time[$i], ); array_push($orders1, $temp1); }else{ .... $temp2 = array( 'productname' => $hour[$i], ); array_push($orders2, $temp2); } } } $orders = array_merge( $orders1, $orde

node.js - Using an HTTP connection as a simple duplex socket in Node -

say we're on network http allowed, what's simplest way use http module net module (tcp) socket/stream? between 2 node servers, i'd able send data using write() , receive data on('data',...) @ other end continuously. currently, can write once each end subsequent writes don't seem send. http in nature uni-directional. best can 2 uni-directional channels, without realtime communication. you can use server-sent events( eventsource ), part of html5 standard. uses http transport messages. should @ websockets similar tcp sockets. offer full-duplex realtime communication. use different websocket protocol, can use same ports http. if websocket not blocked, should use it. here comparison between 2 : websockets vs. server-sent events/eventsource

xml parsing - Android XML Parser only getting last entry -

i'm trying parse xml file list, getting last entry in xml file. have sample below <?xml version="1.0"?> <stops> <stop> <number>stop_code</number> <lat>stop_lat</lat> <lon>stop_lon</lon> <name>stop_name</name> </stop> <stop> <number>112112</number> <lat> 51.060931</lat> <lon>-114.065158</lon> <name>"crescent heights high school"</name> </stop> <stop> <number>2110</number> <lat> 51.082803</lat> <lon>-114.214888</lon> <name>"eb can olympic rd@olympic ce entr"</name> </stop> ..... <stop> <number>9988</number> <lat> 51.047388</lat> <lon>-114.067770</lon> <name>"nb 2 st@6 av sw"</name> </stop> <stop> <number&

Breeze.js - How do I create/add child objects to a parent that I am also creating? -

given following ef model: public class order { public int orderid { get; set; } public string customername { get; set; } public virtual icollection<orderdetail> orderdetails { get; set; } ... } // orderdetail has composite key of orderid , productid public class orderdetail { public int orderid { get; set; } public int productid { get; set; } public int quantity { get; set; } ... } in mvc4 web app (using hottowel spa template - durandal, breeze.js, knockout, etc.), have created view creating new order , addding/removing orderdetail items. in datacontext.js, have following: var createorder = function() { return manager.createentity('order'); }; in viewmodel orderadd.js, calling createorder: order = ko.observable(); activate = function() { initlookups(); order(datacontext.createorder()); } question: how create/add new orderdetail items order object , save entire new order object in db? do same way creating order, add naviga

iphone - Merging single view app to a storyboard -

Image
this first application multiple views. i have app uses storybord (main app), , app single viewcontroller , nib file. i merge singleview app part of main app. there way it? how add nib, , attach viewcontroller? *also please state if it's not recommended or not. please let me know if more info needed. you copy whole view controller xib of "single nib" project storyboard project. select "view controller" in xib of single nib project shown in image below , press cmd+c. open storyboard , press cmd+v. view controller xib should copied shown in image below. now should copy viewcontroller.m , viewcontroller.h (or whatever called) files single nib project. open finder, find files , drag them storyboard project in xcode (somewhere in project navigator). sure select items shown in following image when copy dialog prompted. now should reconnect outlets , actions copied view controller .h (cmd + drag storyboard .h file - should familiar

singleton - static AlarmManager in Android -

i'm developing simple tasks app in android , need create notifications via alarmmanager. problem have alarms should deleted -and notifications- aren't, decided -following posts such delete alarm alarmmanager using cancel() - android make alarmmanager static variable same instance can reached whole app. way i'm doing having following method in main class: public static alarmmanager getalarmmanagerinstance() { if (salarmmanager == null && scontext != null) salarmmanager = (alarmmanager) scontext .getsystemservice(context.alarm_service); return salarmmanager; } and in the scontext variable instantiated way: @override protected void oncreate(bundle bundle) { super.oncreate(bundle); setcontentview(r.layout.activity_main); scontext = this; initactionbar(); } is idea create singleton pattern variable? there better approach? thanks lot in advance. android do

agile - Should I split user stories on Frontend vs Backend tasks? -

while applying scrum, product backlog items users stories. have created sample story on tfs follows: as user, can signup system. i created following tasks: a login form should prepared. user should fill fields on form. user should type valid formatted email. user passwords match between. if user fills form successfully, send verification email. some of tasks frontend (html, css, etc) , backend (send email, etc). should separate frontend , backend tasks 1 another? , should separate them different user stories? can tasks implemented different developers? no. agile focuses on delivering working code customer. without each part implemented code written offers no value. unless tasks can shown offer independent value, should kept together. yes different parts can implemented different people. need make sure coordinate appropriately requested feature works whole.

java - When to use `actionListner` and `action`? And which one will gets executed first? -

this question has answer here: differences between action , actionlistener 3 answers i new java. have following doubt. when use actionlistener , when action ? , 1 gets executed first? can explain in simple steps? if using actionlistener , action in jsf, actionlistener gets executed first.

Can't create columns with Twitter Bootstrap -

i want learn bootstrap. have problem grid-system. can't create columns in rows. this sample code should work didn't work: <!doctype html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet"> </head> <body> <div class="container"> <ul class="nav nav-pills"> <li class="active"> <a href="#">home</a> </li> </ul> <div class="row"> <div class="span2"> id </div> <div class="span2"> name </div> <div class="span8"> e-mail </div> </div>

c - What are the necessary questions to determine what to learn in embedded programming? -

my internship subject in embedded systems have no idea about. my boss has difficulties in communication , instead of telling me should learn succeed project in short period of time, told me "learn embedded programming!". i searched in google, , found many tutorials few talk things in common (what chip , micro-controller). so, can give me list of questions must ask boss better choose tutorial find in internet? i'm lost,thanks lot in advance! remark : asked me if have ever programmed drivers ... , told me in c language . you need find out chip using, , download datasheet , compiler it. read entire datasheet. chips have compilers work c. there little benefit reading on other chip family. same in principle, need learn specific details needing in practice. you won't doing drivers; go operating systems. asked them, because have seen embedded programming in context. both use lot of low-level access hardware, set bits in control registers , stuff th

How to access values from c++ to java in android -

i importing c++ based project(or library) in android app.i used ndk purpose.i succeed embedding c++ in java.now need pass values , c++ , java.can 1 suggest how access information(text,images,or videos) c++ processed project android project.expecting simple tutorials.. you can access text(strings), arrays, integer data android c++ using jni. eg. android function: public native setstring(string arg); the above string arg can accessed using jni in c/c++ code shown below: c function: char *str = (*env)->getstringutfchars(env, arg, 0); c++ function dont pass env parameter. similarly other elements android can accessed in c/c++ using jobject class of jni. however access android variables c/c++ either need return control c/c++ function android or can call android function c/c++ function can set values of android functions. example can find in below link: accessing java variable native code via jni giving junk value good example of using picture data can ob

php - Zend Framework Code explanation (roleHasAcces) -

i found in old code i'm trying refactor have no clue means. can explain rule of code me? if (!libraryname_feature_access_rolehelper::rolehasaccess($plan_code, 'can_subscribe')) { $this->_redirect('error/404'); } thanks in advance! if (!libraryname_feature_access_rolehelper::rolehasaccess($plan_code, 'can_subscribe')) { $this->_redirect('error/404'); } in above code, $plan_code has value. might admin code or guest user code, , checking whether particular type of user can subscribe or not, means user has access authority subscribe or not. for detail inquiry, please check link. http://framework.zend.com/apidoc/2.0/classes/zend.permissions.acl.acl.html

c# - Pdf not opening from Internet Explorer download Dialog box -

when clicked hyperlink pdf , dialog comes open, save , cancel. when clicked on open, pdf not open.this issue on internet explorer. other browsers supports well. using asp.net c# . please advice pdf opens in internet explorer if name of pdf smaller. if name large, open button click not work in internet explorer 9. try this 1) go tool -> internet option -> advanced 2) scroll bottom. 3) find check box "do not save encrypted pages disk" , uncheck it. or i found 1 solution here . says- a. close web browser. b. start acrobat or adobe reader. c. choose edit > preferences. d. select internet in list on left. e. uncheck "display pdf in browser", , click ok. f. restart internet explorer.

oracle - how to get multiple xml-elements without using xmlaggregation -

i need create following xml-structure oracle-database each survey can multiple participants. i'm not sure create using xmlelement without getting message "ora-01427 subsquery returns more 1 row" try use dbms_xmldom (never done before) i'm wondering if knows how generate using plain oracle sql-xmlfunctions (xmlelement, xmlaggr) <nieuwesurveys> <survey> <surveynaam>2013-02-01</surveynaam> <startdatum>2013-02-01</startdatum> <einddatum>2013-02-15</einddatum> <deelnemer> <voornaam>tilde</voornaam> <tussenvoegsel/> <achternaam>deelnemera</achternaam> <geslacht>man</geslacht> <emailadres>tilde.deelnemer.a@tjip.com</emailadres> <voorkeurstaal>nl</voorkeurstaal> <account&

postgresql trigger (strategy) to update table based on entries of another table -

i new postgresql (spoilt django orm!), , create trigger updates table based on entries of table. so, have following table on schema: collection_myblogs(id, col1,col2,title,col4,col5) ..where field id autogenerated. now, have new table created so: create table fulltext(id serial not null, content text not null); alter table fulltext add constraint fulltext_pkey primary key (id); and insert values collection_myblogs so: insert fulltext(content) select title collection_myblogs; all fine far...i trigger on fulltext such fulltext updates new entries everytime collection_myblogs has new entry. so, attempted creating trigger following: create trigger collection_ft_update before insert or update on collection_myblogs each row execute procedure ft_update(); now, not entirely sure should go on ft_update() function, , @ moment, have: create function ft_update() returns trigger ' begin insert fulltext(content) select new.title; return new; end ' language plpgsql