Posts

Showing posts from March, 2014

In Python I put print() but still get a syntax error -

i read answers here print() parentheses. have put them , syntax error anyway. can tell why? python 3.3.2+ (default, feb 28 2014, 00:52:16) [gcc 4.8.1] on linux >>> answer = "no" >>> while answer == "no": ... answer = input("are there? ") ... print("we're there!") file "<stdin>", line 3 print("we're there!") ^ syntaxerror: invalid syntax yes, can see ... prompt keeps print line under while loop. if press 2 times enter prints string input. >>> answer = "no" >>> while answer == "no": ... answer = input("are there? ") ... there? well since you're in interpreter, can see 3 dots again, means it's still expecting under while loop. press enter again , work. if want print part of loop, indent it, press enter , press enter again. hope helps! 1: >>> answer = "no" 2: >>> while

jquery - Hide div when mobile pinch zoom level > 100% -

i hide div when mobile zoom level (as initiated pinch zoom gesture on mobile browser) larger 100%. e.g. when user zooms in on webpage, div disappears (because div fixed , don't want visible when zoomed in, otherwise it's enlarged self takes on entire viewport. i using jquery , jquery mobile , can use hammer.js if helps? cheers new zealand! phill i've tried far hammer(document).on("pinch", function (event) { if (event.gesture.scale > 1) { $('#test').text(event.gesture.scale); $('.sb-slide').fadeout(); } else { $('.sb-slide').fadein(); } });

apache - Cyrillic / Russian filenames - 404 not found -

i trying upload russian filenames e.g. автомобилей.php end in 404 error. i've tried specify charset in filezilla while uploading files cp-1251, windows-1251, cp1251 still getting a not found the requested url /автомо not found on server. any ideas on how can have resolved? expert advise appreciated. convert them in latin script symbols. best , easiest way. it's bad practice use non latin script file names in web. possible make urls in cyrillic .

java - libgdx rendering srite over another causes background sprite to disapear -

image of problem http://imgur.com/znphiiu succesfully rendered background game , tried render sprites on top of , screen gets messed big blue l. code main public class wizardgame extends game { public static final string title = "are bad enough wizard save princess?!", verision = "0.0.0.0.prealpha"; playtest pt = new playtest(); private fpslogger fps; public void create() { gdx.gl20.glclearcolor(0, 0, 0, 1); gdx.gl20.glclear(gl20.gl_color_buffer_bit); fps = new fpslogger(); fps.log(); pt.create(); } public void dispose() { super.dispose(); } public void render() { super.render(); pt.render(); } public void resize(int width, int height) { super.resize(width, height); } public void pause() { super.pause(); } public void resume() { super.resume(); } } playtest code public class playtest implements screen { private textureatlas atlas; private atlasregion floor; private spritebatch batch; private orthographicc

Scan Php code looking for Gettext -

i need generate .po files php code of web application. large application needs translated several different languages. far, have been using poedit in order generate .po files. problem lies in many of files lack gettext notation echo _("message") , in past used echo "message" . this think best solution issue: create script scans php code , tells me of messages being , not being displayed using gettext . how this? replace string not using gettext appropriate gettext pattern. can please advise me best aproach in order code using gettext should to? you have 1 way how convert echoing messages without translation gettext echoing messages translation gettext: if know messages represented 1 variable, example $message , following way made relatively fast, else have find used echoing of messages ... , manually (mostly if message 1 - , represented text, not variable holding text). in editor start global search (in files) , then, go file file

actionscript 3 - Supporting Multiple Screen Sizes for Android AIR AS3 -

hey created game using flash cs6 , flash develop as3. now stage width 480 , height 800 480 800. now on phone fits on others doesnt fill whole screen @ all. looks ugly. looked through lot of forums questions on here still can't seem find exact answer on how go doing this. confused. i have these properties in mainengine class: import flash.display.stagescalemode; and in constructor: //scale stage.scalemode = stagescalemode.no_scale; stage.align = stagealign.top_left; this nothing make screen uglier , shrinks whole screen. please if can assist need add in order support multiple screen sizes ill appreciate it! read here learn basics how work multiple screens: http://www.adobe.com/devnet/air/articles/multiple-screen-sizes.html

java - Diamond shorthand syntax not working javac -

when compile this: linkedblockingdeque<integer> q = new linkedblockingdeque<>(); in eclipse java ee kepler version, works fine, once try compile same program in in terminal javac myprogram.java in command line, receive "illegal start of type" error, on <> i know diamond shorthand came java 7, why terminal use javac of java 6 , not 7? , how correct permanently? i'm on linux, mint 15. running javac -version revealed this ~ $ javac -version javac 1.6.0_27 apparently have 2 separate versions of java installed. in eclipse, can specify location of jdk - set 1.7. in terminal, path variable contains (first) location of jdk 1.6. looks you're running linux/unix, try printing path variable: $ echo $path you'll see in there path jdk 1.6; path jdk 1.7 may there after jdk 1.6 path. edit ~/.profile file , edit path accordingly - remove jdk 1.6 , add jdk 1.7. if, on other hand, path jdk 1.6 set on system level (e.g.

string - first and last words in alphabetical order in c -

this c prog takes 5 words separated spaces , gives first , last word acc alphabetical order. eg.enter 5 words: banana ap pa kiwi orange. first word=ap last word=pa.no error shown prog isn't working, more 5 words being accepted.this code: void findword(char word[][20], char *first, char *last); int main() { char word[5][20]; char *first, *last; printf("enter 5 words separated spaces: \n"); (int = 0; < 5; i++) { (int j = 0; j < 20; j++) scanf("%c", &word[i][j]); } first = word[0][0]; last = word[0][0]; findword(word, &first, &last); printf("the first word is: %s , last word is: %s ", first, last); } void findword(char word[][20], char *first, char *last) { int k, l; (k = 0; k < 5; k++) { (l = 0; l < 20; l++) { while ((word[k][l] != '\0') && (word[k][l] == ' ')) { if (w

c# - How to decrypt with WinRT without changing existing encryption code in .NET Desktop App? -

i have little problem whole encrypt/decrypt cr*p ;-) is possible decrypt data in winrt (windows store app) encrypted in .net desktop application , vice versa? cannot change code of desktop app because in use. i tried few tutorials cryptographicengine in winrt never results match ones desktop app. maybe me? i'm new .net development , never did encryption have no idea i'm doing ;-) here of code used in desktop app - can't change code! private string pwd = "password"; private string salt = "salt"; public byte[] encrypt(byte[] data) { passwordderivebytes derivedpassword = new passwordderivebytes(pwd, encoding.ascii.getbytes(salt)); byte[] key = derivedpassword.getbytes(16); byte[] iv = encoding.ascii.getbytes("1234567891234567"); rijndaelmanaged symmetrickey = new rijndaelmanaged(); symmetrickey.mode = ciphermode.cbc; byte[] cipherbytes = null; using (icryptotr

