Posts

Showing posts from July, 2011

ios - Force Built-in Mic over bluetooth headset's mic? -

i use built-in mic on device input , bluetooth headset output. session category , must avaudiosessioncategoryplayandrecord . have tried using setpreferredinput: built-in mic switches output device's speakers. i've seen this (specifically comments) mention it's possible. you can use code // create , set audio session avaudiosession* audiosession = [avaudiosession sharedinstance]; [audiosession setdelegate:self]; [audiosession setcategory: avaudiosessioncategoryplayandrecord error: nil]; [audiosession setactive: yes error: nil]; // set bluetooth microphone input uint32 allowbluetoothinput = 1; osstatus stat = audiosessionsetproperty ( kaudiosessionproperty_overridecategoryenablebluetoothinput, sizeof (allowbluetoothinput), &allowbluetoothinput ); nslog(@"status = %x", stat); // problem if not 0 // check audio route uint32 size = siz

javascript - mongodb regex to find two words with exactly n or less words between them -

i want regex can query mongodb in following manner following results a x y b a x b a b in short want regex finds 2 words n words or less between them. here go: /start( \w+){0,n} end/ example /start( \w+){0,1} end/ matches start word word word end // no match start word word end // no match start word end // match start end // match edit you should use /^start( \w+){0,n} end$/ this takes better advantage of mongodb's indexes querys , faster non-indexed fields.

javascript - How to use regex for some specific country character? -

i validating username using regex in js. however, giving me error other country character. found regex other country character. if(/^[a-za-z0-9äöüÄÖÜß\u4e00-\u9faf\u3040-\u3096\u30a1-\u30fa\uff66-\uff9d\u31f0-\u31ff\x30a0-\x30ffñáéíóúü\p{han}\u1100-\u11ff|\u3130-\u318f|\ua960-\ua97f|\uac00-\ud7af|\ud7b0-\ud7ffàâäèéêëîïôœùûüÿçÀÂÄÈÉÊËÎÏÔŒÙÛÜŸÇ\u00c0-\u017f\u4e00-\u9fff|\u2ff0-\u2fff|\u31c0-\u31ef|\u3200-\u9fbf|\uf900-\ufaffzàèéìòóù\u00e0\u00e8\u00e9\u00ec\u00f2\u00f3\u00f9._-]{1,160}$/i.test(text)){ console.log('correct word'); } else { console.log('wrong word'); } but want allow specific country e.g korean: hangul, chosŏn'gŭl japanese: hiragana, katakana (full width), kanji german spanish french italian chinese: simplified chinese russian portuguese. i want can manually remove country character, e.g want remove "simplified chinese", don't can in code because don't know string used country chara

python - Start a script in background when django project start -

i have script fetches data api , add data mongodb. data necessary django project. script separate project. django project single account only. number of account goes up, have setup individual project each account. (replica of each other different credentials. cannot have multiple on same project.) i thought of cron jobs confusing seperate jobs number of accounts. i searched subprocess.popen think serve purpose of running script in background. i.e. when project server run python script started background process. my script like: func1(): while true: # sleep(30) func2(): while true: # sleep(150) func3(): while true: # sleep(900) func4(): while true: # sleep(7200) if __name__ == '__main__': p1 = process(target = func1) p2 = process(target = func2) p3 = process(target = func3) p4 = process(target = func4) p1.start() p2.start() p3.start() p4.start() i ha

MySQL MyISAM Table File is now Too Large -

i have mysql myisam table handles medium blob data. reaches 1.09tb. worried now. possible split table multiple files? file.myd01, file.myd01,... etc. or in case, if have better idea alternative path take on, love hear. (added comment:) create table filetbl ( fileid int(11) not null auto_increment, docid int(11) not null, versionid int(11) not null, doccode varchar(30) not null, filedata mediumblob, docsalt varchar(1000) default null, primary key (fileid), key docversion (versionid,docid) ) engine=myisam auto_increment=0 default charset=latin1 please provide show create table , show table status . for long time default limit myisam data size has been 2^48 bytes. indexing, default has been 2^40 rows fixed format, not case -- since have mediumblob . 2^48 limit; 256tb. long way hitting it. pain of doing merge or partition not worth it. , probably gain no performance benefit. more limits . compression suggestion

html - Bootstrap Navbar unable to collapse -

i want click button in header expand list of links, expands, , unable hide. should working normally? here code: <!-- navbar --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <!-- button collapse list --> <a href="#homepage"><img class="icon" alt="brand" src="img/icon.ico"></a> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#collapsebtn" aria-expanded="false" aria-controls="collapsebtn"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>

java - Very Wired thing happens when I compare two elements of the ArrayList -

