Posts

Showing posts from January, 2010

Twitter Bootstrap Media Grid: square box with images -

Twitter Bootstrap Media Grid: square box with images - this not question, solution problem had. i'm posting here, because can imagine others utilize it. the problem had was: want show overview of square image tiles using twitter bootstrap (media grid module) fixed width using grid scheme (span2, span3, etc.) without cluttering markup. the less code below works out of box , extension bootstrap library: .squarecolumns(@columnspan: 1) { width: (@gridcolumnwidth * @columnspan) + (@gridgutterwidth * (@columnspan - 1)); height: (@gridcolumnwidth * @columnspan) + (@gridgutterwidth * (@columnspan - 1)); } .maxsquarecolumns(@columnspan: 1) { max-width: (@gridcolumnwidth * @columnspan) + (@gridgutterwidth * (@columnspan - 1)); max-height: (@gridcolumnwidth * @columnspan) + (@gridgutterwidth * (@columnspan - 1)); } ul.square-media-grid { .media-grid; li a.span1 { .squarecolumns(1); img { .maxsquarecolumns(1); } } li a.span2 { .squarecolumns(2); img...

Get the derivative of a function_handle in MATLAB -

Get the derivative of a function_handle in MATLAB - is possible derivative of function_handle other function_handle? like: fun1 = @(x) x^2; % ... disp(fun2); @(x) x*2 i know how find derivative of symbolic function can't convert function_handle symbolic function. i'm new matlab , couldn't find way on doing that. in advance. the short reply "no." matlab has no thought contents of function_handle mean in symbolic sense. you're improve off creating using syms in first place. a longer reply either utilize symbolic math toolbox, suggested @a danesh, or approximation, suggested @andrey. however, if you're working polynomials, can store coefficients array , utilize next functions: polyval evaluate conv multiply deconv divide polyder differentiate polyint integrate matlab derivative function-handle

php - Getting image from mysql database -

php - Getting image from mysql database - not sure happened, script working fine few days ago , i'm not sure have changed have messed up. pulling blob's database , displaying them. script is: <?php include '../dbc.php'; $id = $_post['dropdown']; $query = sprintf('select * images image_id = %d', $id); $result = mysql_query($query); $image = mysql_fetch_array($result); header('content-type: ' . $image['mime_type']); header('content-length: ' . $image['file_size']); echo $image['file_data']; ?> i dont think there wrong script because can echo out $id, $image['mime_type'], , $image['file_size'] fine. echoing $image['file_data'] gives me of symbols on screen lead me believe working fine. when run script get the image "http://localhost/php/pop_category_viewimages.php" cannot displayed because contains errors ive reached end of newbie debugging skills , stuck here. ...

opencv - Issue building xcode Project for real Device -

opencv - Issue building xcode Project for real Device - i have 1 problem , it bothering me while. i m usning opencv framework template project have founded on internet: http://www.eosgarden.com/en/opensource/opencv-ios/download/ i need opencv function comparing 2 images, need convert uiimage iplmage in order utilize in function. however, builds fine on simulator, but, when connect ipad 2 device (i need because i`m using photographic camera in application) compiler throws me error: undefined symbols architecture armv7: "_cvcreateimage", referenced from: +[someviewcontroller createiplimagefromuiimage:] in someviewcontroller.o ld: symbol(s) not found architecture armv7 i seek installing xcode 4.2, have downgraded xcode 4.1, no success. help appreciated. the opencv build you're using pretty old , intended work ios3+4. guess going newer version supports ios5 thought :) take @ this version. grab copy, setup ipad-support , you're go (t...

actionscript 3 - Creating a Popup in FLEX 3.0 -

actionscript 3 - Creating a Popup in FLEX 3.0 - i have created popup custom component extends canvas want of canvas similar showed in image. there thought how create pop similar that. here giving sample code have done till now... <?xml version="1.0" encoding="utf-8"?> <mx:canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="550" height="350" backgroundalpha="0"> <mx:script> <![cdata[ import mx.managers.popupmanager; public function btnimage_click():void { popupmanager.removepopup(this); } ]]> </mx:script> <mx:image source="images/close.png" top="4" left="500" usehandcursor="true" buttonmode="true" click="{btnimage_click();}" /> <mx:fade id="fadein" duration="700" alphafrom="0.0" alphato="1.0"/> <mx:vbox height="1...

Using relative position in Outlook html message -

Using relative position in Outlook html message - i have problem, while using outlook view message. website generates emails html body, using relative position divs create text appear on picture. every other email app displays correct, except of outlook. have workarounds problem? the position property not supported outlook 2007 , 10 solution craft style or come table-based solution back upwards outlook. word 2007 html , css rendering capabilities in outlook 2007 (part 1 of 2) guide css back upwards in email html outlook position relative

How can I get a left-navigation column to fill the entire left side of the middle of a webpage using CSS? -

