Posts

Showing posts from June, 2011

ios - UICollection View and UITable View inside UITableViewCell -

Image
i using uistackview add uilabels along uitableview , uicollectionview. when data loaded views uilabels shown. i have not added constraints in views please me know behavior of uistackview not allowing me show uitableview , uicollectionview. but if add height constraints view works view gets messy. on scrolling main view in uistackview present after data load operation finished, view seen correctly. i adding view wanted when main view first loads in attachment.

c# - Sort MongoDB result on aggregation of list element field -

i started play around mongodb on c#. use restaurant sample data ( https://raw.githubusercontent.com/mongodb/docs-assets/primer-dataset/primer-dataset.json ). what trying figure out is, how can sort restaurants total of rating score. can provide sample on how using aggregatefluent api? got lost that. thanks! i create dto classes collection: public class restaurant { public objectid _id { get; set; } public address address { get; set; } public string borough { get; set; } public string cuisine { get; set; } public grades[] grades {get;set;} public string name { get; set; } public string restaurant_id {get;set;} } public class grades { public datetime date {get;set;} public string grade {get;set;} public int? score {get;set;} } public class address { public string building { get; set; } public double[] coord { get; set; } public string street { get; set; } public string zipcode { get; set;} } and if create c

api - Searching users on LinkedIn using Python-LinkedIn -

i new python programming. trying access linkedin data using pyhton. have performed steps mentioned @ https://ozgur.github.io/python-linkedin/ when run code profile, desired result if try code else (like search_profile() or get_group(41001)) following error linkedinerror: 400 client error: bad request url: the code have written below: api_key = "xyz" api_secret = "abc" return_url = "http://localhost:8080/testprj/auth/linkedin" access_token = "abcdef" application = linkedin.linkedinapplication(token=access_token) application.get_profile() # no error application.get_group(41001) # error application.search_profile(selectors=[{'people':['first_name','last_name']}]) # error can me understand issue , how solve ? thanks !!!

android - retrofit gives 500 internal server error when I add only one item, but postman response works fine -