this question has answer here: why 128==128 return false 127==127 return true when converting integer wrappers? 6 answers why equal operator works integer value until 128 number? [duplicate] 7 answers public static void main(string[] args) { arraylist<integer> mylist = new arraylist<integer>(); mylist.add(2000); mylist.add(2000); mylist.add(2); mylist.add(2); if(mylist.get(1)==mylist.get(0))system.out.println("2000 equal check"); if(mylist.get(1)!=mylist.get(0))system.out.println("2000 not equal check"); if(mylist.get(2)==mylist.get(3))system.out.println("2 equal check"); if(mylist.get(2)!=mylist.get(3))system.out.println("2 not equal check"); } my code shown above. , results shown below.

php - Crop text if longer than Cell Width in fPDF? -

i have cell in fpdf 50mm wide populated field in database. there way can crop text doesn't go beyond 50mm if field contains lot of text? alternatively there way in php crop string based on it's mm length when printed @ specific font size? a cell of size 100mm can contains approx 75 character of font size 8. try adject text length manually above hint. but suggest better use multicell() dynamic text size.

c# - Windows 10 block assembly after restart -

i have installed program windows 10 %programfiles% path. after time, after auto-restart windows (after update?) program doesn't run. in event viewer have follow error: system.badimageformatexception: not load file or assembly 'common.logging, version=2.3.1.0, culture=neutral, publickeytoken=af08829b84f0328e' or 1 of dependencies. module expected contain assembly manifest. now in program folder common.logging.dll blocked. blocked assembly , how prevent in future?

objective c - NSUserScriptTask: cancelling tasks? -

is there way cancel running nsuserscripttask? way comes mind launch separate process (a command line tool) via nstask, purpose run nsuserscripttask, , terminate command line tool via nstask when necessary. however, seems bit far-fetched , not optimized... ideas?

IOS Jailbreak How do intercept SMS / Text Messages -

