Posts

Showing posts from April, 2012

video - Android FFMPEG: Could not execute the ffmpeg from Java code -

i working on android app want create video list of static images. after doing search on internet, made me realized using "ffmpeg" way go in getting thing done. got hold of site: https://github.com/guardianproject/android-ffmpeg-java downloaded c library , java wrapper. able compile c library - of course not way instruction laid out - still able "ffmpeg" executable under /external/android-ffmpeg/ffmpeg directory. copied executable in current directory , copied directory under android app can access it. called provided java wrapper seeing errors in log file follows: 08-13 11:55:37.848: d/ffmpeg(29598): /data/data/com.sample/app_bin/ffmpeg -y -loop 1 -i /storage/emulated/0/usersnapshot/ffmpeg/image%03d.jpg -r 25 -t 2 -qscale 5 /storage/emulated/0/video/snapshot-video.mp4 08-13 11:55:37.898: i/shellcallback : shellout()(29598): /data/data/com.sample/app_bin/ffmpeg[1]: syntax error: '(' unexpected 08-13 11:55:37.938: i/shellcallback : processcomplete()(29...

angularjs - angular Material Tabs do not change their content -

i'm starting learn angularjs , angular material. i have problem on understanding md-tabs. <section layout="row"> <div layout="column"><img id="applicationlogo" src="https://material.angularjs.org/latest/img/icons/angular-logo.svg"></div> <div layout="column" id="applicationtitle" layout-align="center start">application title</div> <div layout="column" id="applicationwelcome" flex layout-align="center end">angemeldet als test user</div> <div layout="column" layout-align="center center"><img id="applicationavatar" src="http://findicons.com/files/icons/1072/face_avatars/300/d05.png"></div> </section> here demo: http://plnkr.co/edit/72znb70bjsm6xp7rnsvh?p=preview any hint why tabs not change content? you linked wrong angular material css ...

git - How to conduct version control offline(without networking literally)? -

our team developing same software project on separate pcs(the networking blocked due our company rule), drug. now, our developing flow serial. when member adds feature, had wait b finish development , copy of b's project. so, here question: how conduct version control when networking not allowed? there best practices this? there git implementation allows create git repository having setting server , corresponding key, stuff that? any suggestion appreciated? you can git bundle @ anytime, , transmit single file same way getting copy of b's project. that file act git repo , not need server setup. once received other party, he/she can pull file. , missing commits. i had develop incremental bundles before . transmitting repo single file limit risk of data corruption during said transfer.

email - Jira: How can I make images part of my ticket description? -

i have set email account receives emails , creates ticket in jira against each email. if email includes pictures part of email body want show them part of corresponding ticket body in jira. becoming attachments though 'description' field 'wiki style renderer' field. please guide me thankful. as scott dudley commented, jira's built-in mail handler not support inline images in created issues. however, there few commercial add-ons support this. popular ones enterprise mail handler jira , email issue . for relevant documentation, check: jemh overview html content preserved inline images

XCode: Warnings for constraints in output window -