How can I get a left-navigation column to fill the entire left side of the middle of a webpage using CSS? - i'm working on making web page: http://jsfiddle.net/pw8yj/ and want left navigation area extend way downwards left side, bottom of header top of footer. tried setting height: 100% didn't seem work. there i'm doing wrong here? this never work way you're expecting to. cannot set 100% height element go 100% of content, not height of parent container. what recommend doing removing background leftnav area, , instead, set repeating background on div id="middlearea" gray part repeat-y. way, no matter how big #middlearea gets, background expand regardless. you can seek resources faux columns may give templates , other results you're looking for: http://www.code-sucks.com/css%20layouts/faux-css-layouts/ cheers. css

messaging - CQRS applying cross cutting concerns such as security -

messaging - CQRS applying cross cutting concerns such as security - suppose have complex scheme there big trees of people. simple thoughts employees / manager relationship, many employees study 1 manager. in add-on manager there back upwards staff capable of acting on behalf of manager can manipulate managers' employees. in cqrs scheme how model message hypothetical action of "edit employee" invoker of action back upwards staff. action can succeed if staff fellow member per manager security relationship acting upon employee in realm. verifying security of involve querying database validate person beingness modified indeed within employee chain of manager. where query occur? prior originating "edit employee" message? if info upfront validated before originating message, in consistent scheme suppose before "edit employee" message has been processed separate action has occurred have removed authorization of user finish "...

Move data from SQL Server/PostgreSQL to MySQL -

Move data from SQL Server/PostgreSQL to MySQL - there scenario, have sql server tones of info in it. need re-create fields tables (hardly ever whole table) server runs mysql. there server postgresql. need same thing it. there know way accomplish that? thank in advance! i don't remember how flexible sql server exporting service, sounds need custom script it. mysql sql postgresql

php - PayPal IPN $_POST['txn_id'] not set -

php - PayPal IPN $_POST['txn_id'] not set - i'm using paypal sandbox subscribe button , when ipn response subscription or subscription cancelation $_post['txn_id'] never set. so don't know how identify transactions take unique ones thanks! edit: illustration info have in post subscr_cancel : amount1, amount3 , address_status, subscr_date, payer_id, address_street, mc_amount1, mc_amount3, charset, address_zip, first_name, reattempt, address_country_code, address_name, otify_version subscr_id custom payer_status business address_country address_city verify_sign payer_email btn_id last_name address_state receiver_email recurring txn_type item_name mc_currency residence_country test_ipn period1 period3 correlation_id according table 2. summary of subscription variables: for subscription variables, transaction id (txn_id) available usd payment , multi-currency payment transaction types (txn_type). as expected, paypal not send txn_id ip...

Javascript or Jquery auto populate one input text based on another input value -

Javascript or Jquery auto populate one input text based on another input value - i not @ js or jquery. take follow code improve explaining what. when user input 400 or more triglycerides, ldl autopopulated 'n/a'. how implement js or jqeury that? thanks <form> <input name='triglycerides" value="" /> <input name='ldl' value="" /> </form> my actual code follows: $('#ldl_override').keyup(function(){ var val = parseint($(this).val()); if(val > 399) $('#qin726').val('n/a'); }); elseif($ldl_override && $questionid == 728) { $question .= "<input $maxlengthstring id=\"ldl_override\" name=\"field[" . $questionid . "]\" type=\"text\" value=\"" . htmlspecialchars($answer) . "\" />\n"; } with jquery: <form> <input name="triglycerides" value="" onchange=...

iphone - Base64 HTML embedded images not showing when mailed -

iphone - Base64 HTML embedded images not showing when mailed - i embedding images have been base64 encoded in html follows: [html appendformat:@"<html><body><p><b><img src=\"data:image/png;base64,%@\"></b></p></body><html>", base64imagestring]; i create new email follows: mfmailcomposeviewcontroller *mailvc = [[mfmailcomposeviewcontroller alloc] init]; mailvc.mailcomposedelegate = self; [mailvc setmessagebody:html ishtml:yes]; [self presentmodalviewcontroller:mailvc animated:yes]; the embedded image show in new email before sent, not displayed in email client mail service delivered. think fact image shows in draft shows embedding process successful, dont understand why not show when delivered. looking @ raw html in delivered mail service shows: src="cid:(null)" help appreciated please! i stumbled same problem , solution rather convoluted. possible embed image in email. problem...

c# - Is it ok practice to use a static class to collect common event handlers? -

c# - Is it ok practice to use a static class to collect common event handlers? - in windows forms app, there things want various controls of same type on different forms upon events. example, want single click on datagridviewcell textbox-type , not read automatically come in edit mode. simple event handler code, in case on form datagridview called dgvparms , is: private void dgvparms_cellclick(object sender, datagridviewcelleventargs e) { datagridviewcell c = dgvparms[e.columnindex, e.rowindex]; if (!c.readonly && c datagridviewtextboxcell) { dgvparms.currentcell = c; dgvparms.beginedit(true); } } i move method static class, commonevents , , on individual forms' load handlers assign static method definition respective datagridviews' cellclick event this.dgvparms.cellclick += commonevents.dgveditoncellclick; is acceptable or practice? or preffered maintain event handler logic each consuming form's code?...