Image
i trying debug issue "http 500 internal access error" .for code shown below: private void submitorder() { list<string> itemids = new arraylist<>(); list<integer> itemquantity = new arraylist<>(); (foodtruckitem foodtruckitem : foodtruckitemlist) { itemids.add(foodtruckitem.getitemid()); itemquantity.add(foodtruckitem.getitemquantityordered()); } if (internetconnection.checkconnection(this)) { observable<genericresponse> results = retroclient.getapiservice() .submitorder("******", "", total, "anywhere", "", "*****", itemids, itemquantity, foodtruckinfo.getfoodtruckid()); results.subscribeon(schedulers.io()).observeon(androidschedulers.mainthread()) .subscribe(new subscriber<genericresponse>() { @override public voi

catransform3d - How do I get the right perspective for the used pattern? iOS Project with Swift3 -

Image
the following image house garage; garage door pattern: the garage door overlaid pattern, how can transform pattern perspectively correct? this ios/swift3 project i'm working on, using following code let layer:calayer = self.rectimageview.layer var rotationandperspectivetransform:catransform3d = catransform3didentity rotationandperspectivetransform.m34 = 1.0 / -250 rotationandperspectivetransform = catransform3drotate(rotationandperspectivetransform, self.calculateangleofperspective(), 0.0, 1.0, 0.0) layer.transform = rotationandperspectivetransform i'm getting following view garage door wrong perspective: can please guide me right direction, how can achieve, seen in upper half of image, instead of lower part? in advance!

java - Going back to Main Activity on Android app with back key to see user score -

hopefully can advice on this. my program has sprite that, when hit/clicked, score tallied on screen. when game on (time runs out), want user able press key on phone go main/start screen/activity began game, show score (how many hits). i'm struggling figure out how go back key press. can figure out high score bit @ later date if need be. want start screen. update: i think may have manifest why it's not working. i've tried add 'gameview' class manifest won't accept it. says has no default constructor. ideas? <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="cct.mad.lab.mainmenu" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" />

Android close current activity and return to previous activity -

in second activity, can uninstall app after uninstall finished, second activity remains. need go previous activity after uninstall finished uri packageuri = uri.parse("package:"+packageinfo.packagename); intent uninstallintent = new intent(intent.action_delete, packageuri); startactivity(uninstallintent); update first activity (firstactivity.java) firstactivity.java use startactivityforresult (uninstallintent, 1); //1 request_code after unintalling app, firstactivity.onactivityresult automatically called, can use method something. @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if (requestcode == 1) { if (resultcode == result_ok) { // un-installed finish(); } else { // failed un-install } } }

Generating map tiles (dynamically?) from SQL/CSV data -

here's have: sql table/csv file "tile xyz" coordinates (web mercator tile coordinates) , "data/color" x y z color 13 13 5 yellow 13 14 5 green 13 14 5 red ... data structure easy, no fancy stuff needed, can draw pngs code. amount of data large, i.e. worldwide tiled, zoomlevel 15 what want: png tiles underlying data should not accessible show png tiles webpage map of leaflet/google maps api problem/question: too data generate tiles worldwide before (takes days) i therefore thinking dynamic caching/tile creation algorithm (maybe create zoomlevel 0-9 before, higher zoom levels created dynamically) it seems there many tools out there (tilemill, tilestache, arcgis server, etc) of them seem have high learning curve or meant more complex tasks. is there way run lean server fits needs? maybe php script queries database, draws png , feeds map on-demand? how work exactly? clever solution? thanks much. i

python - Difference between paInt32, paInt16, paInt24, paFloat32, etc.? -

i using python 2.7.12 on ubuntu 16.04 lts while trying (learning) pyaudio module. have mention type of format should require recording audio microphone. know difference between papaint32,paint16,paint24,pafloat32,paint8,pauint8 and when use each format. trying (learning) pyaudio python pyaudio.pyaudio examples . portaudio supports audio input , output in variety of sample formats: 8, 16, 24 , 32 bit integer formats , 32 bit floating point, irrespective of formats supported native audio api. a type used specify 1 or more sample formats. each value indicates possible format sound data passed , stream callback, pa_readstream , pa_writestream. reference the standard formats pafloat32, paint16, paint32, paint24, paint8 , auint8 implemented implementations. the floating point representation (pafloat32) uses +1.0 , -1.0 maximum , minimum respectively. pauint8 unsigned 8 bit format 128 considered "ground" the panoninterleaved flag indicates audio data pas

javascript - Dispatch and setState not working together, but are on their own -

i have datepicker component, when click on new date should set change date in redux store, , visibly ux-wise. i'll put code down below, reason in handlechange function, both setstate , this.props.addfitler there firing off, redux store updates correctly ux doesn't. if comment out this.props.addfilter dispatch function, ux update correctly (and store doesn't). why aren't both of these working together? i've tried changing order in they're called, extracting each function, using mapdispatchtoprops instead of calling action creator directly, no avail. datepicker.js: import datepicker 'react-datepicker'; class datepick extends react.component { constructor(props) { super(props); this.state = { date: moment() }; this.handlechange = this.handlechange.bind(this); } handlechange(date) { const { dashboardname } = this.props; const { name } = this.props.column; this.props.addfilter(date, dashboardname, name

android - Can't set height and width of Popup Window -

Image
i made layout popup window , when click on button display popup window doesn't show popup dialog correctly , partial view seen this when click on 3 dots. i want popup display this when click on 3 dots. here code. layoutinflater layoutinflater = (layoutinflater)getbasecontext() .getsystemservice(layout_inflater_service); final view popupview = layoutinflater.inflate(r.layout.custom_dialog, null); final popupwindow popupwindow = new popupwindow( popupview, windowmanager.layoutparams.wrap_content, windowmanager.layoutparams.wrap_content); imagebutton gmail= (imagebutton) popupview.findviewbyid(r.id.gmail); gmail.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v)

java - Cannot find image in table in Selenium -

can help, cannot find image in table javascript , if finds should browse webpage. , how can see println output in intellij, because didn't find output associated println. webelement image = driver.findelement(by.xpath("//img[@src='http://m.com/en/images/common/green_check.png']")); boolean imagepresent = (boolean) ((javascriptexecutor)driver).executescript ( "return arguments[0].complete && type of arguments[0].naturalwidth != \"undefined\" && arguments[0].naturalwidth > 0", image ); if (!imagepresent) { system.out.println("image isn't displayed."); } else { driver.get("https://www.google.de/?gfe_rd=cr&ei=rkxawnspiexjxrnzgyal&gws_rd=ssl"); } the html here: <tr> <td> person home assignments? </td>

json2html - Why is thing displaying to the page with this code? -

my json good. i've followed simple example json2html site ... nothing displays. <script type="text/javascript"> $.getjson( "news/list/category/news/format/json", function(data) { var transforms = { stories: [ {'<>':'ul','class':'stories','html':function() { return($.json2html(this.groups,transforms.group)); }} ], group: [ {"<>": "li", "id":"id", "html":[ {"<>": "span", "html": "${author} ${headline}"} ]} ] }; $('#stories').json2html(data, transforms.stories); }) </script> firstly if paste actual json in question go along way helping figure out issue. this you're going wrong stories: [ {'<>':'ul','class':'stories','html':function() { ret

Opera Mini social login issue with loginradius.com -

we working on react application(voot.com) , live mobile. live url: https://m-origin.voot.com we facing many issues opera mini , 1 of them is: we not able social login using loginradius.com. when click on 'continue facebook', app redirects loginradius.com third party. din't response our server loginradius that's why user not logged in social login. we using js file loginradius coming http://cdn.loginradius.com/hub/prod/js/custominterface.2.js . we have written callback funtion expecting loginradius return callback. callback function not calling in opera mini browser rest browsers working fine. look opera mini open popup (as new tab because of mobile browser). recommendation not open new window in case of mobile devices. follow steps fix problem 1.add template page <script id="loginradiuscustom_tmpl_mobile" type="text/html"><div class="<%=name%>"> <a class="anchor_<%=name%>" href

java - TestNG Reporting, how to quickly identify Retry-d Tests? -

hello: when @test fails , retry happens, there direct way in testng distinguish between test has been retried , test has not been retried - such through ng context method or variable? case 1: if test not been retried 1st test test has not been retried. case 2: if test has been retried 2 times 3rd test test has not been retried. some options have found such http://www.seleniumeasy.com/testng-tutorials/retry-listener-failed-tests-count-update - wanted check if community has other means and/or recommendations. you can try this. idea retrieve retry analyser instance associated particular test method , query retry count. if retry count greater zero, method retried. import org.testng.assert; import org.testng.iretryanalyzer; import org.testng.itestcontext; import org.testng.itestresult; import org.testng.testlisteneradapter; import org.testng.annotations.listeners; import org.testng.annotations.test; import java.util.hashset; import java.util.set; import java.util

logging - Spring boot app is not starting due to Failed to instantiate SLF4J LoggerFactory -

i getting error spring boot application. how fix ? there log4j integration ? my error log failed instantiate slf4j loggerfactory reported exception: java.lang.noclassdeffounderror: ch/qos/logback/core/joran/spi/joranexception @ org.slf4j.loggerfactory.bind(loggerfactory.java:150) @ org.slf4j.loggerfactory.performinitialization(loggerfactory.java:124) @ org.slf4j.loggerfactory.getiloggerfactory(loggerfactory.java:412) @ org.slf4j.loggerfactory.getlogger(loggerfactory.java:357) @ org.apache.commons.logging.impl.slf4jlogfactory.getinstance(slf4jlogfactory.java:155) @ org.apache.commons.logging.impl.slf4jlogfactory.getinstance(slf4jlogfactory.java:132) @ org.apache.commons.logging.logfactory.getlog(logfactory.java:273) @ org.springframework.boot.springapplication.<clinit> check project spring framework release matching release of spring framework using. <parent> <groupid>org.springframework.boot</groupid>

apache spark - Structured Streaming 2.1.0 stream to Parquet creates many small files -

i running structured streaming (2.1.0) on 3-node yarn cluster , stream json records parquet. code fragment looks this: val query = ds.writestream .format("parquet") .option("checkpointlocation", "/data/kafka_streaming.checkpoint") .start("/data/kafka_streaming.parquet") i notice creates thousands of small files 1,000 records. suspect has frequency of trigger. changed it: val query = ds.writestream .format("parquet") .option("checkpointlocation", "/data/kafka_streaming.checkpoint") .**trigger(processingtime("60 seconds"))** .start("/data/kafka_streaming.parquet") the difference obvious. can see smaller number of files created same number of records. my question: there way have low latency trigger , keep smaller number of larger output files?

c# - Delete cascade on two 1:M foreign keys from same parent -

here 2 tables in visual studio 2015 project table 1: create table [dbo].[player] ( [id] int identity (1, 1) not null, [first_name] nvarchar (50) null, [last_name] nvarchar (50) null, [nickname] nvarchar (50) not null, primary key clustered ([id] asc) ); and table 2: create table [dbo].[match] ( [id] int identity (1, 1) not null, [time] time (7) null, [winner_id] int not null, [loser_id] int not null, [tournament_id] int not null, primary key clustered ([id] asc), constraint [fk_player_winner] foreign key ([winner_id]) references [dbo].[player] ([id]), constraint [fk_player_loser] foreign key ([loser_id]) references [dbo].[player] ([id]), constraint [fk_match_tournament] foreign key ([tournament_id]) references [dbo].[tournament] ([id]) ); what want add on delete cascade on foreign keys in match table, unable create delete cascade on player foreig

twitter bootstrap 3 - Sublime Project, file path in mac -

i have created project in sublime "osx" in demo.sublime-project file have include file path save output of file in folder code is: { "folders": [ { "path": "/applications/xampp/xamppfiles/htdocs/mywebsite" } ], "settings": { "less2css": { "lessbasedir": "/assets/less", "outputdir": "./bootstrap-custom/css", "main_file": "custom.bootstrap.less", "minify": true } } } note : assets folder included inside mywebsite folder "the main project folder" , less , bootstrap-custom folder included inside assets. need save output files in bootstrap-custom/css. when hit cmd+s shows these 2 errors "unable save /applications/xampp/xamppfiles/htdocs/mywebsite/less/custom.variables.less error: no such file or directory" , "lessc: enoent: no such file or directory, open '/applica

r - Importing CSV data from UN database -

i'm trying import refugee data unhcr http://popstats.unhcr.org/en/time_series i export data , try import using read.csv function i've never had problems using before , receive following error code un <- read.csv("un.csv", na.strings = "..") error in read.table(file = file, header = header, sep = sep, quote = quote, : more columns column names for ref i've opened csv file in word , format in; ""extracted unhcr population statistics reference database","united nations high commissioner refugees" "date extracted: 2015-09-18 04:37:24 +02:00" year,"country / territory of asylum/residence",origin,"population type",value 1951,australia,various/unknown,"refugees (incl. refugee-like situations)",180000 1951,austria,various/unknown,"refugees (incl. refugee-like situations)",282000 1951,belgium,various/unknown,"refugees (incl. refugee-like situations)",55000 19

How do I get the data of a related object to my view? CakePhP -

i'm trying text view doesn't seem work out. in wepagescontroller.php have function aboutus.ctp: public function aboutus() { // load website base-layout $this -> layout = 'website'; // load relevant models $this -> loadmodel('contentitem'); //query 2 contentitems $aboutusinfos = $this->contentitem->find('first', array('conditions' => array('contentitem_slug' => 'lorum'))); debug($aboutusinfos); $aboutuspersons = $this->contentitem->find('first', array('conditions' => array('contentitem_slug' => 'robotics'))); debug($aboutuspersons); //set 2 contentitems $this->set('aboutusinfos', $this->contentitem->find('first', array('conditions' => array('contentitem_slug' => 'lorum')))); $this->set('aboutuspersons', $this->conten

How to track application usage in weekly,monthly and yearly in android -

Image
i working on android application. want track application usage don't know how implement it. you can try integrate firebase analytics app chech this link more informatoin of provides , how implement

mongodb - Invalid mongo configuration, either uri or host/port/credentials must be specified -

i'm getting exception : caused by: java.lang.illegalstateexception: invalid mongo configuration, either uri or host/port/credentials must specified @ org.springframework.boot.autoconfigure.mongo.mongoproperties.createmongoclient(mongoproperties.java:207) @ org.springframework.boot.autoconfigure.mongo.mongoautoconfiguration.mongo(mongoautoconfiguration.java:73) @ org.springframework.boot.autoconfigure.mongo.mongoautoconfiguration$$enhancerbyspringcglib$$15f9b896.cglib$mongo$1(<generated>) @ org.springframework.boot.autoconfigure.mongo.mongoautoconfiguration$$enhancerbyspringcglib$$15f9b896$$fastclassbyspringcglib$$c0338f6a.invoke(<generated>) @ org.springframework.cglib.proxy.methodproxy.invokesuper(methodproxy.java:228) @ org.springframework.context.annotation.configurationclassenhancer$beanmethodinterceptor.intercept(configurationclassenhancer.java:356) @ org.springframework.boot.autoconfigure.mongo.mongoautoconfiguration$$enhancerbysp

How to get the individual decode value in Sybase SQL? -

i'm working in sybase database.i want same thing 'decode' function in oracle.to achieve i'm using 'case' function in current project.'decode' not working in sybase database. country varchar data type. when i'm running "select country database ", getting country code accordingly below.i want replace country code alias country name.how can achieve this note - can't modify database. case when country='23077' 'india' when country='23078' 'australia' when country='23079' 'usa' when country='23080' 'france' when country='23082' 'spain' when country='23083' 'uk' when country='23084' 'germany' when country='23085' 'china' else 'does not exist' end country, note :- query running without error table's rows displays, not data. in advance.

javascript - Jquery-Ui Dialog form for each button in a dynamic table -

i generating html table button each row have open jquery ui dialog form. //the table <table class="table table-reporting table-condensed table-striped" id="tableoperator"> <tbody> @for (int h = 0; h < model.tolist().count; h++) { <tr> <td class="hidden-phone hidden-tablet"> <button class="update" id="@model.elementat(h).id">update</button> </td> </tr> } </tbody> </table> //the dialog form <div id="dialog-form" title="update ticket" > <form> <fieldset> <label for="state">state</label> <input type="text" name="state" id="state" class="text ui-widget-content ui-corner-all"> <label for="note">

c# - Datetime to string: differents behavior depending on the converted datetime -

Image
i use c# code convert datetime string: mydatetime.tostring("dd/mm/yyyy hh:mm") it works, not every time. mean? if input datetime is, example, 2016-10-19 17:27:41.727 , string expected, 19/10/2016 17:27 . if day in datetime (and/or month) has 1 digit, weird. if input 2016-01-07 14:58:13.560 , 1/7/2016 , if 2016-10-26 17:14:16.000 10/6/2016 . do know why? how can set leading 0 days , months 1 digit? and, further, why don't see time part in date wrote examples? update . some datetime fields sql server database (this sql server management studio). most datetime has invalid value (day , month mixed) new datetime(2016, 01, 07,14,58,13,56).tostring("dd/mm/yyyy hh:mm") returns 07-01-2016 14:58 . take how read datetime value database. believe problem there. (for example sqldatareader.getdatetime )

gcc - Export preprocessor macro in makefile -

i want export preprocessor macro internal makefile main makefile in particular target. example: main_makefile target1 : cxxflags+=-dnewflag=newflag cd some_directory; make here want use value of cxxflags -dnewflag=newflag , defined under target1 in some_directory/make please let me know how can achieve this. there no way append variable command line, unless you've made arrangements in makefile of subdirectory. the simplest thing use different variable, this: target1: cd some_directory && $(make) extra_cxxflags=-dnewflag=newflag (note should always use $(make) or ${make} when invoking sub-make, never make directly.) then in subdirectory makefile this: cxxflags += $(extra_cxxflags)

google cloud platform - Error: Status 403 trying to pull repository. kubernetes 1.5.4 specific -

i have 2 gce clusters, have identical configuration, difference kubernetes node version: 1.4.7 vs 1.5.4. deployment on first cluster starts, fails on second status 403. here output of describe 1.5.4 pod: name: essence-elasticsearch-2766004759-lr5wf namespace: default node: gke-nts-elastic-test-default-pool-115230a1-p17s/10.128.0.2 start time: tue, 28 mar 2017 16:25:00 +0300 labels: app=essence-elasticsearch-app pod-template-hash=2766004759 status: pending ip: 10.104.0.9 controllers: replicaset/essence-elasticsearch-2766004759 containers: essence-elasticsearch: container id: image: gcr.io/en-development/essence-elasticsearch:f7bc95c_2e7df37_50683bc_d6e8032 image id: port: 9200/tcp requests: cpu: 100m state: waiting reason: imagepullbackoff ready: false restart count: 0 volume mounts: /var/run/secrets/kubernetes.io/serviceaccount default-token-s0r

ios - Mapping Firebase lists to objects with Mantle -

i'm looking effective way map firebase lists custom objective-c objects mantle. firebase doesn't have concept of arrays, every item in list has explicit id. list in firebase of type event appears this: "events": { "id0": { "name": "event 1", "date": "2017-03-28t08:00:00+00:00", "venue": "venue 1" }, "id1": { "name": "event 2", "date": "2017-03-29t08:00:00+00:00", "venue": "venue 2" }, ... "id5": { "name": "event 6", "date": "2017-04-05t08:00:00+00:00", "venue": "venue 6" } } in objective-c terms, translates nsdictionary, it's easier work nsarray in uitableviewcontroller. @ moment i'm using nsdictionary each event, , moving event's key inside d

remove a particular custom post type slug from the url in wordpress -

how remove particular custom post type slug url in wordpress 4.7 here link http://dmstage.com/gardencity/projects/bridge-construction/ but need should come http://dmstage.com/gardencity/bridge-construction/ the projects should removed link..i tried rewrite in functions.php..but couldnot correct way it.. thanks in advance.. try creating function : function na_remove_slug( $post_link, $post, $leavename ) { if ( 'events' != $post->post_type || 'publish' != $post->post_status ) { return $post_link; } $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link ); return $post_link; } add_filter( 'post_type_link', 'na_remove_slug', 10, 3 );

file permissions - How to get a DocumentContract using Android Storage Access Framework -

i trying implement saf in app. have managed copy music files external sdcard using following: intent intent = new intent(intent.action_open_document_tree); startactivityforresult(intent, request_code_open_directory); which brings file/folder picker to copy: private string copyfile(string inputpath, string inputfile, uri treeuri) { inputstream in = null; outputstream out = null; string error = null; documentfile pickeddir = documentfile.fromtreeuri(getactivity(), treeuri); string extension = inputfile.substring(inputfile.lastindexof(".")+1,inputfile.length()); try { documentfile newfile = pickeddir.createfile("audio/"+extension, inputfile); out = getactivity().getcontentresolver().openoutputstream(newfile.geturi()); in = new fileinputstream(inputpath + inputfile); byte[] buffer = new byte[1024]; int read; while ((read = in.read(buffer)) != -1) { out.write

keras - What should the generator passed to predict_generator() return? -

i calling keras predict_generator() like: bottleneck_features_train = model.predict_generator(train_gen, len(telemetry)) where train_gen() defined like def train_gen(): # ... yield (x, y) and x numpy array shape (48, 299, 299, 3), y numpy array shape (48,) i error below. should instead? otherwise, link working example help. examples have found keras 1 or using imagedatagenerator.flow() . i running keras 2.0.2. here error: traceback (most recent call last): file "/home/fanta/workspace/carnd-behavioral-cloning-p3/cache.py", line 143, in <module> tf.app.run() file "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) file "/home/fanta/workspace/carnd-behavioral-cloning-p3/cache.py", line 138, in main bottleneck_features_train = model.predict_generator(train_gen, len(telemetry)) file "/usr/local/lib/python3.5/

How do I change the time zone of a Google Cloud Windows Server 2016 VM? -

Image
when try change time zone of windows server 2016 vm on google cloud platform permissions error. user has full admin privileges. possible? you need change timezone through server manager, not control panel. nothing gcp.

graph - R Programming- Used customising package ggfortifty on plot -

Image
hi created time series in r , used ggfortify make pretty. it uses function called autoplot wish change axis , title names, unsure how to. salesarmaplot <-arima(sales, order = c(1,1,1)) finalforecast <-forecast(sales, x=banter, y= banter,armaplot,h=8) autoplot(finalforecast) the image attached shows plot. try using following parameters inside autoplot function xlab = "x_label", main = "title", ylab = "y_label"

clang - How to write the result of an inline assembly instruction to LLVM register? -

suppose i've instruction following: %2 = call i32 asm sideeffect "addl %ebx,%eax;\0a", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1) #2, !srcloc !1 now, i'd result of addl being moved to, e.g., llvm register called %foo . how that?

.net - tcpClient.State analogue in vb.net (versus vb6.0) -

i used next code in vb6.0 winsock object tcpclient: dim sconst(10) string dim st integer sconst(0) = "closed" sconst(1) = "open" sconst(2) = "listening" sconst(3) = "connectionpending" sconst(4) = "resolvinghost" sconst(5) = "hostresolved" sconst(6) = "connecting" sconst(7) = "connected" sconst(8) = "closing" sconst(9) = "error" st = tcpclient.state textbox1.text = sconst(st) now im using vb.net , want same. there no .state method tcpclient objects! there cpclient.connected returns boolean yes or not. how can alike vb6.0? using visual vinsent's answer made this: public class form1 dim status1 string dim status2 string private sub btn_connect5001_click(sender object, e eventargs)_ handles btn_connect5001.click ' create tcpclient , connect tcpclnt2 = new tcpclient try tcpclnt2.connect("19

servlets - How do you retrieve multipart POST request in Java SE 8? -

java se 8 comes servlet spec 3.0 thought easy process multipart post request, wrong. i 0 parts, although see in chrome network debugger payload contains 2 images! what doing wrong? here java code processing post request: if (request.ismultipartrequest()) { collection<part> parts = request.getparts(); log.info("number of parts: "+parts.size()); (part part : parts) { string filename = getfilename(part); log.info("filename = "+filename); } } ... private string getfilename(part part) { string contentdisp = part.getheader("content-disposition"); system.out.println("content-disposition header= "+contentdisp); string[] tokens = contentdisp.split(";"); (string token : tokens) { if (token.trim().startswith("filename")) { return token.substring(token.indexof("=") + 2, token.length()-1); } } return ""; } it logs 0 parts. i'm

angular - Sort PrimeNG DataTable by radio-button column -

my primeng datatable in selectionmode='single' , , therefore shows column radio-buttons in it. when 1 of radio-buttons clicked, how can move/sort selected row top of table? the following code doesn't work: <p-datatable [value]="items" [selection]="selected" [globalfilter]="globalfilter" (onrowselect)="rowselect($event)" (onrowunselect)="rowunselect($event)"> <p-column field="name" header=""></p-column> <p-column selectionmode="single" [sortable]='true'></p-column> </p-datatable> rather odd functionality, has been required client.

swift - conflict with previous value in same-name Shadowing -

Image
this question has answer here: when did `guard let foo = foo` become legal? 1 answer why isn't guard let foo = foo valid? 1 answer i'm reading erica sadun's swift style book , playing around code. she suggests: prefer using same-name shadowing in conditional bind. “this approach both conventional , safe: guard​ ​let​ x = x { ... } ​// yes​ guard​ ​let​ y = x { ... } ​// no​ deliberate same-name shadowing ensures the unwrapped value’s role follows logical intent established name prior if or guard statement. introducing new name blurs line of semantics , can prove dangerous. consistent same-named shadowing prevents adding unintentional shadow symbols in parent scope. regardless of being opinion or not: in code, i'm trying do: guard

Unable to find a specification for 'Firebase' (IOS Swift) -

i adding cocoa pods ios project (swift). have initalized pods in project directory using 'pod init myproject.xcodeproj'. added pod 'firebase' podfile such: project 'hots ios.xcodeproj/' platform : ios, '9.0' target 'hots ios' use_frameworks! pod 'firebase' target 'hots iostests' inherit! :search_paths pod 'firebase' end target 'hots iosuitests' inherit! :search_paths pod 'firebase' end end now when run pod install error: unable find specification 'firebase'. depending on firebase service want use have add different firebase services in podfile. "'firebase'" not valid pod. pod 'firebase/core' basic , give prerequisite libraries needed firebase running. if want use other services can choose between these pods: pod 'firebase/core' --> prerequisite libraries , analytics pod 'firebase/admob' -->

java - IBM MQ Open input count shows 2 for websphere MDB with max sessions 1 (Causing reordering of messages) -

Image
my issue similar : spring jms - ibm mq has open input count issue i have set message driven bean have max-sessions 1 sequential message delivery in websphere. assume 1 connection should open queue. see open input count 2 times. times 2 different process in picture, same. normal behavior of websphere? please advise. investigating messsage re-ordering issue, of great help. websphere version 8.5.1 , ibm mq version 7.0 mdb configured via activation spec the 2 instances queue opened different 1 has queue opened browsing , other has open destructive gets. don't see how having opened twice these affect ordering of messages. mq doesn't guarantee ordering of messages default. if message ordering important should use message groups, explicitly define ordering of messages in mqmd of each message. without message groups need meet number of requirements assume message ordering kept mq.

Java: "for" change condition? -

while(result.length() != alltext){ b = (boolean)(i < variable); for(i = firstr; b; i++){ //do } b = (i < variable); } am can change condition boolean? in code b = condition converted true or false . want keep condition . this: b = (boolean)(i < variable); does not mean value of b "binds" condition i < variable . i.e. not mean when i changed value larger variable , b 's value change. b assigned once. you either put i < variable in loop condition, or can use lambda (predicate): // assuming int intpredicate b = x -> x < variable; // change loop for(i = firstr; b.test(i) ; i++){ if don't know lambdas are, represent anonymous classes. lambda expression in above code represents anonymous class: new intpredicate() { public boolean test(int x) { return x < variable; } } imo, should not use predicate. write condition should be. way easier understand loop in form: for (i = x ; < y

javascript - PHP Ajax: Perform action when database is updated -

what want is, when new comes database, gets latest value entered , plays specific song depending on says. for example, on computer, run website. else around world picked phone , clicked play song, song automatically play on devices running page. when chooses new song, song should change. i have made several tries @ this, trying use setinterval in javascript updates , updates time expect. i guess looking way track when database has been updated, solutions or code examples can use? if understand right, can use push notifications. https://firebase.google.com/docs/notifications/ here's tutorial how set js client https://firebase.google.com/docs/cloud-messaging/js/client in case won't have unnecessary requests server fetch updated. send push notification client , necessary actions on client side.

mongodb - Can't run mongod ***aborting after fassert() failure on mac -

i working through mongodb installation video on mongodb university. https://www.youtube.com/watch?v=_wj8m5qhvwc mac user , encountered problem when tried run mongod command first time. new mongodb user , appreciate this. thank you. edit: first step took finding download page on google. selected first organic link. did not download cloud service. downloaded , installed onto machine. downloaded recent production version. used mac download. next, after downloading, went downloads directory in terminal untar file tar xvf mongodb-osx-ssl-x86_64-3.4.3.tgz that expanded tarball. entered directory using cd mongodb-osx-ssl-x86_64-3.4.3 and looked around. saw licence, readme, , bin directory. i went bin directory. cd bin next, looked inside bin directory ls -l i saw bunch of mongo programs. in here found mongo (shell) , mongod (server). understand server put data in /data/db default. next proceeded make directory. went root in order running sudo bash i ran mkdi

Hadoop command fails with python3 & works with python 2.7 -

i have macbook pro & have installed hadoop 2.7.3 on following : https://www.youtube.com/watch?v=06hpb_rfv-w i trying run hadoop mrjob command via python3 & giving me error:. bhoots21304s-macbook-pro:2.7.3 bhoots21304$ python3 /users/bhoots21304/pycharmprojects/untitled/mrjobs/mr_jobs.py -r hadoop /users/bhoots21304/pycharmprojects/untitled/mrjobs/file.txt no configs found; falling on auto-configuration looking hadoop binary in /usr/local/cellar/hadoop/2.7.3/bin... found hadoop binary: /usr/local/cellar/hadoop/2.7.3/bin/hadoop using hadoop version 2.7.3 looking hadoop streaming jar in /usr/local/cellar/hadoop/2.7.3... found hadoop streaming jar: /usr/local/cellar/hadoop/2.7.3/libexec/share/hadoop/tools/lib/hadoop-streaming-2.7.3.jar creating temp directory /var/folders/53/lvdfwyr52m1gbyf236xv3x1h0000gn/t/mr_jobs.bhoots21304.20170328.165022.965610 copying local files hdfs:///user/bhoots21304/tmp/mrjob/mr_jobs.bhoots21304.20170328.165022.965610/files/... running step 1 of