Posts

Showing posts from September, 2015

ios - Memory not freeing up after popping viewcontroller using ARC -

hi project arc based, using uinavigationcontroller make transition between viewcontroller. using profiler analyse happening behind scene memory. noticed when push viewcontroller allocate memory components , when pop not freeing allocated memory. since using arc unable implement dealloc or release component. have analysed in detail , there no memory leak in project. i not using strong property push viewcontroller. here how pushing viewcontroller. viewcontroller *obj = [[viewcontroller alloc] init]; [self.navigationcontroller pushviewcontroller:obj animated:no]; any clue whats going on? should free memory have consumed. please advise your description indicates have retain cycle, leads objects not being deallocated. typical source of retain cycles properties assigned loading nib files (usually declared iboutlet ). two strategies break them , release objects: declare property weak : @property (nonatomic, weak) iboutlet uilabel *statuslabel; set property nil in

javascript - lodash: Array of Objects -

i have node.js array of objects - [ { sid: 1095, a: 484, b: 'someval1' }, { sid: 1096, a: 746, b: 'someval5' }, { sid: 1097, a: 658, b: 'someval7' }, { sid: 1098, a: 194, b: 'someval3' } ] a) possible update , delete members of array in-place based on sid , wouldn't slow things down performance-wise? b) if needed chunk array , fire off async code against chunks ( insert db, 100 records @ time ) how async blend lodash's synchronous code? pointers appreciated. a) there 2 ways accomplish this. first, instantiate object using var newarr = _.keyby(arr, 'sid'); . reference item want edit directly newarr[sid].a = 494 . option use combination of _.indexof , _.find , var index = _.indexof(arr, _.find(arr, { sid: sid })); , edit using index arr[index].a = 494 b) lodash has method _.chunk . var chunked = _.chunk(arr, 100); var promises = chunked.map(item => db.bulkinsert(item)); promise.all(promises)

Controlling while loops in Dart -