php - Symfony2: best practive how to get data from another bundle? -

php - Symfony2: best practive how to get data from another bundle? - i'm new symfony2 , there things don't right now. in case want display albums made band or artist. if user logged in want display on same page, if 1 album in collection of user or not. i've different bundles "artistbundle", "userbundle", "albumbundle" etc. since user related info nil belongs in artistbundle ("separation of concerns") want info userbundle. right see 2 ways this: <?php namespace acme/artistbundle/controller; utilize acme/userbundle/user public function indexaction() { ... $user = new user($userid); $collectioninfo = $user->checkartistalbums($artistid); ... } this solution might work makes unit tests harder since i'm not using dependency injection (which right way think). the other possibilty embedding userbundle controller in template. can't done since need info straight in output of artistbundle. ...

display php nested array results continuously in 2 column table -

display php nested array results continuously in 2 column table - i have nested array grouping 3 other arrays: $online, $busy , $offline, in order display results in order. $conteudo = array($online, $ocupado, $offline); the disired result table in 2 columns display results in continuous flow this: online1 | online2 online3 | busy1 busy2 | offline1 offline2| offline3 offline4| i've been trying lots of foreach loops , playing around changing html tags, closiest can arrive of desired result this: <table width='100%' cellpadding='5' border="1"> <?php $i = 1; //contador de colunas $max_colunas = 2; // numero de colunas foreach ($conteudo $row) { echo "<tr>"; foreach ($row $col) { foreach ($col $cell) { if ($i == 1) { echo "<td>" . $cell . "</td>"; } elseif ($i == $max_colunas){ echo "<td>" . $cel...

c - How to get the status of command run by system() -

c - How to get the status of command run by system() - see using 1 scheme phone call in c code #include <sys/stat.h> #include <stdio.h> int main(int argc, char *argv[]) { int = system("./test12.out"); //here if giving wrong commad system("echo $?") printf("system homecoming %d",a); } there isnt test12.out file in current folder. output sh: ./test12.out: no such file or directory 0 scheme homecoming 32512 here shell command got fail how can know in c code? edit: so can go int main(int argc, char *argv[]) { int = system("dftg"); if(a == -1) printf("some error occured in shell command"); else if (wexitstatus(a) == 127) printf("that shell command not found"); else printf("system phone call homecoming succesfull %d",wexitstatus(a)); } if a == -1 , phone call has failed. otherwise, exit code wexitstatus(a) . to quote man 3...

jQuery or css slideUp/slideDown for a selectbox with size > 1 -

jQuery or css slideUp/slideDown for a selectbox with size > 1 - jquery's slideup , slidedown don't seem selects. can wrap select in div , utilize slideup , slidedown, far effect get, result want, jerky. with select box of size greater 1, want slide up, leaving size 1 select. (not totally hidden select.) so appearance looking animated transition from <select size=10> <option value="1">foo1</option> <option value="2">foo2</option> <option value="3">foo3</option> <option value="4">foo4</option> <option value="5">foo5</option> <option value="6">foo6</option> <option value="7">foo7</option> <option value="8">foo8</option> <option value="9">foo9</option> <option value="10">foo10</option> </select> to <select> <option value=...

ios - How can I show a NSDate countdown in 000:00:00:00 format? -

ios - How can I show a NSDate countdown in 000:00:00:00 format? - i have next code show countdown specific date: nsdate *date=[nsdate date]; int secondsnow=(int)[date timeintervalsince1970]; nsdateformatter *formatter=[[nsdateformatter alloc] init]; [formatter setdateformat:@"yyyy"]; nsstring *launchbegin=[nsstring stringwithformat:@"20120126"]; // come in date of launch here in format yyyymmdd [formatter setdateformat:@"yyyymmdd"]; nsdate *otherdate=[formatter datefromstring:launchbegin]; int secondstarget=(int)[otherdate timeintervalsince1970]; int differenceseconds=secondstarget-secondsnow; int days=(int)((double)differenceseconds/(3600.0*24.00)); int diffday=differenceseconds-(days*3600*24); int hours=(int)((double)diffday/3600.00); int diffmin=diffday-(hours*3600); int minutes=(int)(diffmin/60.0); int seconds=diffmin-(minutes*60); countdownlabel.text=[nsstring stringwithformat:@"%d:%d:%d:%d",days,hours,minutes,seconds]; // want a...

html - Can't get footer image to display in IE8? -

html - Can't get footer image to display in IE8? - i'm having difficulty getting footer image in net explorer 8 display on site datingshotgun.com. "footer-logo.png" injected tag. <!doctype html> <html> <head> <meta charset="utf-8"/> <title>datingshotgun.com</title> <link rel="stylesheet" href="css/styles.css"/> <!-- typekit --> <script type="text/javascript" src="http://use.typekit.com/mtx2hld.js"></script> <script type="text/javascript">try{typekit.load();}catch(e){}</script> <!-- jquery --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <!-- custom script --> <script src="js/scripts.js"></script> <!-- google analytics --> <script type="text/javascript"> v...

