Posts

Showing posts from June, 2014

html - Center between two 's -

html - Center <span> between two <button>'s - i working bootstrap v3 , trying center <span class="badge">1</span> between 2 buttons, 1 of uses pull-right class. the exact html looks follows: <button type="button" class="btn btn-success">decient</button> <span class="badge">10</span> <button type="button" class="pull-right btn btn-danger">garbage</button> however results in following: i have 10 centered have not been successful. have tried pagination-centered , text-center and custom css no avail. provide additional context, in caption div of thumbnail . the next provides basic scenario of situation: http://jsfiddle.net/vva78/1/ it bootstrap , utilize text-center on house-container div , pull-left on btn-success . jsfiddle to center vertically add together margin-top . jsfiddle of course of study not follow illustration

swing - Java snake game -

swing - Java snake game - well starting off must admit there countless snake questions out there, though every programmer if newbie or expert writes code differently decided open 1 case, import java.awt.color; import java.awt.graphics; import java.awt.event.keyadapter; import java.awt.event.keyevent; import javax.swing.jframe; public class game1 extends jframe { float x; float y; int[][] tilekati = new int[30][30]; int keycode; int body; boolean right = true; boolean left = false; boolean = false; boolean downwards = false; boolean running = false; public class al extends keyadapter{ public void keypressed(keyevent e){ keycode = e.getkeycode(); if((keycode == e.vk_left) && (!right)){ left=true; down=false; up=false; running=true; } if((keycode == e.vk_right) && (!left)){ right=true; down=false; up=false; running=true;

sonarqube - sonar V.4.3.1 does not start with postgresql -

sonarqube - sonar V.4.3.1 does not start with postgresql - steps - install server - alter jdbc url point new created poststresql database (default schema / sonar user). there default h2 jdbc url disabled, , activated postgresql jdbc url - db user name , password still default (sonar / sonar) - when starting server, see tables created successfully, server doesn't start successfully. below shows in log. --------------- part of log start ----------- 2014.06.19 16:18:00 error [jruby.rack] initialization failed org.jruby.rack.rackinitializationexception: org.apache.ibatis.exceptions.persistenceexception: ### error querying database. cause: org.postgresql.util.psqlexception: error: stack depth limit exceeded hint: increment configuration parameter "max_stack_depth" (currently 2048kb), after ensuring platform's stack depth limit adequate. ### error may exist in org.sonar.core.rule.rulemapper ### error may involve defaultparametermap ### error occurred wh

php - Attempt to update users table generates MethodNotAllowedHttpException, Laravel-4 -

php - Attempt to update users table generates MethodNotAllowedHttpException, Laravel-4 - userscontroller: public function update($id) { if( ! $this->user->isvalid(input::all())) { homecoming redirect::back()->withinput()->witherrors($this->user->errors); } $user = $this->user->find($id); $user->save(); homecoming redirect::route('users.index'); } route: route::resource('users','userscontroller'); model: protected $table = 'users' edit.blade.php: {{ form::model($user, array('route'=>array('users.update','$user'=>'id'))) }} i notice not generate "put" action. page source: <form method="post" action="https://zocios.com/users/id" accept-charset="utf-8"><input name="_token" type="hidden" value="...&qu

mysql - How to aggregate (sum) values over month in jasperreports (each month should be the sum of all month before) -

mysql - How to aggregate (sum) values over month in jasperreports (each month should be the sum of all month before) - i want study jasperreports aggregates our contracts on month adding new , old contracts month. database mysql database. select illustration info below: select month(contract_date), amount contracts year(contract_date)=2013 grouping month(contract_date) 1.1.2013 300 1.1.2013 500 1.2.2013 250 1.3.2013 250 now get: 1 800 2 250 3 250 ... but have: 1 800 2 1050 3 1300 ... so each month contains amount of month before. i dont mind if can in sql or jasperreports/ireport, solution welcome. there way can this? mysql doesn't have ctes inconvenient, view in pinch. create view monthlytotals select month( contractdate ) contractmonth, sum( contractqty ) totalqty contracts grouping contractmonth; now can bring together view itself, maintaining running total of month , previous months: select t1.contractmonth, t1.t

c# - How to use approval tests for testing databases? -

c# - How to use approval tests for testing databases? - i approval-test result of database query using classes provided approvaltests.net library. understand how approval tests work, not find single illustration on how utilize classes persistence namespaces. appreciate examples me started. i refactoring complex sql query. need create sure new version of query returning same resultset after refactoring. think can accomplish this: dataset dataset = new dataset(); dataset.fill(adapter, connection); stringwriter sw = new stringwriter(); dataset.writexml(sw); string result = sw.tostring(); approvals.verify(result); but think there improve way using classes persistence namespace without explicit conversion of dataset xml string. chris made screencast iloader pattern approvaltests. c# approval-tests

c++ - Output Discrepancy using ctime and time_t -

c++ - Output Discrepancy using ctime and time_t - found unusual discrepancy outputting time_t through ctime while messing around chrono , durations. missing here. there more info question after code , output. searched around bit similar question, if there 1 please direct me it. i'm running: os: windows 7 64-bit cpu: intel core i5 m 520 2.40ghz ram: 4gb ide: microsoft visual studio express 2013 edit: total source #include <iostream> #include <chrono> #include <ctime> #include <thread> using namespace std::chrono; int main() { duration<int, std::milli> wait(5500); time_point<system_clock> timepoint_start; time_point<system_clock> timepoint_end; time_t timet_start; time_t timet_end; std::cout << "01. timepoint_start address, sizeof: " << &timepoint_start << ", " << sizeof(timepoint_start) << std::endl;

php - how to rewrite main domain to sub folder without changing url? -

php - how to rewrite main domain to sub folder without changing url? - i want rewrite sub folder such http://example.com/new http://example.com .htaccess site contents , files in /new directory , want /new not appears users , user see example.com without /new load files /new directory. search much couldn't find things. have solution problem? best regards. very complicated want do, not more easy move actual /new root? php .htaccess rewrite joomla2.5

Facebook javascript sdk response empty -

Facebook javascript sdk response empty - i'm trying facebook friends using facebook js sdk. code following: <script> window.fbasyncinit = function() { fb.init({ appid : 'app_id_here', status : true,· cookie : true, xfbml : true, oauth : true, }); fb.getloginstatus(function(response) { if (response.status === 'connected') { fb.api('/me/friends', function(r){ if (r && !r.error){ console.log(r); } else { console.log('something goes wrong', r); } }); } }); }; //load sdk async (function(d){ var js, id = 'facebook-jssdk'; if (d.getelementbyid(id)) {return;} js = d.createelement('script'); js.id = id; js.async = true; js.src = "//connect.

php - WooCommerce single product content restructure -

php - WooCommerce single product content restructure - i using woocommerce 2.1x. want reposition of woocommerce tabs in product detail. i made kid templates. cannot find place alter pattern of items within content-single-product.php i want display tab after image, before product summary part. how do that? remove default woocommerce add_action tabs : remove_action( 'woocommerce_after_single_product_summary',woocommerce_output_product_data_tabs', 10 ); now add together new add_action hook in tabs want. in case want appear before summary part , after image, add together : add_action( 'woocommerce_before_single_product_summary','woocommerce_output_product_data_tabs', 30 ); see have added priority of 30 product images hooked @ priority 20 , want tabs appear after product images. you should consider reply provided -aibrean help in future. php wordpress woocommerce

algorithm - Large table : fill missing values -

algorithm - Large table : fill missing values - i have big table of numeric values (up 400k lines , 3 7 columns). don't know table pattern , info nature in advance (depends on info file opened in program). i need deal missing data. fill them calculated values (depending on others points). i've read lot of things on net i'm quite beginer. does know simple , efficient way fill missing values on big tables? i work javascript. thanks in advance edit: an illustration added a, b, c, d, e, f 83.619147,-7.377613,15.915,0.70899963,0.078,0.34700012 83.586208,-7.376209,14.495,0.32199955,0.031,0.058000565 83.611485,-7.37933,16.142,0.60599995,0.087,0.08100033 83.667129,-7.378004,16.212,0.5710001,0.093,0.017999649 but said, schemas of tables process not fixed. don't know in advance nature of table/data. algorithm bigdata missing-data

Android - What is a PendingIntent ? -

Android - What is a PendingIntent ? - i new android development , had utilize repeating alarm using alarmmanager . first had chance utilize pendingintent. after reading through documentation ( http://developer.android.com/reference/android/app/pendingintent.html ), confused pendingintent is. my questions are: q1. in way pendingintent 'pending' ? apologies question, i'd have intuitive understanding of pendingintent means. q2. documentation says: a pendingintent reference token maintained scheme describing original info used retrieve it. means that, if owning application's process killed, pendingintent remain usable other processes have been given it. if creating application later re-retrieves same kind of pendingintent (same operation, same intent action, data, categories, , components, , same flags), receive pendingintent representing same token if still valid, , can phone call cancel() remove it. how does, reference token maintained s

performance - How to send batches of million push notifications using Amazon Simple Notification Service (SNS) -

performance - How to send batches of million push notifications using Amazon Simple Notification Service (SNS) - like many companies, 1 work isn't comfortable in using apple's apns: no official library, stream cut-off randomly, etc... same goes android's force system: limited little batches, different apple's apns... that's why looking alternative , when amazon claimed able send millions of force notifications free, thought sns perfect solution. the issue have more 1 1000000 devices address, , our force campaigns target same devices. far dug, solution utilize aws api provides method create endpoints 1 @ time! big deal because after testing, figured in order create 1 000 000 endpoints, take approximately 15h (~17 calls/sec). even after endpoints created, in order send pushes @ once, endpoints need added topic, , again, has done 1 endpoint @ time (so 15 more hours). event if multithreaded our calls let's 30 threads, still take hour! so, tell if the

How can I get the sender email address using Outlook.MailItem in VB.NET? -

How can I get the sender email address using Outlook.MailItem in VB.NET? - i have tried using mailitem.senderemailaddress , mailitem.sender.address both homecoming string looks this: /o=domainname/ou=exchange administrative grouping (fydibohi43spclt)/cn=recipients/cn=joe bloggs8c3 where in reality want joebloggs@domainname.co.uk retrurned. anyone have ideas? thank much. edit: have done digging; works email addresses of 'senderemailtype' smtp, doesn't work exchange email addresses. edit 2: have tried code specified here, assume outdated because throws "cannot create active-x component" error. edit 3: ever has same problem me, found reply (in c#, converted vb.net, still works though): private function getsendersmtpaddress(mail outlook.mailitem) string dim pr_smtp_address string = "http://schemas.microsoft.com/mapi/proptag/0x39fe001e" if mail service nil throw new argumentnullexception() end if if mail.s

excel - Finding the first empty cell in a column using VBA without a loop -

excel - Finding the first empty cell in a column using VBA without a loop - this question has reply here: last not empty cell in row; excel vba 3 answers so have these 2 lines of code in vba find empty cell @ bottom of column , homecoming pointer next cell. rowpointer = thisworkbook.sheets("current").cells(65000, 4).end(xlup).row if thisworkbook.sheets("current").cells(rowpointer, 4).formula <> "" rowpointer = rowpointer + 1 the problem searches bottom up, , need find first empty cell in column not last. i've seen few ways prepare utilize loop go through column spreadsheet i'm working rather big , loop take long time execute. question is there easy way search through column top downwards find first empty cell? maybe like rowpointer = sheets("current ").columns(4).specialcells(xlcelltypeblanks).cel

oop - Return value from PHP parent method when called from child -

oop - Return value from PHP parent method when called from child - i new php oop not sure if going right way. parent method, isregistered(), query db correctly , homecoming value ($affected_rows) when phone call method parent, "echo" value (will not homecoming it) when phone call method child, not sure if have constructed kid incorrectly. here code: //log in social credentials if(isset($_post["fb-reg"])) { $fboptions = array( 'email' => "joe@gmail.com", 'fbid' => "678910", 'handler' => $handler); //the db connection fbregister($fboptions); } //instantiate parent , kid , results of query function fbregister($fboptions) { $a = new newuser(); $fb = new fbuser($fboptions); $fb->isregistered(); // echo $affected_rows $y = isregistered(); echo $y; // not homecoming value of $affected_rows } //parent class class newuser { public $email; public $pass; public $dbconn; public $confir

How to get the selection which is being dragged in d3.js? -

How to get the selection which is being dragged in d3.js? - i'm using d3 behavior api implement drag , drop functionality on chart. there're circles on chart, want create circles able move around when user dragging them. but don't know how reference of circle beingness dragged user. in below code, , how reference of selection , current mouse position? var drag = d3.behavior.drag() .on("dragstart", function(){ //do drag start stuff... console.log('drag start'); }) .on("drag", function(){ //hey we're dragging, let's update stuff }) .on("dragend", function(){ //we're done, end stuff console.log('drag end'); }); somebody please help! you current selection from d3.selection(this) if want current mouse

javascript - Customize Angular SlideAndPush Directive with Menu offset -

javascript - Customize Angular SlideAndPush Directive with Menu offset - i need customize angular slide.and.push directive found here: http://ngmodules.org/modules/slide.and.push of course of study inspired jquery version here: http://tympanus.net/codrops/2013/04/17/slide-and-push-menus/ what trying mimic type of menu/sub menu scheme squarespace (http://www.squarespace.com/) using administrative dashboard (you'll have create free business relationship utilize or go watch promo video shows it) there visible side menu along left side of page menu icons. upon clicking 1 of icons, secondary slide-out (push menu) slides out first (making appear secondary menu coming out of first side menu.). so far, when add together slide.and.push directive secondary menu slides out left side of page on top of primary side menu. have tried adjusting css bit no avail. here's original css side menu. instead of sliding out far left off screen...i need slide out primary visible side menu

java - How to play mp3 file android w/ mediaplayer if files in same directory as activity class? -

java - How to play mp3 file android w/ mediaplayer if files in same directory as activity class? - i've never liked how android implements fetching local resources 1 can't work around odd reason. mp3 files in same bundle mainactivity how can play them using media player? i've resorted stackoverflow because maintain seeing other posts , reply referring not exist in case "r.raw.*".. help appreciated. mediaplayer player = new mediaplayer(); player.setdatasource(mainactivity.class.getresource("file.mp3").getpath()); player.prepare(); player.start(); when utilize code nil happens, believe it's because can't fetch sound file in other java implementation - android seems pedantic , tedious. any help appreciated! java android android-mediaplayer

database - Is it possible to have QR codes read and added to a MongoDB? -

database - Is it possible to have QR codes read and added to a MongoDB? - is possible implement scheme can read qr codes signal process "pings" mongodb attached website "incrementing info value signifying qr code got scanned? i not asking total on solution, simple "yes heading in right direction logic!" yes can that. how suggest proceed. more opinion. with qr have 2 types of values can showed viz. static-string or url. making utilize of url. develop simple web application home url - www.example.com/app - simple get you can write request handler accepts routed url, has logic increment mongo-entity - value then can redirect current request specified page. database mongodb amazon-web-services qr-code

c# - WPF popup with textbox? -

c# - WPF popup with textbox? - i trying create command displays search results user types in textbox. this, have textbox , popup shows when user types (just google search box). so, <grid> <textbox name="userentry" /> <popup /> </grid> now when user starts typing textbox want popup show , remain open until user focusses on other ui command or if text entered empty. unable accomplish , wondering if there alternate improve ways of doing in wpf. regards xaml : <window> <grid> <grid.rowdefinitions> <rowdefinition /> <rowdefinition /> </grid.rowdefinitions> <button x:name="btn" content="open search window" height="30" width="150" click="btn_click"/> <popup x:name="popup" placementtarget="{binding elementname=btn}" placement="bottom" width=&

ajp - Is AjpProtocol safe to use in Tomcat 6? -

ajp - Is AjpProtocol safe to use in Tomcat 6? - when select ajp/1.3 connector protocol in tomcat 6 , tomcat 7 org.apache.jk.server.jkcoyotehandler , org.apache.coyote.ajp.ajpprotocol, respectively. according documentation, ajpprotocol new implementation, jkcoyotehandler old implementation. i'm seeing intermittent problems ajp http request homecoming after 20 seconds http 400 response. in attempts track downwards cause ran across different ajp protocol implementations , surprised old implementation default. given need solution tomcat 6 now, trying out new ajpprotocol relatively safe? stable? or there reason tomcat 6 still defaults old implementation? tomcat ajp

qt - Running OSX Bundle via Open -

qt - Running OSX Bundle via Open - i'm trying create osx bundle using cmake/cpack on osx involves opencv , qt (although don't think dependencies matter @ point). compiles , bundle created fine, , have script modifies necessary library paths such executable i'm making works if run terminal within bundle. problem i'm having if seek run myapp.app file via open command or double clicking app gives me error: lsopenurlswithrole() failed error -10810 file /applications/ i've seen other solutions other lsopenurlswithrole() errors involving modifying permissions, hasn't helped me. also, error code "unknown error" i'm not sure how proceed. the solution ended beingness libcocoa.dylib library not finding requisite libraries. see building osx app bundle thorough reply on subject. otool -l best friend. osx qt cmake bundle cpack

mvvm - Moving to next control on button click in WPF -

mvvm - Moving to next control on button click in WPF - this question has reply here: moving next command on come in keypress in wpf 7 answers i want move next command when click button instead of tab key in wpf mvvm application. how can accomplish this? you question seems not clear. set focus on command can controlid.focus() however, check out moving next command on come in keypress in wpf, of help too wpf mvvm

c# - How to validate an encoded url -

c# - How to validate an encoded url - i have encoded url invalid, validate before decoding using httputility.urldecode() how can validate encoded url below: http%3a%2f%2fwww.one-two.com&buyer=21 you can validate url this: uri sd; bool b_validurl = uri.trycreate(uri.unescapedatastring("http%3a%2f%2fwww.one-two.com&buyer=21"), urikind.relativeorabsolute, out sd); if b_validurl=true url valid, otherwise invalid. c# url

javascript - Checkbox value: optional or required? -

javascript - Checkbox value: optional or required? - according mdn value attribute optional except when value of type attribute radio or checkbox . doesn't seem correct. there wrong following: <input type="checkbox" id="input"> <script> document.getelementbyid('input').onchange = function () { alert('checked!'); }; </script> demo the value attribute required if want checkbox post through value when submit form. if you're not submitting form want know when it's clicked, there's nil wrong example. note illustration alert "checked!" when user un-checks box too. that's why might want @ value of checked attribute in javascript. javascript html checkbox

jquery - Set model property from view -

jquery - Set model property from view - as go on question here: jquery hide , show text input <div> <input type="button" id="btnnewgroup" value="new group" /> @html.textboxfor(model => model.groupname, new { @id = "newgroup", @style = "display:none" }) </div> <input type="submit" value="send" /> <script type="text/javascript"> $(document).ready(function () { $("#btnnewgroup").click(function () { $("#newgroup").toggle(); }); }); </script> when click on submit button, want model property groupname right value: if the text input shown property value entered, if text input hidden propery value string "other group". something like $('form').submit(function() { if ($('#newgroup').is(':hidden')) { $('

python - Associate many QButtons with many QLineEdits -

python - Associate many QButtons with many QLineEdits - the app building looks this: the app include several more qtoolbuttons , qlineedits. when qtoolbutton pressed color dialog presented. hex code of color added lineedit. possible each qlineedit associated qtoolbutton when button pressed app automatically knows lineedit add together text to. code using is: self.connect(self.bgbut, signal("clicked()"),self.bgbut_click) #bgbut qtoolbutton and calling def bgbut_click(self): but become impractical 15 plus line edits , toolbuttons add. there way efficiently associate each toolbutton corresponding lineedit? i advice next 3 steps. step 1: while or after setup of ui of widget create dictionary buttons keys , line edits values. self.button_map = {} self.button_map[self.but1] = self.edit1 self.button_map[self.but2] = self.edit2 .. step 2: connect buttons same method in widget. did that, guess. self.but1.clicked.connect(self.buttons_clicked) self

php - Split street, house number and addition from address -

php - Split street, house number and addition from address - i'm using regular look split dutch street, house number , add-on address. add-on should optional. preg_match('/(?p<address>[^\d]+) (?p<number>[\d]+)(?p<numberadd>[^\d]+)/', $input, $matches) this works if $input illustration street 1a. not if input street 1 (without addition). so how can split address add-on optional? add-on may not contain numbers. have seek with: preg_match('/(?p<address>\d+) (?p<number>\d+)(?p<numberadd>\d*)/', $input, $matches) php regex preg-match

c# - How to prevent fields from being dropped after an EDMX update -

c# - How to prevent fields from being dropped after an EDMX update - i have ef 5.0 database first model based on oracle 11g database, shown below: baseentity (abstract) id basehistoricalentity (abstract) entityid createdate deletedate titleentity titlenumber isdraft registrydate lastmodified lastmodifiedby titlestatusid buildtypeid okvedid deliverydate titlebuildcharacteristics titletypeid basepriceid kosgu all entities have primary key ( id ). hence derived baseentity. the title table has additional 3 fields basehistoricalentity entity. entityid createdate deletedate the title table maps 3 derived entities follows: baseentity->basehistoricalentity->titleentity when add/remove fields to/from other tables in database , update edmx model, next field defenition removed edmx file: <scalarproperty name="entityid" columnname="entity_id" /> <scalarproperty name="createdate" columnname="create_date" /> &l

spring - Before pointcut on HttpServletResponse sendRedirect compiling but not firing -

spring - Before pointcut on HttpServletResponse sendRedirect compiling but not firing - i'm trying add together pointcut around calls httpservletresponse.sendredirect (api doc http://docs.oracle.com/javaee/6/api/javax/servlet/http/httpservletresponse.html) using aspectj , spring aop. code class , pointcut follows: @aspect @log4j class exampleaspect { @before("execution(* javax.servlet.http.httpservletresponse.sendredirect(..))") void logredirectbeforesending() { log.warn('holy cow batman, redirect!') } } currently although above code compiles doesn't ever execute (as evidenced lack of warn output in log , debug breakpoints in advice code never beingness hit). although i've omitted them here sake of simplicity aspect contains other pointcuts correctly fire have ruled out aspect configuration potential cause (which why not including spring bean configuration). further, have double checked via debugging class implements

If there a reliable way to identify an email message as a forward? -

If there a reliable way to identify an email message as a forward? - i think reply no, thought i'd inquire in case knows better. the application work on accepts incoming email, i'm trying find way identify message having been forwarded (not server-side forwarding, regular old "i want forwards email message"), can identify original sender address (and content). i see indication can via email headers, leaving me parsing subject , body clues, inconsistent. you want x-forwarded-for header (which applies html email) from wikipedia: x-forwarded-for email-header indicating email-message forwarded 1 or more other accounts (probably automatic). email email-headers

internet explorer - Change user agent in IE -

internet explorer - Change user agent in IE - i'm looking unified solution changing ie's user agent (the way through dev tools on ie 11) versions 7 , higher, or @ to the lowest degree deleting trident tokens, not allowed utilize add-ons this, programmatic\files\registry changes allowed, registry can not solve problem though, ideas of implementing such thing nice, in advance have tried forcefulness browser in compatibility mode through x-ua-compatible meta tag? see these sites more information: http://msdn.microsoft.com/en-us/expression/dd835379.aspx http://webdesign.about.com/od/metataglibraries/p/x-ua-compatible-meta-tag.htm internet-explorer http registry user-agent

ios - Adding a segue between Imageview and Viewcontroller in Storyboard -

ios - Adding a segue between Imageview and Viewcontroller in Storyboard - i have viewcontroller consists of couple of icons in it. need add together segue between image , table view controller. not able add together segue in storyboard? any help you add together button , provide image per need , add together segue b/w , tableview controller below :- this work you. ios storyboard

opengl - How to add 3D-Text to a video programmaticly -

opengl - How to add 3D-Text to a video programmaticly - i'm looking fast, efficient solution add together text video. tried cli ffmpeg think lets me add together 2d-text. want able create text , /or images , rotate / skew them in "3d-space". is possible via cli of video processing tools or have opencv etc.? thank help. i go this: create textblock in imagemagick , distort 3d space (e.g. http://www.imagemagick.org/usage/distorts/#perspective) export imagemagick imageformat alphachannel (e.g. png / tga) overlay image on video using cli ffmpeg (e.g. http://www.oodlestechnologies.com/blogs/picture-in-picture-effect-using-ffmpeg) opengl video text 3d ffmpeg

actionscript 3 - image from xml in as3 -

actionscript 3 - image from xml in as3 - i'm new as3 excuse me if i'm not using right terms. have xml file periodically update twitter info. i'm able dynamic text xml file loaded fine, don't know how image loaded , onto stage. xml has image file name listed. pic save c:\twitter. can help me? code: import flash.net.urlrequest; import flash.net.urlloader; import flash.events.event; var xmldata:xml = new xml(); var theurl_ur:urlrequest = new urlrequest("streamcontrol.xml"); var loader_ul:urlloader = new urlloader(theurl_ur); loader_ul.addeventlistener("complete", fileloaded); function fileloaded(e:event):void { xmldata = xml(loader_ul.data); picfilename.load = xmldata.twitter.picfilename; username.text = xmldata.twitter.username; twittertext.text = xmldata.twitter.text; } here xml file !doctype streamcontrol> <items> <timestamp>1402974867</timestamp> <ap1>bankai213</ap1> <ap2>princemurphy<

javascript - jQuery click event triggered twice when clicking on Checkbox -

javascript - jQuery click event triggered twice when clicking on Checkbox - i'm playing around datatables , have table : <table id='dt'> <thead><!-- header --></thead> <tbody> <tr data-lineid=1> <td><input type='checkbox' class='checked_entry' id='checked_1'></td> <td>column 1</td> <td>column 2</td> </tr> <!-- rest of table --> </tbody> </table> what trying able click everywhere in row, , select checkbox of row : $('#dt tbody').on('click', 'tr', function() { var id = $(this).data('lineid'); if ($('#checked_'+id).prop('checked')) { $('#checked_'+id).prop('checked', false); } else { $('#checked_'+id).prop('checked', true); } }); this working fine, except

css3 - using media query to remove indent on li -

css3 - using media query to remove indent on li - i using media queries remove indent on li when screen size 500 width here html: <!doctype html> <html> <head> <meta charset="utf-8"> <title>js bin</title> </head> <body> <div class="row" style="margin-left: 2px; margin-right: 1px;"> <div class="media"> <div class="date pull-left"> <p>7<span>june</span></p> </div> <div class="media-body"> <p><strong>xxx</strong> xxxx/p> <p>key points:</p> <ol> <li>xxx</li> <li>xxx</li> <li>xxxx.</li> <li>sda</li>

node.js - Cannot stream large files -

node.js - Cannot stream large files - i have 2 node js servers , b, connects b files(large files). here's code utilize handle streams. var downloadedamount = 0; stream.on('data', function (data) { if (buffer.isbuffer(data)) { downloadedamount += data.tostring('utf8').length; } else { downloadedamount += data.length; } if (!res.write(data)) { stream.pause(); } }); res.on('finish', function () { console.log("finish called"); sendusage(reqid, downloadedamount); // async db/network phone call }); stream.on("end", function () { console.log("end called"); res.end(); }); res.on("drain", function () { stream.resume(); }); it downloads files when it's single file beingness d

ios - Loading Issues with UITableViewCell -

ios - Loading Issues with UITableViewCell - loading gifs uitableviewcell using sdwebimage . it's fast, tableview doesn't seem load until user scrolls tableview . any suggestions how prepare issue? this uitableview - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { // homecoming number of rows in section. homecoming self.gifarray.count; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *myidentifier = @"cell"; rdgifgridtableviewcell *cell = (rdgifgridtableviewcell *)[tableview dequeuereusablecellwithidentifier:myidentifier]; if (cell == nil) { nsarray *nib = [[nsbundle mainbundle] loadnibnamed:@"rdgifgridtableviewcell" owner:self options:nil]; cell = [nib objectatindex:0]; } cell.urllabel.text = [self.gifarray objectatindex:indexpath.row]; cell.urllabel.textcolor = [uicolor clearcolor]; [cell.imageview sd_setimagew

php - Recursive foreach loop (I think) -

php - Recursive foreach loop (I think) - i have multidimensional array these values: array(2) { [0]=> array(2) { [0]=> string(16) "5" [1]=> string(16) "4" } [1]=> array(3) { [0]=> string(16) "1" [1]=> string(16) "2" [2]=> string(16) "3" } } for contents of arrays int, more complex values can passed through brackets. however, number of "sub-arrays" can varies , can little 1 , big php can handle it. i wish loop through first value of first array, first value of sec array, first value of 3rd array, etc. array[0][0] -> array[1][0] -> array[2][0] array[0][0] -> array[1][0] -> array[2][1] array[0][0] -> array[1][1] -> array[2][0] array[0][0] -> array[1][1] -> array[2][1] array[0][0] -> array[1][2] -> array[2][0] array[0][0] -> array[1][2] -> array[2][1] array[0][1] -> array[1][0] -> array[2][0] arr

node.js - How to return errors from Expresss object on a node listening http -

node.js - How to return errors from Expresss object on a node listening http - newbie on node have web form calls node http server running java applet. works fine. works great , prints errors console. i want errors or "success" notice sent user after applet has run. running on listening http server. i've tried many adaptations. here code: var express = require('express'); var app = express(); ... app.get('/processfile', function(request, response) { java.classpath.push("../lib/commons-io-2.4.jar"); ... seek { var g2rdf = java.callstaticmethodsync("com.pck1.processfile.runner", "nodejs", request.query.user, request.query.pass, request.query.file); } grab (ex) { console.log(ex.cause.getmessagesync(); } <-- response go here ? --> }); <!-- add together callback server? --> var httpsserver = http.createserver(app); httpserver.listen(8080);

Python submodule imports using __init__.py -

Python submodule imports using __init__.py - i'm learning python, , can't figure out how imports in __init__.py work. i understand the python tutorial __init__.py file initializes package, , can import subpackages here. i'm doing wrong, though. explain me (and future python-learners) i'm doing wrong? here's simplified illustration of i'm trying do. this file structure: package __init__.py test.py subpackage __init__.py hello_world.py the contents of hello_world.py : def do_something(): print "hello, world!" subpackage/__init__.py empty. package/__init__.py contains: import test.submodule.do_something and finally, test.py contains: do_something() this how effort run hello_world.py using osx terminal , python 3: python test.py python throws next error: nameerror: name 'do_something' not defined you understand when import module, interpreter creates new

actionscript 3 - away3d - 2 textures on 1 plane -

actionscript 3 - away3d - 2 textures on 1 plane - im trying create plane total (background) texture , partial (element) texture on 1 plane. partial element alter in runtime , im curious if can utilize kind of double drawing on single plane element ? is possible ? or have create 2 planes , 1 above ? a simple solution extend bitmaptexture , create class similar webcamtexture composite images , assign results texture's bitmapdata. look @ update function in webcamtexure class, that's grab photographic camera bitmapdata , apply texture. if autoupdate true update() function called uploadcontent(), similar onenterframe. manually update texture set autoupdate false , phone call update() when needed. actionscript-3 flash away3d

Android Swipe layout above fragment -

Android Swipe layout above fragment - i want following: i have fragment want add together button/imageview. if drag button show layout 2 buttons on. when layout on top possible swipe layout downwards again. of import thing underlying layout can't hidden because want create blurred effect above one. now problem don't know how begin this? there way create part of layout invisible , create visible while swiping up? should work gestures or? you can utilize umano panel (open source) accomplish effect. android android-layout android-fragments swipe

html5 - large Images Canvas with FF -

html5 - large Images Canvas with FF - i have pronlem big image files display in canvas filereader. little images works fine, in chrome big images too. in firefox displays nil , after todataurl gives black image. image size 5580 * 8333 (8mb). if load dataurl filereader in image tag works too. var reader = new filereader(); reader.onloadend = function () { preview.src = reader.result; console.log(reader.result); var canvas = document.getelementbyid("resize"); var ctx = canvas.getcontext("2d"); var image = new image(); image.src = reader.result; image.onload = function() { var max_width = 400; var max_height = 300; var tempw = image.width; var temph = image.height; if (tempw > temph) {

jquery - I cannot post image in mvc -

jquery - I cannot post image in mvc - i want create form uploads pictures directory. using ajax want display image uploaded in img tag below cant doit. codes: ajax codes: function tempupl() { var file = document.getelementbyid("image"); var form = new formdata(); alert(file.files[0].name); form.append("image", file.files[0]); pather = "@url.action("uploadpi","countries")"; $.ajax({ type: "post", url: pather, data: form, processdata: false, contenttype: false, success: function (data) { alert(data); var = data; homecoming a; } }); } my controller:this controller upload image folder.i returned json objects ajax . public actionresult uploadpi(httppostedfilebase image) { jsonresult j = new jsonresult(); if (image != null && image.contentlength > 0) {

File picking using pattern in R -

File picking using pattern in R - this question has reply here: r-project filepath concatenation 1 reply passing directory path parameter in r 1 reply i have directory having multiple files starts 001.csv, 002.csv , on. want pick files in function pass argument function. ex. myfiles<-function(x=1:30){ // should pick files starts 001.csv till 030.csv. } i tried using pattern matching not sure how create pattern matching using variable consists of vectors. tried using paste function paste total file path giving me file name 1.csv , not 001.csv tt<-function(dirname,type,nums=1:30){ filenames<-list.files(dirname) c<-nums myvector<-0 for(i in 1:length(c)){ myvector[i]<-paste(dirname,"/",c[i],".csv",sep="") #print(myvector[i])

c# - Entity Framework Exception at run time: Entities in participate in the relationship? -

c# - Entity Framework Exception at run time: Entities in participate in the relationship? - while using code first approach when run project. during new user registration, entity framework throwing exception: additional information: entities in 'applicationdbcontext.identityusers' participate in 'applicationuser_userdetails' relationship. 0 related 'applicationuser_userdetails_target' found. 1 'applicationuser_userdetails_target' expected. the exception thrown: var manager = new usermanager(); var user = new applicationuser() { username = username.text }; //this line @ time of creating user identityresult result = manager.create(user, password.text); i created schema code: public class applicationuser : identityuser { public nullable<datetime> dateofcreation { get; set; } public nullable<bool> isactive { get; set; } public nullable<datetime> lastlogin { get; set; } public userdetails

ios - Implementing "Zoom" feature in AVCamViewController -

ios - Implementing "Zoom" feature in AVCamViewController - i'm trying implement "zoom" feature in app. app supports still image, no video capturing etc.. thought should straight forwards however, i'm able zoom image when take stillimage, image comes out total image, no zoom-in/out effects. i'm using avcamviewcontroller class provided apple. appreciate if guys point i'm missing. - (ibaction)zoomview { self.zoomscale = 1 + self.zoomslider.value; self.previewview.transform = cgaffinetransformscale(cgaffinetransformidentity,self.zoomscale, self.zoomscale); dlog(@"zoom scale:%f",self.zoomscale); } if using apple's sample code, suggest performing zoom on on avcapturedeviceinput object opposed zooming view. for instance, how within uigesturerecognizer (that handles pinch gestures): dispatch_async(self.sessionqueue, ^{ avcapturedevice *device = [[self getactivevideodeviceinput] device]; nserror *err