after starting app bunch of warnings or error messages in debug output window (s.below): i checked warnings in xcode editors , changed them until last warning gone. clicked on „reset suggested constraints“. there still problems, don’t know how solve them. should remove constraints , restart created them manualy or default again??? dsrenamer[42352:5539902] unable simultaneously satisfy constraints: ( "<nslayoutconstraint:0x610000084b00 h:[nsimageview:0x610000161380(17)]>", "<nslayoutconstraint:0x6100000850a0 h:[nsimageview:0x610000161380]-(7)-[nstextfield:0x6100001e0300]>", "<nslayoutconstraint:0x610000085000 h:|-(3)-[nsimageview:0x610000161380] (names: namecellid:0x6100001815f0, '|':namecellid:0x6100001815f0 )>", "<nslayoutconstraint:0x610000084e20 h:[nstextfield:0x6100001e0300(266)]>", "<nslayoutconstraint:0x6100000850f0 h:[nstextfield:0x6100001e0300]-(-63)-| (names: namecel...

android - Error in building MM2 using phonegap build -

i'm trying create custom app mm2 based on presentation juan leyva: https://docs.google.com/presentation/d/1hx5h7zwtay4amay3qyluclfi7kqcid9iowudh-lsa_0/edit#slide=id.ga20278994_0_101 i customized , able run emulation using ionic when try build android version using phonegap build ( http://build.phonegap.com ) these errors build date: 2016-05-25 14:42:44 +0000 failure: build failed exception. * went wrong: problem occurred configuring root project 'project'. > not resolve dependencies configuration ':_debugcompile'. > not find com.android.support:support-v4:23.4.0. searched in following locations: https://repo1.maven.org/maven2/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom https://repo1.maven.org/maven2/com/android/support/support-v4/23.4.0/support-v4-23.4.0.jar file:/android-sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom file:/android-sdk/extras/an...

shell - ZSH: Call in-built function from zsh function that uses the same name -

i use zsh , extend in-built cd function. i'd when call cd , changes directly , lists content of directory. function cd() { cd $1 ls . } i'd have expected code work, turns out, call cd refers function definition, resulting in infinite loop. is there work-around solve problem, apart choosing different name function? update strangely enough, worked function cd() { `echo $1` ls . } no idea why. in order use builtin commands within functions of same name, or anywhere else matter, can use builtin precommand modifier: function cd() { builtin cd $1 ls . } builtin command tells zsh use builtin name command instead of alias, function or external command of same name. if such builtin not exist error message printed. for cases want use external command instead of alias, builtin or function of same name, can use command precommand modifier. example: command echo foobar this use binary echo (most /bin/echo ) instead of zs...

arrays - Concise and robust way to read a line of space-separated integers in Go -

i have been giving hackerrank try problems require reading lines of integers arrays (slices). for many of problems, parsing code ends being larger algorithmic meat of solution. instance, case in sherlock , array any ideas on how concisely parse space-separated line of integers slice? fmt.scanf doesn't support slices , when using bufio long solutions. some requirements: you can use standard library. the solution should concise, shorter better. error checks shouldn't skipped. know input defined in hackerrank , should able cut corners, please don't, it's bad practice. it should reasonably efficient. note: parser should consume single line , not full input. you can use fmt.scanf , need keep track of values you're getting. // a.go package main import ( "fmt" "io" ) func main() { var ( next int nums []int ) { n, err := fmt.scanf("%d", &next) if err == ...

javascript - Can C# connect to a WebSocket using Socket(Not WebSocket) class -

i have c# app communicates on socket. want code web app can connect c# app on socket. know c# has different classes websocket , socket . questions : 1-) if use websocket javascript , can connect existing socket structure on c# or required re-code websocket ? 2-) there other performance efficent way ? a websocket connection uses socket, predefined way of framing data, while if use socket directly, can define own way of framing data, other end must know how data framed in order understand it. answering question: in javascript can connect sockets running websocket, since websocket javascript client try communicate in "websocket" way , won't understand different. however, if need javascript access regular socket, can try use intermediary proxy websockify , cannot connect directly.

java - Android buttons background -

i'm trying make java-android-memory game... works fine, except 1 thing... when turn first card, , second card, there should delay (~seconds or so) bevor 2 cards turned or removed. so added delay (tried 2 versions, made them comment) but.... picture of card never shown second card (only first card)... cards removed or hidden correct delay when use second version. pls. can me here code (relevant part) public abstract class game { private static final int maxbuttonamount = 30; //maximum amount of buttons (=cards) per game private card[] cards; private hashmap<button, card> buttonstocardmap; //the button of first turned card, null if cards turned down private button firstturnedcardbutton; private view.onclicklistener defaultlistener = new view.onclicklistener() { @override public void onclick(view v) { turncard((button) v); evaluatecardchoice((button) v); } }; private view.onclicklistener audiolistener = new view.onclicklistener()...

go - How to compare HTML markup in Golang? -

i'm trying come test suite checks html fragments/files canonically equivalent 1 another. surprised see if parse same string or file, https://godoc.org/golang.org/x/net/html#node comparing different. missing? hopefully demonstrates issue: package main import ( "fmt" "strings" "golang.org/x/net/html" ) func main() { s := `<h1> test </h1><p>foo</p>` // s2 := `<h1>test</h1><p>foo</p>` doc, _ := html.parse(strings.newreader(s)) doc2, _ := html.parse(strings.newreader(s)) if doc == doc2 { fmt.println("html same") // expected } else { fmt.println("html not same") // got } } html not same the simplest way use reflection, since html.parse returns *node object. comparing 2 of objects in go need reflect.deepequal . if reflect.deepequal(doc, doc2) { fmt.println(...

php - TCPDF ERROR on pdf generator launched by cron -

i have problem pdf generator script (using html2pdf lib). the script works when launched manually returns error when launched cron task . tcpdf error: unable create output file: /0000/images/upload/demonstration/factures/2016-05-demonstration.pdf here's part of script involved in creation. require('html2pdf/html2pdf.class.php'); try { $pdf = new html2pdf('p','a4','fr'); $pdf->writehtml($content); ob_end_clean(); $pdf->output(''.$_server['document_root'] . '/0000/images/upload/'.$data["id_client"].'/factures/'.$fichier.'.pdf', 'f'); } catch(html2pdf_exception $e) { die($e); } i tried many solutions suggested in other threads nothing worked far. files , directories have permissions 777 , i'm using right absolute path (the fact works manually proves it). any idea...

linux - How to debug the mutt file, i am unable to setup my gmail.. -

i unable debug muttrc file debug file can me in situation using linux 16.04 , setup imap... [[2017-05-28 14:08:08] mutt/1.5.24 (2015-08-30) debugging @ level 2 [2016-05-28 14:08:08] reading configuration file '/etc/muttrc'. [2016-05-28 14:08:08] reading configuration file '/usr/lib/mutt/source-muttrc.d|'. [2016-05-28 14:08:08] reading configuration file '/etc/muttrc.d/charset.rc'. [2016-05-28 14:08:08] reading configuration file '/etc/muttrc.d/colors.rc'. [2016-05-28 14:08:08] reading configuration file '/etc/muttrc.d/compressed-folders.rc'. [2016-05-28 14:08:08] reading configuration file '/etc/muttrc.d/gpg.rc'. [2016-05-28 14:08:08] reading configuration file '/etc/muttrc.d/smime.rc'. [2016-05-28 14:08:08] reading configuration file '/home/sami/.muttrc'. [2016-05-28 14:08:08] mx_get_magic(): unable stat /var/mail/root: no such file or directory (errno 2). [2016-05-28 14:08:08] /var/mail/root: no such file or direct...

ios - get the value form mySQL to swift by PHP -

i have php file return json_encode value , when go http address give me value cant value form server side apps have try many time not func loaddata() { let url = nsurl(string: "http://example.com/getexpo.php") let request = nsmutableurlrequest(url: url!) // modify request necessary, if necessary nsurlsession.sharedsession().datataskwithrequest(request, completionhandler: { (data:nsdata?, response:nsurlresponse?, error:nserror?) -> void in if error != nil { // display alert message print(error) return } { let json = try nsjsonserialization.jsonobjectwithdata(data!, options: nsjsonreadingoptions.mutablecontainers) as? nsdictionary if (json != nil) { //let userid = parsejson["userid"] as? string // display alert message let usermessage = json!["id"] as? string ...

parsing - Difference between: 'Eliminate left-recursion' and 'construct an equivalent unambiguous grammar' -

for example: r → r bar r|rr|r star|(r)|a|b construct equivalent unambiguous grammar: r → s|rbars s→t|st t → u|tstar u→a|b|(r) how eliminate left-recursion r → r bar r|rr|r star|(r)|a|b ? what's different between eliminate left-recursion , construct equivalent unambiguous grammar ? an unambiguous grammar 1 each string in language, there 1 way derive grammar. in context of compiler construction problem ambiguous grammar it's not obvious grammar parse tree given input string should be. tools solve using rules resolving ambiguities while other require grammar unambiguous. a left-recursive grammar 1 derivation given non-terminal can produce same non-terminal again without first producing terminal. leads infinite loops in recursive-descent-style parsers, no problems shift-reduce parsers. note unambiguous grammar can still left-recursive , grammar without left recursion can still ambiguous. note depending on tools, may need remove ambiguity, not left-recurs...

How to change view of google map -

Image
i trying set google map view according needs unable do. want show google map this but showing this using code: function init_map() { var var_location = new google.maps.latlng(33.6934473,35.644258); var var_mapoptions = { center: var_location, zoom: 12 }; var var_marker = new google.maps.marker({ position: var_location, map: var_map, title:"venice"}); var var_map = new google.maps.map(document.getelementbyid("map-container"), var_mapoptions); var_marker.setmap(var_map); } google.maps.event.adddomlistener(window, 'load', init_map); any appreciated. set center of map different location marker. function init_map() { var var_location = new google.maps.latlng(33.6934473, 35.644258); var var_mapoptions = { center: new google.maps.latlng(33.691578, 35.523065), zoom: 12 }; var var_marker = new google.maps.marker({ position: var_l...

android - Kinvey: Does it provide access to Rest APIs in various ways -

kinvey allows insert, delete or retrieve data via model classes. when use normal rest apis free send data in body or header of rest apis. have various options get, put, post, delete, etc. does kinvey provide support above? dont know whether should go kinvey or should use other mbaas platform instead any appreciated.. !!! yes, kinvey offers client rest api. can evaluate interface reviewing documentation @ following url decide if meets needs. http://devcenter.kinvey.com/rest/ regards, billy

.htaccess - RewriteRule not working on host -

the host not work, on local works options -indexes rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_method} ^(trace|track) rewriterule .* - [f] rewriterule ^([^/]+).html$ index.php?page=ista&link=$1 [l] the problem solved. disable host nginx

javascript - Youtube Player API is slower than website load -

i have website has index page lot of text , button triggers modal window, in may see youtube video. in normal scenario (people reads text of page, realize button, click button) there's no problem, when click button after page loads (or during...) modal window appears no video in it, of course firebug throws error saying video isn't loaded yet. i don't mind waiting video load after pressing button, i'd push button , 100% of times watch video, don't know how start loading api in moment want. there have relevant pieces of code: var player; function onyoutubeplayerapiready() { player = new yt.player("player", { height: $('#modalvideo').height()*0.9, width: $('#modalvideo').width()*0.9, videoid: "neetgjp5-ag" }) } $(document).ready(function() { $(".youtube").on("click", function(e) { e.preventdefault(); // place want load youtube api, if have wait ...

c++ - Is a destructor called when an object goes out of scope? -

for example: int main() { foo *leedle = new foo(); return 0; } class foo { private: somepointer* bar; public: foo(); ~foo(); }; foo::~foo() { delete bar; } would destructor implicitly called compiler or there memory leak? i'm new dynamic memory, if isn't usable test case, i'm sorry. yes, automatic variables destroyed @ end of enclosing code block. keep reading. your question title asks if destructor called when variable goes out of scope. presumably meant ask was: will foo's destructor called @ end of main()? given code provided, answer question no since foo object has dynamic storage duration, shall see shortly. note here automatic variable is: foo* leedle = new foo(); here, leedle automatic variable destroyed. leedle pointer. thing leedle points not have automatic storage duration, , not destroyed. so, if this: void doit() { foo* leedle = new leedle; } you leak memory allocated new leedle . ...

ibm mobilefirst - PushNotification -- no device found -

i have hybrid app , having issue seeing notification.. i error com.ibm.pushworks.server.exceptions.pushworksexception: fpwse0009e: internal server error. no devices found i running on local mfp (eclipse -- v7.1).. see device in worklightconsole , app install on phone (xcode->phone via usb) , see opt-in notification message.. however, error when tried send push.. i using postman , restapi http://localhost:10080/worklightadmin/management-apis/1.0/runtimes/mymobile/notifications/applications/myproj/messages here body of post request { "message": { "alert": "test message" }, "settings": { "apns": { "badge": 1, "iosactionkey": "ok", "payload": {}, "sound": "song.mp3" }, "gcm": { "payload": {}, "sound": "song.mp3" } }, "target": { ...

What Jenkins loggers do you usually have enabled? -

jenkins isn't @ telling default , i'm curious people using log in day day jenkins master log. there jenkins instances running @ our servers, there nothing special enabled production environment. different log levels set based on plugins or features not working expected. you better if enable debug logging, if need to.

c# - HttpClient PostAsync on xamarin does nothing -

i have piece of code var formcontent = new formurlencodedcontent(new[] { new keyvaluepair<string, string>("grant_type", "password"), new keyvaluepair<string, string>("username", _username), new keyvaluepair<string, string>("password", _password) }); var response = await internalclient.postasync("/token", formcontent).configureawait(false); it works fine when use in desktop app, same piece fails on xamarin.android. can access web site emulators browser, it's not case of not having connection between these two. more interesting part - getasync works absolutely fine. postasync fails taskcancelledexception because of timeout. postasync calls not hit server @ all. activity executed: var isauthsuccess = _mainclient.authenticate(); isauthsuccess.continuewith(task => { runonuithread(() => { if (isauthsuccess.result) { releaseeventhan...

c# - XML Document not loading from web URL - NullReferenceException -

this question has answer here: what nullreferenceexception, , how fix it? 32 answers i want load weather information openweathermap.org's api xml document. public weather() { /* generates custom weather url */ this.urlstub= @"http://api.openweathermap.org/data/2.5/forecast/daily?q="; this.location = "glasgow,uk"; this.apikey = "&appid=6911e84eacde075fdbdfaf05b9a2aaf5"; this.mode = "&mode=xml"; this.forecastweatherurl = urlstub + location + apikey + mode; } public bool loadxml() { /* loads xml info web */ try { this.forecastweatherxml.loadxml(forecastweatherurl); return true; } catch (system.nullreferenceexception ex) { console.out.writeline("error loading xml doc\n...

How do I start this javascript code on click -

edited: ok, didn't explain well. have added button in html. when click that, alerts , asks user enter questions , answers. but...it doesn't push array cards themselves. i have hacked simple javascript flash card program. starts on page load. how make start on click of single <button> ? i've tried enclosing entire code in function user inputs create array don't passed flashcards -- assume because separate functions. i'm not explaining well. want entire program run on click of 1 button. appreciate help. #flashcardfront { margin-top: 100px; margin-left: 400px; width: 300px; height: 50px; background-color: black; color: white; font-family: arial; font-size: 22px; text-align: center; padding: 50px 0; display: block; } a:link { text-decoration: none; } #number { color: red; position: relative; left: -120px; top: 30px; } <div> <button onclick='cards();'>button</butt...

c++ - Address operator with pointer to member function -

we know create "common" pointer function can example: void fun(); void (*ptr)() = fun; the name of function address function start. not need use address operator & this: void (*ptr)() = &fun; now pointer member function on contrary must use address operator. example class pointer member function ptr , function fun() must write: void(a::*ptr)() = &a::fun; why difference? it because function defined inside class. pointer member function holds "relative address" of function in class layout , have access way. in case of static, has no pointer , behaves global function , so, can access normal function pointer.

node.js - Node, Mongoose: Remove json element from query result with delete -

i strange behavior. here's thing: make database query , want delete element of json returned query. doesn't seem work (i.e. element not deleted), var user=json; delete user.element; while works var user={element:json.element,blement:'stuff'} delete user.element; i think referring json mongoose document object given tags added question. since object attached it's "schema", may have rules in there such "required" field or such interfering operation trying do. in order raw form of object back, use .toobject() method on document result: model.findone({ _id: id}, function(err,doc) { var raw = doc.toobject(); delete raw.element; console.log( raw ); }); of course can omit field being returned in query result basic form provided .select() : model.findone({ _id: id}, '-element', function(err,doc) { console.log( doc ); }); either form remove particular field response, if possibly want more control ...

html - When I set webpage background color to black(#000000) in my CSS file it appears white on web browser, why is this? -

body { background-color: #000000 text-align:center; } #main { width: 1000; height: 600px; background-color: #f1c83e; } when set background-color black in css code why background appear white in browser? if add semicolon @ end of background-color: #000000 background-color: #000000; , code work properly. here fiddle of code: https://jsfiddle.net/81rfa9bu/ body { background-color: #000000; text-align: center; } #main { width: 1000; height: 600px; background-color: #f1c83e; } <div class="body"> <div id="main"> hi </div> </div>

python - How do I write a YAML file using a dictionary with long keys and values? -

i have python dictionary has 25-30 key-value pairs. keys long strings (20-30 characters), , values can 1-10 lines long embedded new-lines, etc. i write file using yaml, if use yaml.dump not readable, because of length of data. file following example: this_is_my_very_long_key_1 : "this value key 1" this_is_a_shorter_key : "this value key" i finding yaml documentation sparse. i tried using default_flow_style=false or true , , looked better no-flow , that's not wanted. you can limit width of line passing width parameter dump method. yaml.dump(d, width=20, default_flow_style=false)

oop - What is the use of Cloning in JAVA and where it is frequently used? -

i have used programming , understood cloning means duplication of object. but, not idea in context , used? mean, appear used? public abstract class geometricobject { private string color = "white"; private boolean filled; //default constructor protected geometricobject(){ } //constructing geometric object protected geometricobject(string color, boolean filled){ this.color = color; this.filled = filled; } //getter method color public string getcolor(){ return color; } //set method color public void setcolor(string color){ this.color = color; } //getter method filled public boolean isfilled(){ return filled; } //setter method filled public void setfilled(boolean filled){ this.filled = filled; } //abstract method getting area public abstract double getarea(); //abstract method getting perimeter public abstract double getperimet...

ruby on rails 4 - Counting Total Number of Occurrences of Each Type in a Table Column -

Image
i have table , looks this: when save data csv file , upload rails application, app takes data , stores in database table called "fruitnames." redirects homepage shows data in table. what i'm trying list number of each type of fruit above table. example, output in view might be: apple: 3 orange: 1 blueberry: 1 pineapple: 1 and if user uploads csv contains different fruit avocado, list above should updated. i'm not sure how go this. tried start off writing query, i'm not sure if it's right: select classname, count(*) fruitnames group classname the above query won't work in rails (i'd need write fruitnames.distinct.count('classname') or that). question is, how can count number of occurrences of each classname , have count show in view? my guess involve creating def in controller , inside of it, allocating variable query , embedding variable in erb file loop of kind. further clarification: when type "rails c...

How to create dynamic routing in phalcon? -

i have read documentation of phalcon routing , cannot find 1 needed. /{param1}/{param2}/{param3}/controllername/actionname/{param4} help me guys. from docs : /:params (/. ) matches list of optional words separated slashes. use placeholder @ end of route in other hands rewrite positions through apache / .htaccess .

javascript - ExpressJS Cookie-Parser not persisting between different HTTP calls -

i using cookie - parser express.js. in express config file have app.use(cookieparser()) , in main (app.js) server set cookie whenever there post request /signin , username , password both equal. app.post("/signin",(req,res)=>{ log(`checking .....`); const req_data=req.body; log(req.body); if(req.body.user===req.body.password) { res.cookie.level="recruiter";//i tried doing res.cookie("level","recruiter") res.send({redirect:true,redirect_url:"\\"+res.cookie.level}) } else { log(`fishy..!`); res.send({"authenticated":false}); } }); now when client receives part of fetch api response extracts redirect_url part of json , below: fetch("/signin",{ method:"post", headers: { 'accept': 'application/json', 'content-type': 'application/json' }, body:json.stringify(json) }) .then((res)...

html - send response HTTP 200 SUCCESS in php -

i need send http 200 response string 'success', php server version 5.2.17! in case, webhook sends data capture file called notification.php, read contentes, save in database , need send response not know how this! does know how in php 5.2.17? i tried following ways without success: // error 1 header("content-type: text/plain"); echo "success"; // error 2 $httpstatuscode = 200; $httpstatusmsg = 'success'; $protocol = isset($_server['server_protocol']) ? $_server['server_protocol'] : 'http/1.0'; header($protocol.' '.$httpstatuscode.' '.$httpstatusmsg); // error 3 header("200 success"); return "200 success"; // error 4 header('content-type: application/json'); echo 'success'; // error 5 header('content-type: application/json'); return 'success'; //error 6 header('content-type: application/json'); header('success'); ///error 7 he...

HTML to PHP arrays -

good evening everyone, i've been searching , trying while build small program, want user input unknown amount of numbers (he can enter as like), , want make array out of them, everywhere on internet keeps using many "input type="text"...." boxes don't know how many user input.and don't want page keep refreshing if possible i'd send numbers @ once same page or page, create array out of them can complete program using functions based on array. edit: first used <form action="process.php" method=post> insert values here: <input type="number" name=num><br> <input type="submit" value="send"> </form> and didn't know after read files , used piece of code , worked. thank member answered using jquery yet learn java couldn't use now. started last year software engineering student , still don't know , understand embarrassed when read codes others , don't understand ...

java - ZonedDateTime & LocalDateTime are different for 100 years ago -

the behaviour see strange - localdatetime equal zoneddatetime , other times differ 1 hour or 2 , it's 30 minutes. these strange differences depend on year subtract. can explain what's happening? tried jdk1.8.0_65 , jdk1.8.0_91 , macos 10.11.5 . work utc: zoneoffset offset = zoneoffset.utc; here experiments. 1919 values may differ nano or milliseconds, expected: assertequals( localdatetime.now(offset).minusyears(85).toinstant(offset), zoneddatetime.now().minusyears(85).withzonesameinstant(offset).toinstant()); for 1919 it's 1 hour difference: assertequals( localdatetime.now(offset).minusyears(86).toinstant(offset), zoneddatetime.now().minusyears(86).withzonesameinstant(offset).toinstant()); expected :<1930-05-28t20:19:10.383z> actual :<1930-05-28t21:19:10.383z> for 1920 it's 2 hours difference: assertequals( localdatetime.now(offs...

java - Scene2d progress bar not resizing -

i added progress bar stage, , gets default width expected. however, want change width bit, reason libgdx don't. i've tried setsize, setwidth, setminwidth @ background of progress bar , changing texture. nothing works. thing can change size of, knob. here's code: background = new texture("progress_bar_texture"); knob = new texture("knob_texture"); progressbar.progressbarstyle pbs = new progressbar.progressbarstyle(); pbs.background = new textureregiondrawable(new textureregion(background)); pbs.knob = new textureregiondrawable(new textureregion(knob)); pbs.knobafter = pbs.knob; progressbar = new progressbar(0f, 80f, 1f, false, pbs); progressbar.setwidth(400); // doesn't change @ all... table.add(progressbar).right().colspan(1).expandx().padright(40); anton, can increase width of progressbar within table using 1. .colspan(2) or 2.table.setwidth(). if want precise (pixel-perfect) control of position , size of progressbar, add ...

git - How to solve "error: unable to push to unqualified destination: HEAD" -

i have revision a -> b -> c -> d -> e . tried rollback c , commit new revision f seems it's not right way it: git checkout c , changes , git commit . however, when git push origin head complains that: error: unable push unqualified destination: head destination refspec neither matches existing ref on remote nor begins refs/, , unable guess prefix based on source ref. as this question suggests, tried git fetch -p origin didn't work. still got same error message. my question how can rid of situation , fulfill original goal (rollback c , commit f )? also, question suggests, can: git rm -r . git checkout head~3 . git commit but don't want git rm -r . because there lot of untracked useful stuff. it sounds you're looking git revert . in case: git revert e d afterwards can rebase squash 2 reverting commits together.

Java program works in Windows but not in Mac -

hi have done program send screen capture on socket. well, works if take screen capture in mac , send windows pc(7, xp doest work), if want take screen capture in windows , send mac send part of file... here client public class enviar { private static int port = 3460; /* port connect */ private static string host = "192.168.1.135"; /* host connect */ private bufferedreader in = null; private static printwriter outr = null; private static socket server; private static outputstream outfile; private static inputstream infile; public static void main (string[] args) throws ioexception, interruptedexception { socket server = null; inetaddress ina = inetaddress.getbyname(host); while (true) { try { server = new socket(ina, port); if (server != null) { break; } } catch (ioexception e) { //system.exit(1); thread.sleep(1000); } } ...

python - Tweepy mentions_timeline returns an empty list -

i started make twitter api. don't have twitter account, api created one. tweeted 4 times, including mentions. when use mentions_timeline this; my_mentions = api.mentions_timeline() #print(my_mentions) #output: [] after loop on my_mentions parameters text , screen_name nothing returned. what i'm doing wrong here? why it's empty list since mentioned people in tweets + how can search mentions user? there parameter in mentions_timeline() object screen_name or id ? try using new cursor object follows: api = tweepy.api(auth) mentions in tweepy.cursor(api.mentions_timeline).items(): # process mentions here print mentions.text as per twitters documentation here returns 20 recent mentions (tweets containing users’s @screen_name) authenticating user. so cannot check other users mentions using method. achieve this, have uses twitters search api. tweepy's documentation check here