android - how to implement a custom camera with buttons? -

android - how to implement a custom camera with buttons? - i want develop application custom camera 1 button on it. when click on button image should clicked. 1 time image clicked there should 2 buttons 'save' , 'retake'. if click on save button captured image should saved specified directory. if click on retake button should navigate previous screen(camera button). i have gone through many sites , links.but nil helped me.please help me.. follow this link. you'll basic thought how go creating custom photographic camera app. 1 time you've assigned image capture intent capture button, can go ahead. suggest take 1 step @ time if you're new android. can find more info on building photographic camera apps here. android button android-camera

c# - Linq To Entities Query -

c# - Linq To Entities Query - consider next query : var profilelst = ( in dbcontext.prospectprofiles i.createid == currentuser select new prospectprofile { prospectid = i.prospectid, live = i.live, name = i.name, serviceeta = i.opportunities.orderbydescending(t => t.followupdate) .firstordefault() .serviceeta.tostring(), followupdate = i.opportunities.orderbydescending(t => t.followupdate) .firstordefault() .followupdate } ) .tolist(); homecoming profilelst.orderbydescending(c=>c.followupdate) .skip(0).take(endindex) .tolist(); here in query please take @ followupdate , servicetype , these both have fetched chance table, there other work around these both.. one many relationship in tables like: prospectprofile -> opportunities whether query have written ok or there ...

android - convert touched value to points based on matrix -

android - convert touched value to points based on matrix - i translating , scaling image matrix, have matrix values . matrix value want convert touch coordinates position getting matrix. should ? please help me asap. private void drawpoint(float x, float y, float pressure, float width) { // left tx of matrix // top ty of matrix float curx = (x - left) / (scale * scale); float cury = (y - top) / (scale * scale); canvas.drawpoint((curx - left), (cury - top) , mpaint); } i know it's old post, had same problem. i have image applied matrix transformation, first resize it, , translation. image = new matrix(); image.setscale(zoom, zoom); paint drawpaint = new paint(); drawpaint.setantialias(true); drawpaint.setfilterbitmap(true); float centerscaledwidth = image_center.x * zoom / 2; float centerscaledheigth = image_center.y * zoom / 2; image.posttranslate(screen_center.x - centerscaledwidth, ...

codeigniter 2 - how to use a rich textarea input instead of normal textarea input? -

codeigniter 2 - how to use a rich textarea input instead of normal textarea input? - i want utilize rich textarea input field instead of normal textarea input field in 1 of projects codeigniter. how can this? can help? using codeigniter 2.1.0. m familiar method of <?php echo form_open('post_to_blog');?> <?php echo form_textarea('blog','blog');?> <?php echo form_submit('submit','submit');?> <?php echo form_close();?> but results simple text area input field returns plain texts. want input texts rich , styled. help me please. you can using jquery plugin. tiny_mce solution. easy use. search google , see documentation that. include file normal javascript , enjoy. beleive thing. realy good. i think these links shall useful you.. http://www.tinymce.com/download/download.php http://www.tinymce.com/tryit/jquery_plugin.php textarea codeigniter-2

pjax alternatives for ruby on rails -

pjax alternatives for ruby on rails - finding interesting railscast on pjax http://railscasts.com/episodes/294-playing-with-pjax i inquire advice if there other tools / gems can update portion of page? have tried build similar basic ajax div replaced content, wich not ideal. pjax looks promising there other options out there recommend on pjax? the point of involvement pjax not update arbitrary content without reloading page. jquery (as javascript frameworks). thought combine "basic" feature html 5 force state api improve users experience (for illustration utilize of browsers next/previous buttons whenever perform ajax call). unfortunately, html5 history api not implemented same way browsers. force state / history api part working consistently may have history.js provides fallback features html 4 browsers. anyhow, jquery , tons of plugins (ajax form, jquery tabs, etc.) allow update page content without reloading whole page. ruby-on-rails ruby-on-...

python - Txredisapi exceptions.RuntimeError: maximum recursion depth exceeded -

python - Txredisapi exceptions.RuntimeError: maximum recursion depth exceeded - i trying delete keys except in redis, , next exception: ... file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/twisted/protocols/basic.py", line 572, in datareceived homecoming self.rawdatareceived(data) file "build/bdist.macosx-10.6-intel/egg/txredisapi/protocol.py", line 184, in rawdatareceived file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/twisted/protocols/basic.py", line 589, in setlinemode homecoming self.datareceived(extra) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/twisted/protocols/basic.py", line 564, in datareceived why = self.linereceived(line) file "build/bdist.macosx-10.6-intel/egg/txredisapi/protocol.py", line 134, in linereceived exceptions.runtimeerror: maximum recursion depth exceeded here code...

asp.net - Want to show Update Progress control on top of ModalPopExtender -

asp.net - Want to show Update Progress control on top of ModalPopExtender - i have content page update panel , update progress controls. update progress command displayed when page posts back. have added modal popup extender page. when post fired modal popup extender, update progress command displayed, underneath modal popup extender. how can forcefulness update progress command appear on top? increase z-index of updateprogress via css. .progress { z-index: 100002 !important; } edit: added !important rule, on safe side. asp.net ajaxcontroltoolkit modalpopupextender updateprogress

c# - CrystalReportViewer.SelectionFormula IN() function -

c# - CrystalReportViewer.SelectionFormula IN() function - is ther way : crview.selectionformula = "report.field in (2,3,4,5)" the syntax of selection formula be "{report.field} in [2,3,4,5]" c# .net sql-server crystal-reports

jQuery Cycle: Update currSlide onClick -

jQuery Cycle: Update currSlide onClick - i'm using jquery cycle plugin create image slideshow. works great, have minor issue can't seem solve. if click on "prev" or "next" links slideshow counter doesn't update until after animation has finished. ideally slideshow count update clicked on either of these links, , animation take place. jsfiddle here: http://jsfiddle.net/dd52s/ instead of after callback utilize before callback if want counter set before animation begins. seek this $(document).ready(function() { $('.slideshow').cycle({ fx: 'scrollhorz', timeout: 0, next: '.next, .slideshow img', prev: '.prev', speed: 600, before: onafter, }); function onafter(curr,next,opts) { var caption = ($(next).index() + 1) + '/' + opts.slidecount; $('.counter').html(caption); } $('.description').cycle({ ...

MacRuby: How to read a plist file? -

MacRuby: How to read a plist file? - i bet super simple , easy can't find basic illustration online. how can read info plist file in project using macruby? solution: turns out there's few different ways it, cleanest i've found (so far) utilize macruby helper method load_plist (which turns plist file's contents hash). also, if you're using xcode, need file path relative app bundle: # there's appconfig.plist file in app bundle config_path = nsbundle.mainbundle.pathforresource('appconfig', oftype: 'plist') @config = load_plist file.read(config_path) this slide deck macruby has illustration code accessing plist files (slides 77-80), gist of open file nsdictionary.dictionarywithcontentsoffile , manipulate ruby hash, write 1 time again writetofile_atomically . nsdictionary documentation might useful you; can find here. plist macruby