i'm trying write application intercepts text messages , reacts depending on content of message. tried hook _receivedmessage:(struct __cksmsrecord *)message replace:(bool)replace method in cksmsservice class seems not called @ all. could please tell me function/class have hook in? need intercept text message before gets displayed , stored database. i'm on ios 5.0.1. any appreciated. this code snippet should intercept sms messages- can extend other kinds of notifications. work on ios 5.0.1 well. not work imessages though. link coretelephony framework (there bunch of private headers there you'd can class-dump) #include <dlfcn.h> #define coretelpath "/system/library/privateframeworks/coretelephony.framework/coretelephony" id(*cttelephonycentergetdefault)(); void (*cttelephonycenteraddobserver) (id,id,cfnotificationcallback,nsstring*,void*,int); static void telephonyeventcallback(cfnotificationcenterref center, void *observer, cfstringref

php - Show several Instagram accounts (10 images/account) on one 1 page -

i'm having several names , access tokens stored in mysql database , want display images users. i have found library online , works great. i'm testing account , far good. problem appears when i'm display accounts. it's showing latest account added.. while loop working great fetch data mysql problem comes when add instagram code. here code: lib/instagram_single.php <?php class instawcd{ function userid(){ $username = strtolower($this->username); // sanitization $token = $this->access_token; $url = "https://api.instagram.com/v1/users/search?q=".$username."&access_token=".$token; $get = file_get_contents($url); $json = json_decode($get); foreach($json->data $user){ if($user->username == $username){ return $user->id; } } return '00000000'; // return if nothing found } function usermedia(){ $url = 'https://api.instagram.com/v1/users/'.$thi

javascript - change bootstrap classes for selected dynamic values -

i trying change dynamically added div sizes in bootstrap grid cols.. tried change dynamically added div sizes using single click function added divs. problem when clicked on added div changing class,, if selected div change size, function applying previous div.. want change selected div size.. can check code below , demo.. demo updated var app = angular.module('myapp', ['ngsanitize']); app.controller('mainctrl', function ($scope, $compile) { $scope.usernames = []; $scope.emails = []; var counter = 0; $scope.add_username = function (index) { $scope.usernames[counter] = { user: 'username', size: 'col-xs-12' }; var userdiv = '<div ng-click="selectuser(usernames[\'' + counter + '\']);show(\'div1\',' + counter + ')" class="{{usernames[' + counter + '].size}}" ng-class="{selected : ' + counter + ' == active}">\n\

mysql - ClassNotFoundException using Play2 + Hibernate -

i new jvm-based world , trying build test webservice using scala, play 2 framework , hibernate. problem hibernate configuration. hibernate.cfg.xml looks this: <?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-configuration system "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.dialect"> org.hibernate.dialect.mysqldialect </property> <property name="hibernate.connection.driver_class"> com.mysql.jdbc.driver </property> <property name="hibernate.connection.url"> jdbc:mysql://localhost/parking-webservice </property> <property name="hibernate.connection.username"> root </property> <property name="hibernate.conne

javascript - Exception while invoking method 'Mongol_verifyDoc' ReferenceError: Match is not defined -

i new meteor don't know why getting error in console. => meteor server restarted i20160127-14:34:59.949(5.5)? exception while invoking method 'mongol_verifydoc' referenceerror: match not defined i20160127-14:34:59.949(5.5)? @ [object object].meteor.(anonymous function).mongol_verifydoc (packages/msavin_jetsetter/server/main.js:1:1) i20160127-14:34:59.950(5.5)? @ maybeauditargumentchecks (livedata_server.js:1698:12) i20160127-14:34:59.950(5.5)? @ livedata_server.js:708:19 i20160127-14:34:59.950(5.5)? @ [object object]._.extend.withvalue (packages/meteor/dynamics_nodejs.js:56:1) i20160127-14:34:59.950(5.5)? @ livedata_server.js:706:40 i20160127-14:34:59.950(5.5)? @ [object object]._.extend.withvalue (packages/meteor/dynamics_nodejs.js:56:1) i20160127-14:34:59.950(5.5)? @ livedata_server.js:704:46 i20160127-14:34:59.950(5.5)? @ trycalltwo (/home/sachin/.meteor/packages/promise/.0.5.1.1550ocw++os+web.browser+web.cordo

algorithm - Generating a vector of correlated binary variables in O(n) -

i'm looking efficient o(n) algorithm creating vectors of correlated binary values, given: all values must identically distributed (though not independent) they must have fixed mean p they must have fixed correlation r each other e.g. given p=0.5 , r=1.0 expect vectors [0 0 0 ...] , [1 1 1 ...] generated equal probability. p=0.5 , r=0.0 expect binary values independent fair coin tosses. because algorithm must run in o(n) time, solution involves generating correlation matrix automatically ruled out. is there simple algorithm can achieve this?

Error in importing a file in Python 3.3.6 -

Image
i trying learn stackless python , got latest 3.3.6. created try.py file , wrote content print " hello world" print " evening" then in python command prompt, gave command import try.py it gave error , syntax error: invalid syntax shown in figure below: what's wrong here? have placed file in c:\python33. this happening because try reserved keyword in python. try again after renaming file else. also, during importing, specifying extension of python file wrong. instead of import mymodule.py , should write import mymodule .

java - decode and encode a json encoded array of coordinates using jackson -

i've built server in java accepts json encoded array of coordinates respresented array containg latitude , longitude. so looks this [["48.72028","21.25768"],["48.71669000000001","21.253410000000002"]] now need decode array of coordinate. coordinate com.vividsolutions.jts.geom.coordinate. this array represents polyline transformed polygon. polyline hundreds of points long. need send polygon encoded in json client until have used google gson, slow. json decoding , encoding takes more time polygon transformation. after little googling got impression jackson should fastest. but i'm php developer json decode , encode 1 line , first time writing java, have no idea how use it. how decode json in coordinate[] array, , encode similar array json again? thanks if understood question, it's array of arrays. not sure approach here work (sorry don't have test environment here). however, works fine, array of objects

php - Is it possible to copy images from a particular directory on my server to Facebook? -

this question has answer here: upload photo album facebook's graph api 3 answers i know whether possible create php script copy images folder on server facebook. managed upload 1 image php script desired album. instead copy image files onto desired album. is there literature available guide me. yes, can send request facebook api upload locally stored photos. of course in context of album (created previously). $facebook->setfileuploadsupport(true); $args = array('message' => 'photo caption'); $args['image'] = '@' . realpath($file_path); $data = $facebook->api('/me/photos', 'post', $args); print_r($data);

sql server - SQL Declare Select Insert -

i'm trying query run on results of select. problem select log_item201303 returns 1 result. means insert into clause affects 1 row each time run script. want results (600+ total) , insert of them, row row. declare @charkey int, @charname varchar(16), @item int select @charkey = char_key, @charname = name, @item = itemnum log_item201303 ( itemnum = 14317 or itemnum = 14318 or itemnum = 15478 or itemnum = 15479 or itemnum = 14301 or itemnum = 14302 or itemnum = 15476 or itemnum = 15477 or itemnum = 15018 or itemnum = 15019 or itemnum = 15020 or itemnum = 15021 or itemnum = 15022 or itemnum = 15023 or itemnum = 15024 or itemnum = 15025 or itemnum = 14437 or itemnum = 14438 or itemnum = 15656 or itemnum = 15657 or itemnum = 15658 or itemnum = 15659 or itemnum = 15660 or itemnum = 15661 or itemnum = 15662 or itemnum = 15663 ) , (kind = 133) , (convert(varchar, occur_time,111) < '2013/03/22') select @charkey, @charname, @item inser

php - Reading from file (require) -

i have this: http://i.imgur.com/kpulybg.png , im working on "admin" folder , inside of have "admin.php", problem want read "core/init.php" there. have in admin.php <?php require '../includes/header.php'; ?> <?php $user = new user(); if(!$user->isloggedin()){ redirect::to(404); } else if(!$user->haspermission('admin')){ redirect::to(404); } ?> <div id="content"> </div> <?php require '../includes/footer.php'; ?> and inside "includes/header.php" have php require_once 'core/init.php'; admin page: warning: require(core/init.php): failed open stream: no such file or directory in c:\xampp\htdocs\oop\includes\header.php on line 2 fatal error: require(): failed opening required 'core/init.php' (include_path='.;c:\xampp\php\pear') in c:\xampp\htdocs\oop\includes\header.php on line 2 i know have add ../ error on index.php page must run wit

PHP - Create base64 encoded image from String -

i have array contain strings , want display them in image format (each image contain string). need display image in format: <img src="data:image/png;base64,...<data>..."/> , images in html page. how create base64 encoded image string? i tried search google, there tutorials "create base64 encoded image image file". example: if text "600153957", output be: <img src="data:image/png;base64,ivborw0kggoaaaansuheugaaad4aaaaocaiaaad42ti+aaadv0leqvriidvwt0gqaxq/14zbryamsslehekshyrevawuqktetrlioovetigwluqiwqsfyxzuahmmcjgqfujcypw4cjeieziwfqviigvcmflmog/xdeeaxexxfu9xf6vd7zu/7/yz7xzmbylcnwnz/53av8ex1a8odtrq9fpz838wfmfhoa+vb3z29urqqpvpx8fhxz/x5qb/olkpmayzsrkcbugkekql0m63p1kpf8jzhhd0disizwbtbdarvcqztla2tvb09otxedqaduvrugie5wegeok4ha69xt9snr8lezfhgcnb+fl5kdav1jexlxmgqvareiokokajsdvt8xicoqh4pn6bj0ajabambhgxxq/tnk1sqrworzgcbjabbrc7go0megkaodw8rmszmznjyulezofzahb6evpdiijx19e5xc4wiwga0+n8futqou3tfr+/vywcimhksnk5jihwq9vqtfbm3w63lho4hfyqlbvadb9icxe

html - Cannot get fields on right place and inside border divs, using bootstrap -

Image
i have box has settings information, using bootstrap, not sure why messing up. want create similar this. so write codes this <!-- settings --> <div class="col-md-8 col-md-offset-1"> <div class="bsettings"> <h2>settings</h2> <div class="col-md-12"> <div class="noticebox"> <h3>hello world hello world</h3> <p>lorem ipsum alit berket usum , amazing</p> <button type="button" class="btn btn-primary active">on</button> <button type="button" class="btn btn-primary ">off</button> </div> </div> </div><!-- /.borrow-settings --> so bsettings outside box, , noticebox oval looking box in is, not able push buttons right , text o

android - Find Location inside building or Malls -

how find indoor location without gps? there many method find indoor location such wifi triangulation,cellular network,fingerprint,bluetooth & magnetic fields..ect. - have tried wifi triangulation triangulation need know physical geolocation of min. 2 or 3 access point.i dont have database or physical location of wap's... there in way/formula find location of router without using google geolocation api's. - how find location using android magnetic field? please me out...to find indoor location :( google play service fusedlocationapi provides accurate (claimed google) combination of gps, wifi , cellular network. can use indoor/under buildings locations. example please http://www.adavis.info/2014/09/android-location-updates-with.html . hope helps.

python - Matplotlib editing legend labels -

if modify labels of plot plt.legend([some labels]) , call ax.get_legend_handles_labels() old labels. here simple example: in [1]: import matplotlib.pyplot plt in [2]: plt.plot([1,2,3], label='a') out[2]: [<matplotlib.lines.line2d @ 0x7f60749be310>] in [3]: plt.plot([2,3,4], label='b') out[3]: [<matplotlib.lines.line2d @ 0x7f60749f1850>] in [4]: ax = plt.gca() in [5]: l = ax.get_legend_handles_labels() in [6]: l out[6]: ([<matplotlib.lines.line2d @ 0x7f60749be310>, <matplotlib.lines.line2d @ 0x7f60749f1850>], [u'a', u'b']) in [7]: plt.legend(['c', 'd']) ### correctly modifies legend show 'c' , 'd', ... out[7]: <matplotlib.legend.legend @ 0x7f6081dce190> in [10]: l = ax.get_legend_handles_labels() in [11]: l out[11]: ([<matplotlib.lines.line2d @ 0x7f60749be310>, <matplotlib.lines.line2d @ 0x7f60749f1850>], [u'a', u'b']) at point have no idea

java - Retrofit2 DuplicateFileException -

hi im new retrofit , got error: error:execution failed task ':app:transformresourceswithmergejavaresfordebug'. com.android.build.api.transform.transformexception: com.android.builder.packaging.duplicatefileexception: duplicate files copied in apk meta-inf/maven/com.squareup.retrofit2/retrofit/pom.properties file1: c:\users\loudoms\documents\piczon\loock2\app\libs\retrofit-2.0.0-beta3.jar file2: c:\users\loudoms\.gradle\caches\modules-2\files-2.1\com.squareup.retrofit2\retrofit\2.0.0-beta3\97675641051febfee098903cc0eff62f2826e34e\retrofit-2.0.0-beta3.jar i tried include packaging options didn't work. me please don't know or remove. my gradle looks this: apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.0" defaultconfig { applicationid "com.example.loudoms.loock" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes {

swing - Java GUI Blank and nullpointerexception -

i fixed when click on calculate button following: this working except calculate button now, , important part. thank in advance help. exception in thread "awt-eventqueue-0" java.lang.nullpointerexception @ radio$calcbuttonlistener.actionperformed(radio.java:76) @ javax.swing.abstractbutton.fireactionperformed(unknown source) @ javax.swing.abstractbutton$handler.actionperformed(unknown source) @ javax.swing.defaultbuttonmodel.fireactionperformed(unknown source) @ javax.swing.defaultbuttonmodel.setpressed(unknown source) @ javax.swing.plaf.basic.basicbuttonlistener.mousereleased(unknown source) @ java.awt.component.processmouseevent(unknown source) @ javax.swing.jcomponent.processmouseevent(unknown source) @ java.awt.component.processevent(unknown source) @ java.awt.container.processevent(unknown source) @ java.awt.component.dispatcheventimpl(unknown source) @ java.awt.container.dispatcheventimpl(unknown source) @ java.

Jms deserialize xml setter not working but it works fine with json -

please me next issue: $data = $this->_jmsserializer->deserialize('<inf_new okpo="null"></inf_new>', 'entity\infnew', 'xml'); annotations: /** * @jms\accessor(getter="getokpo",setter="setokpo") * @jms\type("string") * @jms\groups({"inf_new"}) * @jms\serializedname("okpo") * @jms\xmlattribute */ private $_okpo; getter , setter: public function setokpo($okpo) { $this->_okpo = 'test'; } /** * @return mixed */ public function getokpo() { return 'test'; } result of dumping $data: -_okpo: "null" but: $data = $this->_jmsserializer->deserialize('{"okpo":"null"}', 'entity\infnew', 'json'); result of dumping $data: -_okpo: "test"

android - How to show the selected image from list view in another activity .Getting images from URLs -

image adapter class public class imagelistadapter extends arrayadapter { private context context; private layoutinflater inflater; private string[] imageurls; public imagelistadapter(context context, string[] imageurls) { super(context, r.layout.listview_item_image, imageurls); this.context = context; this.imageurls = imageurls; inflater = layoutinflater.from(context); } @override public view getview(int position, view convertview, viewgroup parent) { if (null == convertview) { convertview = inflater.inflate(r.layout.listview_item_image, parent, false); } picasso .with(context) .load(imageurls[position]) .fit() // explain later .into((imageview) convertview); return convertview; main class public class usageexampleadapterextends appcompatactivity { public static string[] eatfoodyimages = { "http://i.imgur.com/76jfv9b.jpg", "http://i.imgur.com/fux7eib.j

onclicklistener - Android ImageButton click not working sometimes -

i'm using imagebutton in xml, this: <framelayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="true" > <imagebutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imagebutton_home" android:src="@drawable/home_icon" android:background="@android:color/transparent" android:layout_alignparentleft="true" android:layout_marginleft="10dp" android:focusableintouchmode="false" android:focusable="false" android:clickable="true" /> <imagebutton android:layout_width="wrap_content" android:layout_height="wrap_content"

linux - TFS2015, Team Explorer Everywhere and Kerberos - Unable to authenticate -

i'm trying connect our on premise tfs 2015 14.0.24606.0 (tfs2015.update1.rc1) server red hat linux using team explorer everywhere 14.0.2 , kerberos authentication. however, doesn't work. tee client either doesn't support kerberos or using wrong syntax. below have done. first, grab kerberos ticket using kinit. kinit dnolan@company.org.uk password dnolan@company.org.uk: [dnolan@mylinuxvm tee-clc-14.0.2]$ klist ticket cache: file:/tmp/krb5cc_502 default principal: dnolan@company.org.uk valid starting expires service principal 01/27/16 10:24:24 01/27/16 20:24:29 krbtgt/internal.company.org.uk@internal.company.org.uk renew until 02/03/16 10:24:24 then, following guide ( https://msdn.microsoft.com/en-us/library/hh873092(v=vs.120).aspx ), create new work space called beta1 , point towards project collection in tfs. ./tf workspace -new beta1 -collection:http://tfs.internal.company.org.uk:8080/tfs/defaultcollection access denied connectin

kotlin - How to declare several properties on one line -

i'm developing class several lateinit properties of 1 type. think it's verbose declare each of them on separate line this: lateinit var a: string lateinit var b: string so declare them on 1 line this: lateinit var b, c: string // error: property getter or setter expected but error property getter or setter expected . there way declare several properties on 1 line in kotlin? no, there no way that. declaring multiple properties on same line frowned upon many java style guides, did not implement support in kotlin.

assistance with specific command in Bash -

i have proggram written in c argv[0]=command; argv[1]=null; if(strcmp(command,"ls > try.txt")) { dup2(fd,1); close(fd); execvp(command,argv); perror("execvp"); exit(1); } execvp(command,argv); perror("execvp"); exit(1); i want: if write ls >try.txt command work

video - muxing stream encoding on h264 (interlace) with ffmpeg to mp4 -

mux stream mp4 container: when mux stream(720p) ffmpeg mp4,it works ok. when mux stream(1080i) ffmpeg mp4,the output file can not play normaly in vlc.the generat file have many snow points. have arguments not set right? there need special settings of parameters? waiting answer! thanks! use ffmbc instead, if need mux interlaced stream mp4 container without re-encoding. recommended due quirk of how ffmpeg mp4 muxer works interlaced streams. see here details. if you're ok re-encoding, use ffmpeg -i input.mp4 -crf 18 -vf yadif -c:a copy output.mp4 adjust crf value quality/size tradeoff. lower values provide better quality @ expense of file size.

bash - Heat template: How to pass all the value in a dynamic map to the heat template -

if have list, example, list1={"node1": "test1", "node2": "test2", ...} (this list1 not static, dynamic, users can define length), there way can pass value in list1 bash script? thank much. try @ least using proper language parse data in there. ./my_script.sh `python3 -c "import sys; ast import literal_eval; print(' '.join('--{} {}'.format(key, value) key, value in literal_eval(sys.argv[1].split('=')[-1]).items())"`

JavaScript drag and Snap to browser window -

i want modify below function able not have drag bounds of browser window, "snap" when drag 15px away bounds. zopim has in chat widget, see: http://zopim.com (click on chat icon on bottom right corner , start dragging widget end of browser window) my current function here: http://jsfiddle.net/n6a4q/ code: function enabledragging(ele) { var dragging = dragging || false, x, y, ox, oy, current; enabledragging.z = enabledragging.z || 1; var grabber = ele; grabber.onmousedown = function (ev) { ev = ev || window.event; var target = ev.target || ev.srcelement; current = target.parentnode; dragging = true; x = ev.clientx ; y = ev.clienty ; ox = current.offsetleft; oy = current.offsettop; current.style.zindex = ++enabledragging.z; // cached value var viewportwidth = viewport().width; var viewportheight = viewport().height; document.onm

Aerospike: 1422:LDT-Sub Record Open Error -

i using aerospike 3.5.4 during write operation hit hwl , write stopped. hence increased space , restarted servers (2node, replication 2) after not able read/write on of huge ldt bins. using large stack. i knew lstack has been depricated. how migrate existing data lstack llist. how recover corrupted ldt bins. currently upgraded server 3.6.3 please help. thanks in advance recommend taking @ list operations introduced in 3.7. these native calls manipulate list , may satisfy use case. we have found ldt sub-optimal in many of cases we've seen. both performance perspective (lua/udf used) , complexity perspective. regarding tactical solutions corruption. best remove record , start afresh.

r - Change style and position of the message box generated by withProgress() -

Image
the withprogress() function can generate message box indicating shiny app running. message @ top-right conner of browser small text size, makes message not eye-catching. so wonder there way change style , position of box, message can more expressive. here part of code: output$plot <- renderplot({ if (input$button){ withprogress( distributionpolygon(data(),unit="years",colors=c("black","gray30","gray50","gray70","blue3","dodgerblue3","steelblue1","lightskyblue1","red4","indianred3","orange","seagreen4"),main=title(),tpsmax=input$months), message = 'loading...', detail = '' ) } }) update this updated version can refer example, example taken here server <- function(input, output) { output$plot <- renderplot({ input$goplot # re-run when but

Need Help Returning Data From HTML Form on New HTML Page using JavaScript -

i'm having bit of trouble i'm sure of laugh at. i have form built 1 html page (contact.html), , need have second html page (submit.html) display information entered form using javascript. here form code page 1: <form name="contact" method="post" action="submit.html"> <p>first name: *</p><input type="text" name="first"> <p>last name: *</p><input type="text" name="last"> <p>cell phone number:</p><input type="text" name="number"> <p>e-mail address: *</p><input type="text" name="address"> <p>comment: *</p> <p><textarea name="comments" cols="25" rows="5"> </textarea></p> <p><input type="submit" value="submit"></p> </form> can please point me in righ

How to read a GRIB file for Android and iOS? -

is there libraries android , ios read grib file (general regularly-distributed information in binary form) , weather data ? i found library android http://sourceforge.net/projects/jgrib/ but still looking ios 1 if 1 can help.

soap - how to send request parmater to .net webservice from android? -

sending request parameter given structure in image returns null response.so how send request parameter , receive response parameters according structure given in image . please can me out of this? soapobject request = new soapobject(namespace, method_name); request.addproperty("exttransactionid", "-99999"); request.addproperty("password", "apiuser@123"); attributeinfo ai = new attributeinfo(); ai.name = "username"; ai.type = attributeinfo.string_class; ai.setvalue("sarvoday507"); request.addattribute(ai); request.addproperty("requestdate", "2015-02-24t06:38:00"); request.addproperty("systemid", "apiuser"); request.addproperty("uan", ""); create main request soapobject , add "username" property this. create "request" soapobject , add rest of properties , add "request" soapobject main request soapobject . it this, s

php - Unable to store html divs in a javascript variable -

Image
i have game requires specific tile placed in specific holder. <div id="tile_holder1" ondrop="drop(event)" ondragover="allowdrop(event)"></div> <br> <!--this allows object dragged--><!--need set draggable true enable object dragged --> <div id = "drag1" draggable="true" ondragstart="drag(event)" width="336" height="69"> <!--this creates object dragged--> <button id = "tile1">place square on ground start build house</button></div> so want object named tile1 dragged , dropped in tile_holder1. im using javascript , struggling how correctly go it. want store required html divs within javascript variables , able use if statement make sure tile in correct holder. i'm new javascript , can't find way it. ive created function processed on play button been pressed. great. <button onclick="myfunction()" id = &quo

xml - How can I add attributes to already made elements using PHP? -

i have xml sheet made , i've spent hours looking online way add attributes elements. great! if need more info parts of xml let me know i'll happy provide ever needed! use simplexml job , dom outputting nicely: $xmlstr = <<<xml <root> <fruit origin="brazil">banana</fruit> <fruit origin="germany">apple</fruit> <fruit origin="spain">tomato</fruit> </root> xml; $xml = simplexml_load_string($xmlstr); $xml->fruit[0]->addattribute("state","fresh"); // add state="fresh" banana see post on how generate structured output passing $xml dom: php simplexml how save file in formatted way?

python - Python2 and Python3 compatibility -

i reading filename , run pyrun_simplefile function. below logic not recommended because if there compiler mismatch below code may crash in windows. not recommended :- file *fp = fopen(filename, "r"); if (!fp) return; if (pyrun_simplefile(fp, filename) != 0) return; so above logic, have implemented in python 2 (as per below) working fine. how implemend in python 3 (# else part in below code) because pyfile_fromstring , pyfile_asfile not supported in python 3. #ifdef python2 pyobject* pyfileobject = pyfile_fromstring(filename, (char *)"r"); if (pyrun_simplefile(pyfile_asfile(pyfileobject), filename) != 0) return; #else //how implement in python3 above logic.. pyfile_fromstring , //pyfile_asfile not supported in python 3. #endif can suggest how implement in python 3?

linux - Csh script call C program,arguments issue -

this line csh script ./model2grd $model -d$nx/$ny/$nz -o$x0/$y0 -i$dx/$dy -l$layer -c$coverage -avel.dat -gvel.grd this part of model2grd.c for (i = 2; < argc; i++) { if (argv[i][0] == '-') { switch (argv[i][1]) { case 'g': grdfile = &argv[i][2]; lgrd = true; break; case 'c': cov = &argv[i][2]; lcov = true; break; case 'a': xyzfile = &argv[i][2]; lxyz = true; break; case 'd': sscanf(&argv[i][2],"%d/%d/%d",&nx,&ny,&nz); break; case 'i': sscanf(&argv[i][2], "%lf/%lf", &dx, &dy); break; case 'o': sscanf(&argv[i][2], "%lf/%lf", &xmin, &ymi

python 2.7 - matching error in ORB with opencv 3 -

currently working on opevcv python when use kp1 = orb.detect(img1,none) kp2 = orb.detect(img2,none) kp1, des1 = orb.compute(img1, kp1) kp2, des2 = orb.compute(img2, kp2) matches = matcher.match(des1, des2) i error matcher not defined matches = matcher.match(des1, des2) nameerror: name 'matcher' not defined , using opencv 3.0.0 python 2.7, can tell me why getting error ?? can use matcher or not python ?? you need create matcher object first. complete example can found on opencv tutorials : import numpy np import cv2 matplotlib import pyplot plt img1 = cv2.imread('box.png',0) # queryimage img2 = cv2.imread('box_in_scene.png',0) # trainimage # initiate orb detector orb = cv2.orb() # find keypoints , descriptors orb kp1, des1 = orb.detectandcompute(img1,none) kp2, des2 = orb.detectandcompute(img2,none) # create bfmatcher object bf = cv2.bfmatcher(cv2.norm_hamming, crosscheck=true) # match descriptors.

nasm - Addressing an array of pointers in asm -

i have routine can call this: mov rdi, struc_point mov rsi, struc_color call put_pixel now, create array of pointers have color table. have this, , it's not working: color_table: dq 0 ; null color dq struc_color1 dq struc_color2 dq struc_color3 ; etc..., colors defined somewhere else now, in end: mov rbx, 2 ; index color table mov rdi, struc_point mov rsi, qword [color_table+8*rbx] call put_pixel what going wrong? there no compiler errors, when run this, animations stop. rsi should contain address of struc_color , see first snippet. program works if hardcode color ( mov rsi, struc_color ). this in x86_64 asm, booted directly without os. i found problem. code wrote above in fact correct , worked well. the problem located inside of put_pixel did not save rax . , using rax couple of lines earlier , storing data displayed in it. lead put_pixel throwing program off course on first run.

asp.net web api - Difference between refresh_token and access_token -

i can't find reason why use refresh_token . when can make access_token longed lived... why have both? as have jwt tag on question assume referring json web tokens the following referenced from refresh tokens: when use them , how interact jwts access tokens carry necessary information access resource directly. in other words, when client passes access token server managing resource, server can use information contained in token decide whether client authorized or not. access tokens have expiration date , short-lived . refresh tokens carry information necessary new access token. in other words, whenever access token required access specific resource, client may use refresh token new access token issued authentication server. common use cases include getting new access tokens after old ones have expired, or getting access new resource first time. refresh tokens can expire rather long-lived. refresh tokens subject strict

alloy - Unexpected results in playing with relations -

Image
/* sig { } sig b { } */ pred rel_test(r : univ -> univ) { # r = 1 } run { r : univ -> univ { rel_test [r] } } 2 running small test, $r contains 1 element in every generated instance. when sig a , sig b uncommented, however, first instance this: in explanation, $r has 9 tuples here , still, predicate asks 1 tuple relation succeeds. wrong? an auxiliary question: these 2 declarations equivalent? pred rel_test(r : univ -> univ) pred rel_test(r : set univ -> univ) the problem forbid overflow option set no integer semantics in alloy wrap around, , default scope of 3 (bits), indeed 9=1, can confirm in evaluator. with signatures , b commented biggest relation can generated scope 2 has 4 tuples (since max size of univ 2), problem not occur. it not occur in latest build because believe comes forbid overflow option set yes default, , option semantics of integers rules out instances overflows occur, precisely case when compute size

Android: Ksoap2-android works on emulator (API 23) but not in tablet (API 19) -

i'm trying consume w3school testing web service, using ksoap2-android. here's code of asynctask: private class myasynctask extends asynctask<integer, void, soapprimitive> { @override protected void onpreexecute() { pgdprogress.show(); } @override protected soapprimitive doinbackground(integer... params) { string soap_action = "http://www.w3schools.com/xml/fahrenheittocelsius"; string method_name = "fahrenheittocelsius"; string namespace = "http://www.w3schools.com/xml/"; string url = "http://www.w3schools.com/xml/tempconvert.asmx"; soapobject request = new soapobject(namespace, method_name); request.addproperty("fahrenheit", params[0]); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.dotnet = true; envelope.setoutputsoapobject(request); try { httpt