i stuck trying simple. want able count upwards until click on screen @ point want counting stop. in reality code carrying out complex ai calculations game, first want understand how control while loop. in android trivial. here code looks like bool ok = true; main() async{ html.queryselector('#content').onmouseup.listen((e){ ok = false; }); await for(int in naturals){ print(i); await sleep(); } } stream naturals async* { int k = 0; while (ok) { yield await k++; } } future sleep() { return new future.delayed(const duration(milliseconds: 1), () => "1"); } i put sleep() method in way ensure control passed event loop. is possible control while loop without sleep() method? to provide more general answer - instead of loop, want schedule sequence of future tasks each executes 1 iteration or step of ai code (or whatever background process want have running). you can have step task recursively schedule itself: dynamic dosomething(_

jquery - HTML displaying values in JavaScript "data" -

the following javascript code used display table data chart. <script type="text/javascript"> $(function () { $('#container').highcharts({ data: { table: 'datatable' }, chart: { type: 'column' }, title: { text: 'results' }, yaxis: { allowdecimals: false, title: { text: 'units' } }, tooltip: { formatter: function () { return '<b>' + this.series.name + '</b><br/>' + this.point.y + ' ' + this.point.name.tolowercase(); } } }); }); </script> html c

Loop through database fields PHP MySQL -

Image
i working on election system , having difficulty solving problem. following how application looks like. at moment these results adding query multiple times on php file. (for example run raceid = 9, raceid = 10 .........) sure there should way of reading raceid array or other way , results way. since these join tables looking way of retrieving racename (presidential names, justice supreme court ... etc) , mainracename(titles red, blue, gray) well. hope making sense far... following code <!-- main election ticket mainid loop should control --> <div class="panel panel-red margin-bottom-40"> <div class="panel-heading"> <h2 class="panel-title"> <strong>republican national</strong> </h2> </div> <!-- end sub election ticket raceid loop should control section--> <h3 style="background-color:#f5f5f5; margin:30px; padding:5px; font-weight:bold ">presidential race </h3>

c# - VS2015 icon guide - color inversion -

Image
i downloaded set of vs2015 icons , reading through msdn guide under "using color in images", stated " in order make icons appear correct contrast ratio in visual studio dark theme, inversion applied programmatically. " i'm trying mimic behavior in application when apply color inversion image, doesn't come out way looks in vs's dark theme: does know how vs inverts colors can mimic this? edit: inversion code i'm using - issue appear edges transparency/alpha: public static void invertcolors(bitmap bitmapimage) { var bitmapread = bitmapimage.lockbits(new rectangle(0, 0, bitmapimage.width, bitmapimage.height), imagelockmode.readonly, pixelformat.format32bpppargb); var bitmaplength = bitmapread.stride * bitmapread.height; var bitmapbgra = new byte[bitmaplength]; marshal.copy(bitmapread.scan0, bitmapbgra, 0, bitmaplength); bitmapimage.unlockbits(bitmapread); (int = 0; < bitmaple

Java fast image comparing -

hi formatted phone , uploaded photos pc, when wanted add photos phone saw have multiple duplicates of images. wanted merge photos 1 folder upload phone wrote java code. public class main { public static int imgctr = 1; public static file dest = new file("d:\\finalfinal"); public static void main(string[] args) throws exception { getcontent("d:\\restorefinal"); getcontent("d:\\restore1"); getcontent("d:\\restore2"); } public static string getextension(string filename) { string extension = ""; int = filename.lastindexof('.'); if (i > 0) { extension = filename.substring(i + 1); } return extension; } public static boolean isimage(string extension) { if (extension.equalsignorecase("jpg") || extension.equalsignorecase("jpeg") || extension.equalsignorecase("png")) return true; return false; } public static boolean compareima

hibernate - Properly cascading this @OneToMany relationship (Spring Data JPA) -

alright, i'm little deperate right now. i've read many of other related questions hasn't helped me resolve issue yet. i'll glad if can me out. i'm using spring data jpa , have these 2 entities: device.class private string id; @onetomany(mappedby = "device", cascade = cascadetype.all) @jsonignore @restresource(exported = false) private list<reading> readings; reading.class @manytoone(cascade = {cascadetype.merge}) /*this isn't right...*/ @joincolumn(name = "device_id") private device device; expectation i'm saving readings , expect device cascaded correctly (persisted or merged), depending on whether exists. (readings inserted once, never updated) reality i can make work partially : when use cascade = cascadetype.all or cascade = cascadetype.persist can save first reading , mapped device. once insert second reading has relationship same device, along lines of: duplicate entry '457129' key &

java - How to format string to a particular pattern -

let's have input string , need format this: ### ### ############........etc so has have first 3 chars, space, 3 chars, space , rest. there third-party library or jdk class able that? i trying use regular expressions system.out.println(inputstring.replaceall(".{3}", "$0 ")); but it's not working because result is ### ### ### ### ### etc. you this: system.out.println(inputstring.replacefirst("(.{3})(.{0,3})", "$1 $2 ")); explanation: just $0 entire matched string, $1 , $2 are, respectively, first , second matched things in brackets. i modified {3} {0,3} strings 6 characters or shorter work (it add trailing space when string between 4 , 6 characters, can removed .trim() (which have unwanted other effects) or more complex). hopefully no explanation required rest, since it's similar code, feel free ask if you're unsure. java regex reference . example: system.out.println("123456789012345

r - BoxPlot in ggplotly -

i'm trying draw time series boxplot in r plotly libraries, need able have total control of ymin, ymax, ylow etc. it renders fine in ggplot2, althought ton of warnings. fails render in ggplotly here have. msft = read.csv("http://ichart.finance.yahoo.com/table.csv?s=msft", header=true, sep=",") msft$date msftf = msft %>% tbl_df() %>% filter(as.date(date) > as.date("2016-01-01")) %>% na.omit() msftf %>% ggplot(aes(x = factor(date), ymin = low, lower = open, middle = close, upper = close, ymax = high)) + geom_boxplot() + geom_boxplot(stat = "identity") @david crook here's simple example. library(plotly) library(quantmod) prices <- getsymbols("msft", auto.assign = f) prices <- prices[index(prices) >= "2016-01-01"] # make dataframe prices <- data.frame(time = index(prices), open = as.numeric(prices[,1]),

AngularJS, ng-repeat on radio and $scope.watch -

i'm using example: https://jsfiddle.net/qnw8ogrk/1/ create radio-buttons. i able use $scope.watch on radio-buttons, i'm not able use: $scope.watch('selected', ... what should assign .watch able detect whenever user clicks on radio button? actual mistake $scope.watch should $scope.$watch having watcher on scope variable not idea. instead of placing watcher on ng-model i'd suggest use ng-change fires when radio button ng-model value gets changed. <label ng-repeat="option in options"> <input type="radio" ng-change="test()" ng-model="$parent.selected" ng-value="option" />{{option}} </label> and don't use rid of $parent notation accessing outer scope of ng-repeat switch use controlleras pattern, , change ng-controller directive use alias of controller. change controller implementation, bind value this (context) instead of $scope markup <div ng-controller=&

R for loop to populate new variable -

dear stackoverflow community, i @ loss loop , i'm pretty sure minor problem. did browse through loop questions have been asked... here have far: xvals <- as.matrix(seq(1,10, 1)) i create ovals based on ovals yvals <- (i in 1:nrow(xvals)){ p <- 2.69/(1+2.69) if (i == 1){ yvals[i,] <- round(p, 2)} else { yvals[i,] <- round(1-(p)^i, 2)} } unfortunately, thing keeps throwing error error in 1:nrow(xvals) : argument of length 0 when change xvals matrix, different error: error in yvals[i, ] <- round(p, 2) : incorrect number of subscripts on matrix without loop xvals <- 1:10 p <- 2.69/(1+2.69) yvals <- 1-p^xvals yvals[1] <- p yvals <- round(yvals, 2)

Android. Positioning of the elements in relativelayot -

Image
i have relativelayout cardview , inside placed: imageview , textview1 , textview2 . these 3 elements needed place imageview must left, textview1 , textview2 right of it. textview2 must pressed bottom of cardview , @ same time below of textview1 (if textview1 has text). there no questions first 2 elements, there problems 3 (second textview ): or pressed bottom, overlaped first textview (if first textview has text), or below of textview1 , not pressed bottom. layout: <android.support.v7.widget.cardview android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="wrap_content" app:cardbackgroundcolor="@color/colorbackground"> <relativelayout android:id="@+id/card_view_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="16dp&qu

vsts - How can I set the build destination in Team Services for WIX -

i using windows installer xml , project moves team services. however, paths wont work anymore , need update setup. on local build machine used hardlink: c:\projects\solution\project\bin\release\assembly.dll my question: best way build 4 projects , run 5th project, uses assemblies in bin/release directory? add reference project , use $(var.project.targetpath) instead of hardlink (or $(var.project.targetdir)assembly.dll). references add dependencies on projects wixproj means must build before wixproj binaries exist. projects should included in same solution wixproj. here's resource automatically defined compile time variables can use http://wixtoolset.org/documentation/manual/v3/votive/votive_project_references.html alternatively if can't way can define variables in <defineconstants> of wixproj. "projectdir=$(msbuildthisfiledirectory)..\project\bin\release\" , in wix component using sourcedir hardlink use sourcedir=$(var.projectdir)assembly.

How to handle precision when dealing with currency in MySQL and PHP -

i have 3 fields in invoice table: subtotal decimal(12,4) tax_amount decimal(12,4) total decimal(12,4) i have run problem rounding. there's invoice following values. addition adds up, when displaying invoice data , generating pdf invoice, displayed data doesn't add up. stored value displayed (rounded) value subtotal 165.1610 165.16 tax_amount 24.7742 24.77 total 189.9352 189.94 the stored values add up. total column calculated adding subtotal , tax_amount values in php. rounding done correctly 165.16 + 24.77 = 189.93 , not 189.94. how can handle these situations? not case. round stored values nearest penny. when you're calculating total or subtotal using php, sum rounded values. if you're going displaying rounded aggregates way, it's best practice calculate exact same way avoid confusion. you could display aggregate items not being rounded, ,

NoClassDefFoundError When Using Dagger 2 After Switching to Android Studio 2.0 -

before upgrading android studio 2.0 use dagger 2 no problem. getting noclassdeffounderror has shut me down more day , i'm reaching out help. it seems though gradle cannot appmodule class though pretty clear in project. have included set multidexenabled true though project few files. everything can find online says can click libraries imported. android studio has no such luxury. any appreciated , have undying loyalty. 04-21 17:26:54.006 7875-7875/com.androidtitan.spotscoreapp e/androidruntime: fatal exception: main process: com.androidtitan.spotscoreapp, pid: 7875 java.lang.noclassdeffounderror: com.androidtitan.spotscoreapp.main.injection.appmodule_providesapplicationfactory @ com.androidtitan.spotscoreapp.main.injection.daggerappcomponent.initialize(daggerappcomponent.java:31) @ com.androidtitan.spotscoreapp.main.injection.daggerappcomponent.<init>(daggerappcomponent.java:23) @ com.androidtitan.spotscoreapp.main.injection.daggerappcomponent.<init>(d

javascript - Lotus-1-2-3 (wk1) file parsing guidelines -

i'm trying make little converter wk1 (lotus-1-2-3) files excel friend. files have simple data, no functions or complicated. i couldn't find related guidelines parse or documentation of wk1 file structure. tried going through libreoffice code c++ rusty (academic level, 6 years ago). i code in php , javascript, , didn't find related these languages. i believe read somewhere lotus-1-2-3 abandonware now, don't think "illegal" or anything. is there information available this? best approach "decoding" data (other give up)? thanks for me there no reason re-invent wheel... there free software can convert these files. available portable app , has command- line parameter convert between formats: soffice --headless --convert-to <targetfileextension>:<nameoffilter> file_to_convert.xxx so if need "own" program: package portable version of libreoffice , make nice interface select source , target file , run command

javascript - Angular nested filters by checkbox -

i'm trying build small schedule app, displays events happening on 1 of 2 days. users able filter category/topic of events checkboxes. here demo: http://jsfiddle.net/qx3cd/201/ i want create nested filter, first allows users choose either day 1 or day 2, , filters through results category. is there way perform nested filter angular? js function myctrl($scope) { $scope.showall = true; $scope.checkchange = function() { for(t in $scope.categoryarray){ if($scope.categoryarray[t].on){ $scope.showall = false; return; } } $scope.showall = true; }; $scope.myfunc = function(a) { if($scope.showall) { return true; } var sel = false; for(cat in $scope.categoryarray){ var t = $scope.categoryarray[cat]; console.log(t); if(t.on){ if(a.category.indexof(t.name) == -1){ return false; }else{ sel = true; } } }

android - json file to handlebars -

i developing android app framework7 show info vehicles. first screen contain list vehicles types , user can choose 1 type , go next screen subcategories.i want show contexts of each set in website using handlebars "{{}}". did first screen types wondering if possible use handlebars show subcategories of each vehicle type in different row(which user press , take him next page, have info subtype user selected). have json file following code: [ { "id" : 1, "vehicle type": "hatchback" "subtypes": "st1", "st2", "st3" }, { "id" : 1, "vehicle type": "motorcycle" "subtypes": "mt1", "mt2", "mt3" } ] if want use handlebars {{}}, need have template for example: <script id="template" type="text/template7"> {{#each records}} <p>vehicle type

amazon web services - Is there a way to get a github PR merge to trigger an EC2 instance to start? -

we're trying ec2 instance start whenever merge pull request in github. i have in crontab @reboot /home/user/server-start.sh which want happen (like git pull origin master) when instance starts up, , script works well. i've looked @ aws codedeploy can't see way have turn instance on (this server turned off, needs turn on , stuff when merge pr, turn off again) i'm not sure best approach be, pointers great. here's startup script , nginx server config file, in case helpful. /home/user/server-startup.sh #!/bin/bash # latest master branch cd /path/to/repo sudo git pull origin master # run standard preparation script sudo bash /home/user/scripts/prepare-app.sh # run custom commands update sudo bash /path/to/repo/prepare-app.sh # change http code 200 sudo sed -i -e 's/return 500/return 200/g' /etc/nginx/sites-available/status # restart nginx sudo service nginx restart # change http code 500 sudo sed -i -e 's/return 200/return 500/g'

sql server - Using Sum(Cast(Replace syntax -

i trying write simple query in order change of our stage data. have varchar $ column (unfortunately) needs summed. issue because of commas, cannot change datatype. so, can use replace(amt,',','') remove commas still wont let me cast decimal , error converting data type varchar numeric. i trying following below no luck. ideas? can done or using wrong syntax here? select sum(cast(replace(amt,',','') decimal (18,2)) ) i able resolve @habo suggestion. used cast(ltrim(rtrim(table.amt)) money) instances of varchar amount. removed white space , removed commas numbers.

github - Git/hub submodule: track upstream & modify without missing commits -

so there 2 specific setups. first: repoa submoduleb <-- repob-upstream with setup, submodule update --remote tracks latest changes repob-upstream. submoduleb can commit local changes, , repoa can commit changes submoduleb. unfortunately, commits in repoa store hashes of changes submoduleb. since don't have commit rights repob-upstream, on cloning repoa others receive: fatal: reference not tree: <hash> unable checkout '<hash>' in submodule path '<submoduleb>' it nice if local commits submoduleb stored in repoa... second: repoa submoduleb <-- repob-fork <-- repob-upstream in setup, have commit rights repob-fork , can push changes submoduleb. therefore submodule update --remote won't throw "unable checkout" errors. unfortunately, have manually merge changes repob-upstream repob-fork. so, is there way best of both worlds?

ios - Detect app installation with StoreKit -

ios6 introduced storekit framework designated interacting appstore within app. managed direct user specific app, question how can detect whether user installed app redirected him to? this done calling -canopenurl: on uiaplication object this: nsurl *appurl = [nsurl urlwithstring:@"fb:"]; bool appinstalled = [[uiapplication sharedapplication] canopenurl:appurl]; but need know url scheme second app open. declared in info.plist file app developer.

Dependency injection in Spring MVC? -

i trying use dependency injection in spring mvc web application. have function in controller @requestmapping(value = "/stockgoogle/", method = requestmethod.get) public @responsebody stock stockgoogle(locale locale, model model) { stockdaoimpl si = new stockdaoimpl(); //al=s.listcurrent(id); stock s=si.listgoogle(); system.out.println("reached here"); model.addattribute("s", s ); return s; } i want dependency inject stockdaoimpl. can please tell me how can this. have been trying read of explainations complex. should use @autowired ? should put it? can please help. you can inject through controller's constructor class yourcontroller{ private final stockdao dao; @autowired public yourcontroller(stockdao dao){ this.dao = dao; } } and stockdaoimpl has defined bean of course, @bean public stockdao stockdao(){ return new stockdaoimpl(); } another way doing defining stockdaoimpl

java - How would I put an integer that is storing numbers into an array? -

so have integer z holding values of zip codes , need store each digit of zip code in separate part of array. how able this? private int [] zipdigits = new int [5]; private int digitcheck; private int zipcode; public zipcode(int z) { for(int = 0; < 5; i++) zipdigits[i] = this.zipcode = z; something should work: public int[] inttodigits(int z) { int n = string.valueof(z).length(); int[] res = new int[n]; int = n - 1; while (i >= 0) { res[i--] = z % 10; z = z / 10; } return res; } this first gets length in quite obvious matter, using logarithms don't know if precision lead issues. starts @ of array, takes last digit mod , deletes digit dividing number 10. edit: see you've edited post state length known 5 digits, don't need calculate length ourselves , can use following algorithm: public int[] inttodigits(int z) { int[] res = new int[5]; int = 4; while (i >= 0) { res[i--] = z %

linux - How can I verify in my C program that four terminals are currently open? -

so i'm going preface saying homework project in class. supposed determine user opened 4 terminal windows before running program, , have determining if can open 4 terminal number buffers /dev/pts/ read-only. have save these first 4 buffers can open them again write terminals. know how open files fopen issue terminals aren't open anymore still show , accessible. know pretty frowned upon ask homework i've been working @ hours , don't want written me want direction. how can check there 4 terminals open using method have use? here's code maybe 1 of y'all can see i'm doing wrong. #include <stdio.h> #include <stdlib.h> #define maxline 100 int main(){ int i, ptsnum[4], ptscount = 0; file *fp; char ptsname[20]; for(i = 0; < 20; i++){ // append terminal number end of buffer name sprintf(ptsname, "/dev/pts/%d", i); // try open file if((fp = fopen(ptsname, "r")) != null){

nspredicate - CloudKit Query Value Limit Error -

i have query predicate in want see if values inside array contained in ckrecord on cloudkit, when execute query error saying "query filter exceeds limit of values: 250 container" is there way query array? has 500 objects in it, it's dynamic depending on user lot less or lot more. ckdatabase *publicdatabase = [[ckcontainer defaultcontainer] publicclouddatabase]; nspredicate *predicate = [nspredicate predicatewithformat:@"phonenumber == %@", numbers1]; ckquery *query = [[ckquery alloc] initwithrecordtype:@"phonenumbers" predicate:predicate]; [publicdatabase performquery:query inzonewithid:nil completionhandler:^(nsarray *results, nserror *error) { if (error) { nslog(@"%@", error); } else { nslog(@"%@", results); } }];

mysql - How do I Compare columns of records from the same table? -

here testing table data: testing id name payment_date fee amt 1 banka 2016-04-01 100 20000 2 bankb 2016-04-02 200 10000 3 banka 2016-04-03 100 20000 4 bankb 2016-04-04 300 20000 i trying compare fields name, fee , amt of each data records see whether there same values or not. if got same value, i'd mark 'y' record. here expected result id name payment_date fee amt samedataexistyn 1 banka 2016-04-01 100 20000 y 2 bankb 2016-04-02 200 10000 n 3 banka 2016-04-03 100 20000 y 4 bankb 2016-04-04 300 20000 n i have tried these 2 methods below. looking other solutions can pick out best 1 work. method 1. sele

javascript - How do I draw directed arrows between rectangles of different dimensions in d3? -

Image
i draw directed arcs between rectangles (nodes represented rectangles) in such way arrow-tip hits edge in graceful way. have seen plenty of posts on how circles (nodes represented circles). quite interestingly, d3 examples deal circles , squares (though squares lesser extent). i have example code here . right best attempt can draw center-point center-point. can shift end point (where arrow should be), upon experimenting dragging rectangles around, arcs don't behave intended. here's i've got. but need this. any ideas on how can in d3 ? there built-in library/function can type of thing (like dragging capabilities)? a simple algorithm solve problem is when node dragged following each of incoming/outgoing edges let a node dragged , b node reached through outgoing/incoming edge let linesegment line segment between centers of a , b compute intersection point of a , linesegment , done iterating 4 segments make box , checking intersection of each o

Questions on Bluemix IOT Driver Behavior service -

came across interesting service (experimental) on bluemix - driver behavior. curious know how works, how data bluemix car , there need have external app/device in car collect , post data bluemix similar aviva's rate drive app? one simple example use iot platform , node-red receive car probe data via mqtt , send received data driver behavior service in node-red workflow. can have mqtt client in each driver's smart phone. i not familiar aviva's rate drive app, far searched, might able develop similar kind of application can analyze driving behavior car probe data driver behavior service.

javascript - How do I make dynamically inserted html objects clickable? -

so far have: function createlink(text, parentelement) { var = document.createelement('p'); $( parentelement ).on( 'click', 'a', function () { gomainmenufromresults();}); var linktext = document.createtextnode(text); a.appendchild(linktext); temp1 = text.replace("/","-"); parentelement.appendchild(a); var br = document.createelement('br'); parentelement.appendchild(br); } but on clicking element dynamically made nothing happens! before: $( parentelement ).on( 'click', 'a', function () { gomainmenufromresults();}); after: $( parentelement ).on( 'click', 'p', function () { gomainmenufromresults();});

javascript - Fallback image for HTML5 video -

http://darrenbachan.com/playground/diamond-hand-car-wash/index.html i'm trying set fallback image video banner. when site hits media query (mobile) i'd video become image, when refresh page i'm noticing class have giving dark grey background before video loads in. i'm thinking same image maybe present. want believe background-image set , when query hit maybe add display:none on video. not sure if did correctly heres fiddle https://jsfiddle.net/8ucrarm0/ just in case that's terrible here's html/css: html --> <div class="banner-text"> <span class="logo-white"><img src="img/logo-white.svg" alt=""></span> <h1>feeling luxurious 1 car wash away.</h1>

Gstreamer pipeline merging 2 udp sources to rtmp? -

i can't figure out how merge 2 udp sources (1 audio , 1 video), seperately pretty easy no clue how merge them being noob, know pretty close gst-launch-1.0 rtpbin name=rtpbin rtpbin.recv_rtp_sink_ \ ! udpsrc port=6004 caps="application/x-rtp, media=(string)video,clock-rate=(int)90000,payload=(int)96,encoding-name=vp8-draft-ietf-01" \ ! rtpvp8depay \ ! queue \ ! mux. rtpbin.recv_rtp_sink_ \ ! udpsrc port=6005 caps="application/x-rtp, media=audio, clock-rate=48000, encoding-name=x-gst-opus-draft-spittka-00, payload=111,channels=2" \ ! rtpopusdepay \ ! queue \ ... ? i not know exact answer go way (we can negotiate solution via comments :)) : gst-launch-1.0 flvmux name=mux ! rtmpsink udpsrc port=6004 caps="application/x-rtp, media=(string)video,clock-rate=(int)90000,payload=(int)96,encoding-name=vp8-draft-ietf-01" ! rtpvp8depay ! vp8dec ! queue ! x264enc ! mux. udpsrc port=6005 caps="application/x-rtp, media=audio, clock-rate=48000

c# - Is ShowDialog handled differently in WPF than Winforms? -

i have issue in converting winforms program wpf program. in first program, had smaller window open allow user adjust data, , when closed, other form activated again new data. i used form2.showdialog(); open form, automatically makes parent form deactivated in winforms. way when closed form2, parent form activated, , able use event handler form1_activated reload , re-initialize of settings successfully. however, when attempt same thing wpf, still able open form2 using form2.showdialog(); , when close form, not register form1_activated event handler. instead, in order reload settings, must click on window, , come program register form1_activated event handler. am doing wrong, or there event handler should using in wpf achieve same thing able in winforms? calling showdialog() causes dialog box top appear in modal mode don't understand why need event handler process results after dialog box closed. keep in mind can access public variables in dialogbox, well. i

EofException when doing a deployment using the Tooltwist Controller -

i'm deploying tooltwist application production server using fip, , im getting error on transfer phase. java.net.sockettimeoutexception: read timed out @ java.net.socketinputstream.socketread0(native method) @ java.net.socketinputstream.read(socketinputstream.java:152) and in fipserver console org.eclipse.jetty.io.eofexception @ org.eclipse.jetty.http.httpgenerator.flushbuffer(httpgenerator.java:892) @ org.eclipse.jetty.http.abstractgenerator.blockforoutput(abstractgenerator.java:486) @ org.eclipse.jetty.http.abstractgenerator.flush(abstractgenerator.java:424) @ org.eclipse.jetty.server.httpoutput.flush(httpoutput.java:78) @ org.eclipse.jetty.server.httpconnection$output.flush(httpconnection.java:1094) @ org.eclipse.jetty.server.httpoutput.write(httpoutput.java:159) @ org.eclipse.jetty.server.httpoutput.write(httpoutput.java:98) @ tooltwist.fip.jetty.getfilelistservlet.doget(getfilelistservlet.java:82) @ javax.servle

sql - In MySQL, what does this simple nested SELECT clause mean exactly? -

here example thread : select ( select distinct salary employee order salary desc limit 1 offset 1 )as second; the select(...) second looks confusing me because i've never seen query-set instead of column names can used argument of select .. does have ideas how understand nested select clause this? there tutorials feature? that's subquery in select list of query. to there, let's @ other examples select t.id , 'bar' foo mytable ... limit ... 'bar' string literal gets returned in every row (in column named foo) in resultset query. also, mysql allows run query without clause select 'fee' fum we can put subquery in select list of query. example: select t.id , (select r.id resorts r order r.id asc limit 1) id mytable ... limit ... the query pattern asked select statement without clause and expression being returned result subquery. for example: select e.salary employee e group e.salary

Android Edittext shift text instead of newline effect when inserting more text -

Image
i need change default effect of edittext when doesn't have enough space add more text. but in case have defined fixed height , width edittext. therefore disappears previous text when inserting more text. since inconvenient users, better if can change effect shift text this. this how add edittext please enlight me if know how done. thank you try setting inputtype on edittext like child.setinputtype( inputtype.type_class_text)

ruby on rails - Drop down filter to sort products by category on index page -

i new rails , building online store. have products model , categories model association: products belong_to category , category has_many products. shoppers have ability select category in drop down , products on index page display items in category. i able drop down show of categories using form_tag when select on category index page not filter show category. products index.html.erb: <%= form_tag('products', :remote => true) %> <%= select_tag "category", options_from_collection_for_select(category.all, "id", "name"), { :include_blank => true , :class => "product_select"} %> <%= submit_tag 'filter' %> <% end %> products controller: def index if product.all.collect == (params[:category]) @products= product.send(params[:category]) else @products = product.order(:title) end respond_to |format| format.html # index.html.erb fo

How to use the ajax Json Web Method with amcharts in asp.net -

demo map //this chart fuctions..i want pass the country id chatdata on map //using ajax json web method. //error: uncaught typeerror: cannot read property '0' of undefined. var chart; var map; var chartdata = {}; chartdata.world = [ { source: "oil", energy: 3882.1 }, { source: "natural gas", energy: 2653.1 }, { source: "coal", energy: 3278.3 }, { source: "nuclear", energy: 610.5 }, { source: "hydro", energy: 740.3 }]; chartdata.kh = [ { source: "oil", energy: 404.6 }, { source: "natural gas", energy: 79.8 }, { source: "coal", energy: 1537.4 }, { source: "nuclear", energy: 15.9 }, { source: "hydro", energy: 139.3 }]; chartdata.cn = [ { source: "oil", energy: 842.9 }, { source: "natural gas", energy: 588.7 }, { source: "coal"

c++ - Why are two while() loops causing a crash? -

#include <iostream> #include <string> int main(){ char p; bool show_cleartext; std::string input; std::cout << "would output show original text? [y/n] \n"; while(true){ std::cin >> input; if(input == "y"){show_cleartext = true; break;} else if(input == "n"){show_cleartext = false; break;} else std::cout << "[y/n] ? \n"; } while(true){ // promts 'input' displays input, reversed std::getline(std::cin,input); if(input == "quit")break; for(int = 0; < (input.length()-1)/2; ++i){ p = input[input.length()-i-1]; input[input.length()-i-1] = input[i]; input[i] = p; } std::cout << input+'\n'; } return 0; } each of while loops fine. including both of them causes program crash once proceeds past first 1 i.e. entering 'y&#