Inline Image vs Temporary Files (Java XHTML->PDF generation) -

Inline Image vs Temporary Files (Java XHTML->PDF generation) - i have project need generate pdf file. within pdf have insert body of text 4 or 5 big images (roughly 800px*1000px). in order create flexible have opted utilize freemarker in conjunction xhtmlrenderer (flying-saucer). i faced couple of options: create images , save them temporary files disk. process .xhtml template freemarker (saving disk) , pass processed .xhtml file url xhtmlrenderer generate pdf. these created files (bar pdf) created file.createtempfile . allow freemarker pick images off disk (as if images linked in xhtml) process .xhtml template , maintain in memory. pass images template base64 encoded info urls. remove need saving temporary files output freemarker passed straight xhtmlrenderer. base64 encoded image url illustration (a little folder icon): <img src="data:image/gif;base64,r0lgodlheaaoalmaaoaztoehh0tls/7lzv/0jvb29t/f3//ub/ /ge8wslf/rhf/3kdbw1mxsbp//mf///yh5baaaaaaalaa...

postgresql - Rails 3.1 - escaping user's input -

postgresql - Rails 3.1 - escaping user's input - good day everyone! how can escape string of user's input search form which'll utilize in sql query? in controller. for example, this: time 10:15 pm. should this: time 10\:15 pm. note: search in db (postgresql) gem (texticle). erb::util.html_escape give total explanation :) ruby-on-rails-3 postgresql ruby-on-rails-3.1 escaping

c++ - cpp linux: about rdtsc -

c++ - cpp linux: about rdtsc - i'm using next function in code: static __inline__ unsigned long long rdtsc(void){ unsigned long long int x; __asm__ volatile (".byte 0x0f, 0x31" : "=a" (x)); homecoming x; } does function homecoming number of ticks since lastly boot? can find documentation function? rdtsc gets number of cpu cycles since lastly reset, see wikipedia. the intel instruction set manual vol 2a & b, more trusted source: the processor monotonically increments time-stamp counter msr every clock cycle , resets 0 whenever processor reset. see “time stamp counter” in chapter 16 of intel® 64 , ia-32 architectures software developer’s manual, volume 3b, specific details of time stamp counter behavior. as side note: shouldn't emitting bytes, rather utilize actual rtdsc instruction mnemonic, makes far more readable. c++ linux rdtsc

Video playing in Android tablet -