c - How to add libusb in Micrsoft visual studio 2013 -

i using microsoft visual studio 2013, how can add external library libusb project? please give me suggestions. libusb contain lib file, dll file , header file. need include libusb header file in source project. under project settings should go linker section , add lib file linked object. then, ensure dll accessible executable when running or debugging.

how the browser execute this javascript code: window.location.href="url" -

$("#retrieve-cancel-reservation").click(function(){ window.location.href="reservation.php?action_type=retrieve"; $('#reservation_bar').css('display','none') }); there div,id=reservation_bar in redirect link page. $('#reservation_bar').css('display','none') have no effect @ end. seems make mistakes how javascript code execute . **does can explain how browser execute code above? why display=none ont work? lot.** i don't think can alter css of page, doing. keep window.location redirect, , hide $('#reservation_bar') on new page on load. include on new page: $( document ).ready(function() { $('#reservation_bar').css('display','none'); });

recoding data in python pandas -

all, i have time series of data hourly. see below: 2014-01-01 00:00:00 96.8 2014-01-01 01:00:00 91.3 2014-01-01 02:00:00 97.8 2014-01-01 03:00:00 77.0 2014-01-01 04:00:00 132.7 2014-01-01 05:00:00 188.1 2014-01-01 06:00:00 141.1 2014-01-01 07:00:00 115.5 i wrangle dataframe looks this: month  1   2   3   4   5   6   7   8   9 ... jan feb                     data mar ... what best way in python pandas? data in series pre formmatted , index datetime. here index: class 'pandas.tseries.index.datetimeindex' [2014-01-01 00:00:00, ..., 2014-12-31 23:00:00] length: 8760, freq: none, timezone: none