Video playing in Android tablet - i want play big video using http on android tablet. i don't want save viedo on device. is, if big video info received web service in little chunks, don't want save binary info , later play video. want play video downloads. is possible? simply encode video using ffmpeg , utilize qt-faststart tool enable streaming. utilize command encode videos android phones $ ffmpeg -i infile.mp4 -s 480x320 -threads 4 -vcodec libx264 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 5 -bf 0 -flags2 +mixed_refs -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 15 -qmax 20 -qdiff 5 -b 700k -r 600 -acodec libfaac -ar 48000 -ab 48000 -pass 1 outfile.mp4 my code kind of low quality tablets. so, experiment changing resolution, bitrate etc. android video video-streaming media-player

c# - Is it good practice to use the same Variable names for both method call and method signature parameters? -

c# - Is it good practice to use the same Variable names for both method call and method signature parameters? - for example: int a; int b; int value = getvalue(a,b); private int getvalue(int a, int b) { int value = a+b; homecoming value; } is above practical or considered bad practice , cause problem later in development. i realize it's contrived illustration demonstrate you're asking, illustration does contain naming problem i'll point out: int a; // <---- right here int b; // <---- , here int value = getvalue(a,b); // <--- , little here private int getvalue(int a, int b) { int value = a+b; homecoming value; } the problem isn't in whether or not variable names match or don't match they're called in method. problem variable names aren't called meaningful. considerably more of issue you're asking. let's re-factor method create illustration less contrived... int a; int b; int value = getsu...

javascript - How to delete a table row on button click of corresponding row? -

javascript - How to delete a table row on button click of corresponding row? - this code: function deletehosttable(src) { var table = src.parentnode.parentnode.parentnode; if(table.rows.length > 1) { table.deleterow(src.parentnode.parentnode); } } function addhost(src) { var table = src.parentnode.parentnode.parentnode; var newrow = table.insertrow(table.rows.length-1); var cell = newrow.insertcell(newrow.cells.length); cell.innerhtml = '<input type="hidden" name = "vtieridh" value = "vtierid" />' cell = newrow.insertcell(newrow.cells.length); cell.innerhtml = '<img src="images/minus.gif" onclick="deletehosttable(this);return false;"/>'; cell = newrow.insertcell(newrow.cells.length); cell.classname = "pagetitle"; cell.innerhtml = '<input...

javascript - Event handling - onClick - with Google Analytics with an tag -

javascript - Event handling - onClick - with Google Analytics with an <embed> tag - i using embed tag play sound clips users on 1 of pages. looks like: <embed src='my_soundfile.wav' type='audio/wav' controls='smallconsole' autostart='false' onclick="_gaq.push(['_trackevent', 'audio', 'play', 'my_soundfile.wav']);"> </embed> when check google analytics (after 24 hrs.), nil showing up. doing incorrectly? thanks. i think quicktime capturing click events, if replace onclick="_gaq..." with onclick="alert('test');" you see id doesn't work either. javascript google-analytics

javascript - Add & Subtract TR on Button Click (ID +1) -

javascript - Add & Subtract TR on Button Click (ID +1) - hey i'm looking have table of products order form. i user able add together & subtract rows (adding & removing products w/ qty & remarks.) i have pieced , works few exceptions. i need id of each input +1 while val('') on new inputs/row. the subtract button works removes lastly & row. removing & add together button it. could show me examples of how +1 inputs & have subtract button show on 2nd row? or lead me in right direction? in advance- html: <table id="mytable" width="250px" border="0" cellspacing="0" cellpadding="0" style="text-align:center;> <thead> <tr class="product"> <th style="text-align:center;"><strong>item</strong></th> <th style="text-align:center;"><strong>qty.</strong></th> <th style=...

visual studio 2010 - VS2010 - Open a solution, file in this sln will open too -

visual studio 2010 - VS2010 - Open a solution, file in this sln will open too - i created little application (win forms) thats create solution, adds project , files project. clicking button, new solution should open installed vs2010 express. thats works fine, ok. question, there way open specific file in solution when hole solution loaded? improve understanding, user (of application) creates sln 3 files (a.cs, b.cs , c.cs). selects b.cs (in application), , opens sln. in editor in vs, preselected b.cs should open. i've tried create sou - file, think thats not right way... is there way this?! thx , regards sascha visual studio remembers files had open when lastly closed solution, along other things breakpoints, using suo file. can check simple experiment: close solution single file opened within (a.cs, example), manually delete suo file (don't worry, vs recreates if doesn't exists) , when open solution 1 time again you'll see won't have file opene...

MyEclipse keeps corrupting my Tortoise SVN repository? -

MyEclipse keeps corrupting my Tortoise SVN repository? - i'm having unusual behavior myeclipse build id: 8.6-20100723 , svn. have java struts application source , output folders defined as: pref_center/war/src/main/webapp/web-inf/classes --output folder pref_center/jar/src/main/java ---java files when open project in eclipse, create changes , save project, eclipse automatically copies .svn folders java directory classes folder. copies .java files have been changed classes folder. result svn recognizes src/main/java directory , web-inf/classes directory same tree. leads countless conflicts , destruction of svn repository. current workaround manually delete .svn folders under classes path (which have ignored in svn) avoid corrupting repository every time before checkin. how can ensure myeclipse doesn't re-create .java or .svn files classes folder? bug or can turned off note:not sure if matters not utilize myeclipse build project. utilize maven build , ...

php - The standard way for switching from/to user_timezone and gmt -

php - The standard way for switching from/to user_timezone and gmt - i utilize php's date_default_timezone_set() , set according user's timezone field in the user table. ease can show date/time users , date/time them. but storing date related values in database, have utilize standard gmt timezone. the question: what best or maybe standard way switching to/from user_timezone , gmt? do suggest me follow these steps when want insert or update field in database? change timezone using date_default_timezone_set('gmt'); get time using $inserttimestap = time(); or $inserttimestamp = mktime(); change timezone user default using: date_default_timezone_set($this->session->userdata('timezone')); there absolutely no need utilize date_default_timezone_set('gmt') because converting gmt, there special set of functions function names begin 'gm': gmmktime() gets timestamp in gmt timezone. gmdate() gives gmt date format. th...

spring mvc - How to implement multi-action controllers -

spring mvc - How to implement multi-action controllers - i pretty familiar asp.net mvc, want seek spring mvc. did tutorial examples. in asp.net mvc, can set many action methods in single mvc controller class, seems me in spring mvc, can have "one" action method in controller class? i wondering find out spring mvc correspondence of action methods in asp.net mvc? can have many action methods in single controller how asp.net mvc does? in spring mvc, can have "one" action method in controller class i'm not sure got from, it's not true now, , never has been. you've been misinformed. look @requestmapping -annotated methods in spring docs, or old-style (and obsolete/deprecated) multiactioncontroller . spring-mvc

.net - my thread does not see windows Form components -

.net - my thread does not see windows Form components - i'm making windows form application uses threads, threads running , works, want thread access form components. btnmain not seen within thread function. how can solve this?, here code #pragma 1 time namespace winappsocket { struct struttura{ char c; int num; } mystruct; uint serverthread(lpvoid pparam) { printf("starting tcp server\r\n"); socket server; wsadata wsadata; sockaddr_in local; int wsaret=wsastartup(0x101,&wsadata); if(wsaret!=0) { homecoming 0; } local.sin_family=af_inet; local.sin_addr.s_un.s_addr=inaddr_any; local.sin_port=htons((u_short)20248); server=socket(af_inet,sock_stream,0); if(server==invalid_socket) { homecoming 0; } if(bind(server,(sockaddr*)&local,sizeof(local))!=0) { homecoming 0; } if(listen(server,10)!=0) { homecoming 0; } socket client; sockaddr_in from; int fromlen=sizeof(from); int buffer; char buff; while(true) { client=accept(server,(struct...

cocoa - glMultiDrawElements stops my code -

cocoa - glMultiDrawElements stops my code - i'm trying larn opengl "the redbook", , i'm @ point i'm testing glmultidrawelements. got code work gldrawelements, , other "simpler" methods, stops working here, , i'm completly stuck. code supposed draw cube, , acctuall drawing code posted under: glfloat verticies[] = {-0.5, -0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5}; glvertexpointer(3, gl_float, 0, verticies); glubyte front[] = {4, 5, 6, 7}; glubyte left[] = {0, 3, 7, 4}; glubyte right[] = {5, 1, 2, 6}; glubyte back[] = {0, 1, 2, 3}; glubyte bottom[] = {0, 1, 5, 4}; glubyte topp[] = {2, 3, 7, 6}; glvoid *faces[6] = {front, left, right, back, bottom, topp}; glmultidrawelements(gl_quads, 4, gl_unsigned_byte, faces, 6); glflush(); the programme cocoa based, , compile fine, stops under running due "exc_bad_access". there yellowish warning triangle next g...

javascript - rails server / console error - no such file to load -- coffee-script (LoadError) -

javascript - rails server / console error - no such file to load -- coffee-script (LoadError) - i on ubuntu, editor scite i create new project server , console don't work i have on command ==> [store]$ rails s /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/coffee-rails-3.2.1/lib/coffee-rails.rb:1:in require': no such file load -- coffee-script (loaderror) /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/coffee-rails-3.2.1/lib/coffee-rails.rb:1:in ' /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in require' /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in block (2 levels) in require' /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in each' /usr/local/rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in block in require...

javascript - Given a paragraph of text, how to get everything from the start to the last whitespace? -

javascript - Given a paragraph of text, how to get everything from the start to the last whitespace? - given block of text so: "hello world http://yahoo.com " on keypress i'm looking @ text links. don't want links in text while user still typing, example: "hello world http://yahoo.co" how can in text var starting left, 0, way lastly white space, meaning don't url while user typing it? thanks updated typing hello world http://yahoo.com should homecoming hello world http://yahoo.com typing hello world http://yahoo.co should homecoming hello world is two methods: first, regular expression: var str = "hello world http://yahoo.co", expr = /(.+\s).*$/ result = str.match( expr ) ; console.log( result ); // => ["hello world http://yahoo.co", "hello world "] console.log( result[1] ); // => "hello world " second, lastindexof : var str = "hello wo...

python - How to setup the same Django Virtual Environemnt in two computers? -

python - How to setup the same Django Virtual Environemnt in two computers? - currently need setup production django app in computer , know what's best way it? production server uses virtualenv , executed next commands info environment. thanks $ uname -a linux domu-12-31-39-0c-75-e2 2.6.34.7-56.40.amzn1.x86_64 #1 smp fri oct 22 18:48:49 utc 2010 x86_64 x86_64 x86_64 gnu/linux $ pwd /home/ec2-user/virtenvs/django-1.2.5/ $ ./pip freeze cheetah==2.4.1 django==1.2.5 m2crypto==0.20.2 markdown==2.0.1 mysql-python==1.2.3 pil==1.1.7 pyyaml==3.05 pygments==1.1.1 south==0.7.3 boto==2.0b4 cloud-init==0.5.15 configobj==4.6.0 distribute==0.6.10 django-classy-tags==0.3.3 django-cms==2.1.3 django-haystack==1.1.0 django-tinymce==1.5.1a1 iniparse==0.3.1 policycoreutils-default-encoding==0.1 pycurl==7.19.0 pygeoip==0.1.5 pygpgme==0.1 pysolr==2.0.13 pysqlite==2.6.0 python-levenshtein==0.10.2 pytz==2011c pywurfl==7.2.1 setools==1.0 urlgrabber==3.9.1 virtualenv==1.5.1 yum-metadata-parser==1....

Android get textView value inside widget -

Android get textView value inside widget - is there way value textview item within widget ? have 2 textviews in widget layout , on widget update want set new value 1 of them , don't want alter value of sec one. when set value remoteviews.settextviewtext(r.id.text1, newvalue"); widgetmanager.updateappwidget(thiswidget, remoteviews); this setting value of sec textview default value defined in layout. how not alter value of sec textview, or how value sec textview able adjust same ? it understanding whenever onupdate called, updates of widgets, utilize sharedpreferences, when set textview save textview text sharedprefs , preference when update. , within for loop. here onupdate : @override public void onupdate(context context, appwidgetmanager awm, int[] appwidgetids){ sharedpreferences pref = preferencemanager.getdefaultsharedpreferences(context); int appwidgetid; (int i=0;i<appwidgetids.length;i++){ appwidgetid =...

javascript - NowJS server event notifications -

javascript - NowJS server event notifications - i'm trying implement scheme external server (superfeedr) sends request server (running node) , server processes, sends info straight client in realtime using nowjs. problem is, cannot access everyonce namespace in server functions since has initialized after listen() function called has happen after functions declared. basically: needs: nowjs->listen->server functions->everyone variable->nowjs seems have dependency loop , have no thought how resolve it. start of them independently. when 1 of them up, set reference shared parent scope. when e.g. server receives notification, drop if nowjs isn't ready yet. simplified example: var a, b; initializea(function(a_) { = a_ a.on('request', function(request, response) { if (!b) { // b isn't ready yet, drop request homecoming response.end() } // ... }) }) initializeb(function(b_) { b = b_ b.on('request...

javascript - Cannot return from outside a function or method? -

javascript - Cannot return from outside a function or method? - while developing web application want perform validation check , after sucesssful validation need post form , redirect command next page. javascript code: function fncheckemptyfield() { var strdomain = document.getelementsbyname("txtiidn").value; if (strdomain == null) { document.getelementbyid("lblvaliditystatus").innerhtml = ""; document.getelementbyid("lblvaliditystatus").innerhtml = "domain name field can't left blank"; homecoming false; } else { homecoming true; } } relevant html code: <form action="result.jsp" name="validitycheck" onsubmit="return fncheckemptyfield()"> <input type="text" id="txtiidn"/> <input type="submit" id="btnvaliditycheck" value="check validity" /> </form...

jquery - "overflow-x:hidden" one side only? -

jquery - "overflow-x:hidden" one side only? - is possible hide horizontal overflow of element on 1 side only: left or right? overflow-x-right:hidden; . open css , jquery based tips. all content starts on left, unless otherwise defined. if want content on left hidden, consider making element position: absolute , , setting right: 0 . combine overflow-x: hidden , should accomplish goal. jquery html css

python - Checking if authenticated in Django template inheritance -

python - Checking if authenticated in Django template inheritance - i have next code in template , having difficulty showing when user logged in. able login, when revisit page, shows i'm still not authenticated. {% extends "base.html" %} {% load catalog_tags %} {% block site_wrapper %} <div id = "main"> <a href="#content" class="skip_link">skip main content</a> <div id = "banner"> <div class="banneriepadder"> <div class="cart_box"> {% cart_box request %} </div> </div> </div> <div style="float:right;">[search box goes here]</div> <div id="navigation"> <div class="naviepadder"> <!--navigation tabs @ top of each page --> {% comment %}{% include "tags/navigation.html" %} {% endcomment %} {% category_list request.path %} ...