java - sort arrays of array in lexiographical order -

i wondering how can sort arrays of array. example, have got char array like 0[a,b] 1[b,a] 2[a,a] and should sorted to: 0[a,a] 1[a,b] 2[b,a] in other words want sort different array locations in lexicographical order. you can define implementation of comparator<t> that, t array of type wish sort lexicographically: string[][] = ... arrays.sort(a, new comparator<string[]>() { compare(string[] lhs, string[] rhs) { // compare lhs rhs, , return result indicates // 1 comes earlier lexicographically } });

arrays - Min and Max C Failure -

i had written code.its buggy. wanna have order how typed in. sorted bubblesort.and min , max values.the program gives me same min , max values. please me. thx ;) #include<stdio.h> #include<stdlib.h> #define n 10 int main() { int eingabe[n],mini,maxi,i,temp,j; float medium,ds; { printf("bitte 10 werte eingeben!"); for(i=0;i<n;i++) { scanf("%i",&eingabe[i]); } printf("die eingegebenen werte der eingabereihenfolge nach:"); for(i=0;i<n;i++) { printf("\n%i",eingabe[i]); } for(j=0;j<n-1;j++) for(i=0;i<n-1-j;i++) { if (eingabe[i]>eingabe[i+1])//bubblesort { temp=eingabe[i]; eingabe[i]=eingabe[i+1];//tausch der variablen eingabe[i+1]=temp; } } printf("sortierte werte(min max):"); for(i=0;i<n;i++) { printf("\n%i",ein

android - Orientation camera all time wrong -

i can't set correct orientation on preview of camera, try things work. want see preview camera android app, orientation of activity landscape, don't know if correct or wrong. in continuous line explain try: - change setdisplayorientation(90) works if phone vertical, when change orientation wrong again. - try set portrait, when image saved orientation wrong, , if try change exif time orientation 0, not works. - read ask's on so, , works. i want kill smartphone, object , not have life. thx lot. android camera stuff extremely frustrating, understand that. make sure read through of camera documentation , check out code below referenced here : public static void setcameradisplayorientation(activity activity, int cameraid, android.hardware.camera camera) { android.hardware.camera.camerainfo info = new android.hardware.camera.camerainfo(); android.hardware.camera.getcamerainfo(cameraid, info); int rotation = activity.getwindo

java - Get value from Databse and outprint if or else statement based on selection from ComboBox -

db information db name contact row answer bool in sqlite values in row 0 or 1 0 false , 1 true combobox name answercall textfield name textacall upon selection of jcombobox want system.out.println ("do not answer!"); or system.out.println("answer call!"); into textfield as of right printing console not textfield , prints out answer call! no matter selection of combobox is. i appreciate if me correct this. private void answercallactionperformed(java.awt.event.actionevent evt) { string ans= (string) answercall.getselecteditem(); try { string sql = "select * contact answer='"+ans+"'"; pst = conn.preparestatement(sql); rs = pst.executequery(); if (ans.equals("1")) { textacall.settext(ans); system.out.println ("do not answer!"); } else { system.out.println("answer call!"); } } catch(exception e) { joptionpane.sh

Spring Boot and JSF/Primefaces/Richfaces -

i have been in contact spring few months , came upon spring boot while browsing guides section. guides easy complete , made initial grasp of projects's basic (and awesome) idea, able build , deploy enterprise-level applications minimal configuration while upholding wide array of spring's/jee's practices. interested in using spring boot test projects since easier , faster set , run , still close production environment. trying build project spring boot , primefaces view technology of choice, setup apparently isn't ready out-of-the-box case thymeleaf, having binary in classpath enough. tried including folowing gradle/maven artifacts, no success: primefaces jsf-api jsf-impl el-api spring boot's embedded tomcat server starts no apparent errors, after trying open page such /view in browser, embedded server displays following error message: http status 500 - circular view path: dispatch current handler url again. check viewresolver setup! (hint: may result of

Plugin for setting up a gallery with albums and photos WordPress -

one of client needs photo gallery on website built. have 1000s of images of different events. have questions on how approach this. what way of organizing images on "gallery page"? what plugin can use? should host images on web hosting (shared) or host in flickr or similar , show thumbnails here? if plugin should use? any suggestions , links live examples? importing thousands of images wordpress incredibly tedious, , may run memory errors in process. suggestion store images on flickr, , feed them in using plugin. there many flickr plugins choose from, here's 1 seems popular. http://wordpress.org/plugins/awesome-flickr-gallery-plugin/

sql - MySQL performance of VIEW for tables combined with UNION ALL -

let's have 2 tables in mysql : create table `persons` ( `id` bigint unsigned not null auto_increment, `first_name` varchar(64), `surname` varchar(64), primary key(`id`) ); create table `companies` ( `id` bigint unsigned not null auto_increment, `name` varchar(128), primary key(`id`) ); now, need treat them same, that's why following query: select person.id `id`, concat(person.first_name, ' ', person.surname) `name`, 'person' `person_type` persons union select company.id `id`, company.name `name`, 'company' `person_type` companies starts appear in other queries quite often: part of joins or subselects . now, inject query joins or subselects like: select * some_table row left outer join (>>> query above goes here <<<) `persons` on row.person_id = persons.id , row.person_type = persons.person_type but, today had use discussed union query query multiple times i.e. join twice. s

javascript - Change font of multiple elements using document.getElementsByClassName()? -

how change font in css using document.getelementsbyclassname() ? i tried using: document.getelementsbyclassname("classname").style.fontfamily="your font"; but doesn't work. i using firefox 27.0.1 , supposed supported don't think problem. there wrong code? first of note it's .getelementsbyclassname() not .getelementsbyclass() . .getelementsbyclassname() method returns nodelist of matching elements, therefore, have loop through returned list apply attribute, follows: var list = document.getelementsbyclassname("classname"); (var = 0; < list.length; ++i) { list[i].style.fontfamily="your font"; }

animate activity start in Android -

i need animate activity when starts up. activity started baseadapter class. tried using overridependingtransition() can't seem use in on click event. how can on come this? holder.userpic.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { log.d(" ", " value " + obj.get(position).get_post_id()); intent appinfo = new intent("android.intent.action.profile"); appinfo.putextra("pk", obj.get(position).get_foodie_id()); context.startactivity(appinfo); overridependingtransition(r.anim.full_side_up,0); // cant use } }); you need attach context as: context.overridependingtransition(r.anim.full_side_up,0); or can use transition in onresume method inside new activity : @override public void onresume() { super.onresume(); overridependingtransition(r.anim.full_side_up,0); } let me know if works.

c++ - Qt5.2 QNetwork, how many bytes are writed? -

i working in networking software using qt5.2, so: qtcpsocket m_socket; m_socket.connecttohost(m_host, m_port); if (qint64 ret = m_socket.write(data, static_cast<qint64>(*n_bytes)) != -1) { m_socket.waitforbyteswritten(timeout); } if bytes writed (not equal *n_bytes ), m_socket.waitforbyteswritten(timeout) return false? need determine number of bytes written, algoritm, "retry write operation using number of bytes written offset start (data + offset)." short answer: number of bytes returned qiodevice::write() number of bytes written. use that. any bytes says written, don't need write them again. buffered , delivered possible, , there's no way take them back. only possibility of partial write is, if connection breaks before transmitted. in case have no direct way find out how many bytes received other side. could have protocol, reconnects in case of unexpected disconnect, , asks how many bytes other side receives, higher level logic

html - box shadow to left and right in css -

this question has answer here: box-shadow on left , right 1 answer this css code .one-edge-shadow { width:200px; height:200px; border-style: solid; border-width: 1px; -webkit-box-shadow: 0 8px 6px -6px black; -moz-box-shadow: 0 8px 6px -6px black; box-shadow: 0 8px 6px -6px black; } using style , show in this fiddle example , shadow @ bottom of box . want drop shadow left , right side of box . , i'm little weak in css :) ! you have understand parameters of box-shadow how drop shadow works (how light works). to wish, need 2 different shadows, 1 light source cannot possible cast shadows on both sides (it if in front of box, you'd have shadow spreading around , down edge well). here's quick answer: box-shadow: 10px 0 10px -6px black, -10px 0 10px -6px black; updated fi

javascript - word-wrap feature not working in chrome -

i using following stylesheet code achieve word-wrap in column of table: <style type="text/css"> table,td { table-layout: fixed; } </style> this code works in firefox , i'm able achieve word-wrapping when tried in chrome browser, doesn't work. can please suggest how work in browsers (ie, firefox, chrome) maybe add word-wrap: break-word property css

android - Cannot add multiple fragments to LinearLayout -

i using linearlayout vertical orientation list fragments. add fragments container programmatically this: fragmenttransaction ft = fragmentmanager.begintransaction(); fragment fragment1 = new fragment(); ft.add(r.id.llcontainer, fragment1); fragment fragment2 = new fragment(); ft.add(r.id.llcontainer, fragment2); ft.commit(); but shows first fragment. why? you can have multiple fragments in linearlayout . according documentation , if you're adding multiple fragments same container, order in add them determines order appear in view hierarchy the problem code because didn't specify fragment tags, defaulted container id. since container id same both transactions, 2nd transaction replaced 1st fragment, rather added container separately. to want, use like: fragmenttransaction ft = fragmentmanager.begintransaction(); fragment fragment1 = new fragment(); ft.add(r.id.llcontainer, fragment1, "fragment_one"); fragment fragment2 = new fragment(

android - Kivy Multiple windows -

i'm evaluating kivy android development. need know if possible create application multiple windows using kivy. dont know sure how android works kind of approach. in c#, windows forms, have main window , open/close forms. how can accomplish approach using kivy android ? what mean 'window'? in practical sense, can create different screens kivy , switch between them, e.g. have menu screen, settings screen, game screen etc. kind of thing mean? more generally, can achieve particular windowing behaviour want within kivy. android works activities, particular way of choosing displayed, how apps move between screens, , how apps may call particular subsets of 1 (plus lot more of course). don't need know use kivy, works within single activity (plus appropriate interaction rest of system), should read on if want understand how android manages programs , how different desktop environments.

osx - github hello world coming up with error -

test afrieden$ mkdir hello-world test afrieden$ cd hello-world/ hello-world afrieden$ git init initialized empty git repository in /users/afrieden/test/hello-world/.git/ hello-world afrieden$ touch readme hello-world afrieden$ git add readme hello-world afrieden$ git commit -m "first message" [master (root-commit) 881750d] first message 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 readme hello-world afrieden$ git remote add origin git@github.com:alexfrieden/hello-world.git hello-world afrieden$ git push origin master error: repository not found. fatal: not read remote repository. please make sure have correct access rights , repository exists. why getting error? set ssh correctly. for work, need create repo on github side first. right now, https://github.com/alexfrieden/hello-world returns 404.

mysql - how to know when database became empty in php -

i makin quiz in php , mysql . fetching questions database, suppose if don't know no of questions in datbase. want code fetch data till questions not over, don't no of questions there . condtion applicable . code fetching data . <?php function ravi($qid=null) { $con = mysql_connect('localhost', 'root', '') or die(mysql_error()); $db = mysql_select_db('quiz', $con) or die(mysql_error()); $q="select * question qno=$qid"; $rq=mysql_query($q,$con); if(!$rq) { echo " sql query faiiled work "; } else { while ($sub_row=mysql_fetch_array($rq)) { $id=$sub_row["qno"]; $question=$sub_row["question"]; $option1=$sub_row["option1"]; $option2=$sub_row["option2"]; $op

python - How to store argparse values in variables? -

i trying add command line options script, using following code: import argparse parser = argparse.argumentparser('my program') parser.add_argument('-x', '--one') parser.add_argument('-y', '--two') parser.add_argument('-z', '--three') args = vars(parser.parse_args()) foo = args['one'] bar = args['two'] cheese = args['three'] is correct way this? also, how run idle shell? use command 'python myprogram.py -x foo -y bar -z cheese' , gives me syntax error that work, can simplify bit this: args = parser.parse_args() foo = args.one bar = args.two cheese = args.three

ios - CCLayer scaling and touch implementation? -

i've made cclayer holds ccsprite , 2 cclabelbmfont's. goal create customized "button" scale down when pressed. i've ran problems touch , scaling of layer. first touch, can't touch layer bounding box accurately if convert touch this: cgpoint currenttouchlocation = [self converttouchtonodespace:touch]; touch handled this: // touching shop item? if(cgrectcontainspoint([self boundingbox], currenttouchlocation)) { nslog(@"pressing item"); mshopitempushed = true; return true; } return false; seems there no realistic size boundingbox cclayer it's contents default figure need overwrite 1 based on cclayer contents? ideas how can correctly? second problem scaling of cclayer based "button". if touch handling work somehow, scaling layer down half causes scaled layer move off tens of pixels original position. there no anchors set still moves layer quite bit side , when scaling. how can prevent behavior? here code of cc

Docbook-XML, Webhelp and XSLT / Xalan error -

processing xml test file of 11907 lines total 325.050 bytes. d:\projekte\dashboard>ant webhelp buildfile: d:\projekte\dashboard\build.xml validate: clean: [delete] deleting directory d:\projekte\dashboard\docs chunk: [mkdir] created dir: d:\projekte\dashboard\docs [xslt] processing d:\projekte\dashboard\dashboard.xml d:\projekte\dashboard\docs\null1967716666 [xslt] loading stylesheet d:\apps\docbook-xsl-1.78.1\profiling\profile.xsl [xslt] warning: org.apache.xerces.jaxp.saxparserimpl$jaxpsaxparser: property 'http://javax.xml.xmlconstants/property/accessexternaldtd' not recognized. [xslt] warning: org.apache.xerces.jaxp.saxparserimpl$jaxpsaxparser: property 'http://www.oracle.com/xml/jaxp/properties/entityexpansionlimit' not recognized. [xslt] warning: org.apache.xerces.jaxp.saxparserimpl$jaxpsaxparser: property 'http://javax.xml.xmlconstants/property/accessexternaldtd' not recognized. [xslt] warning: org.apac

php - Check ipaddress with ip2long fails -

hi attempting check users ipaddress can come 2 specific ranges. convert users ipaddress using ip2long, check see if in range failing. wondered if can spot rookie mistakes quite new php. in advance: $high_ip = ip2long('87.228.97.128'); $low_ip = ip2long('83.229.97.165'); $second_high_ip = ip2long('16.254.116.1'); $second_low_ip = ip2long('16.254.116.128'); $userip = ip2long($_server['remote_addr']); if($userip <= $high_ip && $low_ip <= $userip ){ //do }else if($userip <= $second_high_ip && $second_low_ip <= $userip ) { // }else { // echo "invalid ip"; } -- edit -- when hitting page ipaddress within range fails if check though ipaddress wrong. thanks had made rookie error :-0 quite embarrassing lol i had if statement incorrectly. should have been : ($userip <= $second_high_ip && $second_low_ip >= $userip )

jquery - How to retrieve a json from JavaScript -

i trying write html5 mobile application , use jquery json url http://cin.ufpe.br/~rvcam/favours.json tried using var url='http://cin.ufpe.br/~rvcam/favours.json'; $.getjson(url, function(data, status) { console.log(data); console.log(status); }); but nothing shows on console. don't see doing wrong. [edit] learned post can't retrieve information server. server in particular (cin.ufpe.br/~rvcam) mine. can use php or other method allow application retrieve data? the url doesn't return valid json. returns javascript attempts execute function called "foo" , passes object argument. commonly called "jsonp". method of achieving cross domain ajax calls

c# - getting text-nodes of HtmlDocument -

after webbrowser document loads, document contains like: <div id="toextract"> <div>this</div> <div>is</div> sample <div>text</div> <div>want to</div> <div>extract</div> </div> i want extract innerhtml of these elements output be: this sample text want extract but this: this text want extract as word i , sample not in htmlelement. code: string ex = ""; htmlelement elem = webbrowser1.document.getelementbyid("toextract"); htmlelementcollection elems = elem.all for(int i=0;i<elems.count;i++) ex += elems[i].innerhtml + " "; my code skips text-nodes (nodes no tag). think because not considered htmlelement. how can include them in extracted text? simply fetch text elem.innertext and remove linefeeds this elem.innertext.replace(system.environment.newline, " ")

ffmpeg - av_interleaved_write_frame(): Connection reset by peer youtube. -

i want live stream youtube ffmpeg take error " av_interleaved_write_frame(): connection reset peer". send stream fmle works nice. ffmpeg -re -i /mnt/windows/21.mpg -r 30 -s 854x480 -c:v libx264 -c:a libfdk_aac -f mpegts "rtmp://a.rtmp.youtube.com/live2/hasanbagcaci.3s3v-pkwx-g64b-5zgz" -force_key_frames "expr:gte(t,n_forced*1)" thanks helping hi find way send live stream youtube ffmpeg -re -i /mnt/windows/21.mpg -r 30 -s 854x480 -c:v libx264 -c:a libfdk_aac -force_key_frames "expr:gte(t,n_forced*4)" -f flv "rtmp://a.rtmp.youtube.com/live2/hasanbagcaci.3s3v-pkwx-g64b-5zgz"

ios - UIViewControllerTransitioningDelegate landscape Transition -

what best practice create landscaped transition between 2 uiviewcontrollers? containerview uiview * container = [transitioncontext containerview]; logs frame : {{0, 0}, {320, 568}} vertical , added subview added vertically. should rotate added subviews or add subviews on of controllers view , not container view directly?

jquery - Multiple textbox population with Ajax and PHP -

hello have code has multiple textbox populations based on ajax , php. so each textbox has populate own data mysql. its working fine except textboxes using same output when input data differend tables. how can separate them each show there table results database ? $query , $query2 textboxes. here code: <?php $db = new mysqli('localhost', 'root' ,'*', 'records'); if(!$db){ // show error if cannot connect. echo 'error: not connect database.'; } else { // there posted query string? if(isset($_post['querystring'])) { $querystring = $db->real_escape_string($_post['querystring']); // string length greater 0? if(strlen($querystring) >0) { $query = $db->query("select naam_klant overboekingen naam_klant '$querystring%' limit 10"); $query2 = $db

php - Tell Ctags not to parse content inside comments -

when generate ctags file, seems parsing content inside comments too. instance, using vim's plugin tagbar, can see in list of functions non-existent functions such as: is in just what happening here ctags going comments , finding things like: "this function is...", thinking "is" function, adding entry in tags file. i wondering if there easy way tell ctags not parse contents inside comments. i have found apparently there fix this released after 5.8.0 not sure whether has been released or not, ctags version 5.8.0. this related php project guess nice if answer can cover solution work programming language (if such thing possible). example: the following comment function generates tag "is" , lists function: /** * function run set preferences */ there's bug in ctags 5.8. fortunately, 1 day after released, jafl committed revision 729 fix problem. unfortunately, there has not been release since then. fortunately, pr

Separating source and build ouptut in Eclipse -

recently, work computer suffering hardware failures had pleasure of migrating data on new computer. project smaller generated output , significant portion of time spent moving generated output. currently: c:\workspace\project\src\... c:\workspace\project\bin\... ideally: c:\workspace\project\src\... c:\workspace_output\project\bin\... note: me source linked don't exist within project. i able change 1 particular project following directions here . however, have numerous projects , time-consuming apply change each project (create "output folder" point project folder). is there better way define behavior within eclipse? couldn't find ${project_name} system variable use (e.g. this ). i'm fine if answer no appears have manually set each project. maybe next best thing write script automatically create folders , modify .project , .classpath . an alternative like: start eclipse on new machine, point old workspace clean projects then copy project

vb.net - Delete Registry Value -

Image
i lookibg dllimport api signature deleting registry value. pinvoke has definition mobile devices. i looking normal definition windows in vb.net. i know can delete registry value using system.win32.registry nevertheless looking api signature. can me out?;)^ nevermind got it: sounds looking dllimport signature of regdeletekeyvalue function. if it <dllimport("advapi32.dll")> _ private shared function regdeletekeyvalue( _ byval handle intptr, _ byval keyname string, _ byval valuename string) end function

sqlite - Is it possible to tell the android application to download a db from somewhere to the phone? -

i curious know if can tell android application download specific db file somewhere , access crud based stuff it. sure, need download file can load db, use gist load db. webb has lot of examples how download file app, save on sd card , load saved instead of assets in gist

cocoa - Apple no longer accepts submissions of apps that use QuickTime APIs -

the control, using in application labels,buttons,qwebkit,progressbar , cocoa classes nsstring,nsurl,nsdictionary,nsappleeventdescriptor,cfstringref,cfurlref,fsref,fscataloginfo,nssting . when upload,no error 'invalid binary' afterwards. , receive mail apple developer subject "apple no longer accepts submissions of apps use quicktime apis". appreciated. apple no longer accepts submissions mac app store use quicktime or qtkit. best way find using these api's remove quicktime and/or qtkit framework project. need replace places using quicktime api's avfoundation. works on mac os x 10.7 , newer. unfortunately there no solution if want support 10.6. may find 3rd party frameworks rely on quicktime api's, in case need check updates developers.

node.js - Why are multiple requests being processed for a single browser request? -

note: new node, , have simple node site running based upon example ( http://blog.falafel.com/blogs/basememara/basem-emara/2014/03/18/getting-started-with-node.js-for-windows ) my code is: var http = require('http'); var reqcount = 0; http.createserver(function (req, res) { reqcount++; res.writehead(200, { 'content-type': 'text/plain' }); console.log(reqcount); res.end('request: ' + reqcount); }).listen(3000); in browser 1, hit refresh , 3, 5, 7 and in console getting every int, 2 per request why executing twice each request? i know not handling requests directly, wanted start basic , include express. this may /favicon.ico request done browser. you can print request url req object see that: console.log(req.url);

javascript - AngularJs: Calling contoller method from directive inside another directive -

i have directive inside directive. outer directive shares scope controller, while inner 1 has own. i'd pass reference controller's function inner directive can called there. cannot figure out how pass function , parameters inner directive can call controller's function. here planker illustrate problem. if click on "dir 2 click me" alert says parameters have came undefined. you can pass in outer controller method using '=' , adjust code accordingly... angular.module('app', []) .controller('ctrl', function($scope){ $scope.myctrlmethod = function(msg, b) { alert(msg + ' , b='+b); }; }) .directive('dir1', [function(){ return { restrict: 'e', replace: true, template: '<div><p ng-click="mydir1method(\'my dir1 method\',\'b\')">dir 1 click me</p><dir2 my-ctrl-method="

java - Eclipse giving me XML junk in console instead of running program -

note: running eclipse adt build: v22.2.1-833290 example: have java code: file: helloworld.java public class helloworld { public static void main(string[] args) { system.out.println("hello world!"); } } works fine if compile , run @ console. however, when run file in eclipse, garbage shown below. trust computers enough know eclipse giving me asking give me, meaning i've got switch set somewhere. question is, how eclipse stop giving me asked , give me want? update using "run" button on toolbar, per usual, found if used context menu run --> java application, run fine, , run fine after button. must have messed default run configuration. there way set properly? really, small annoyance @ point. <connectionproperties> <propertycategory name="connection/authentication"> <property name="user" required="no" default="" sortorder="-2147483647" since="all ve