Posts

Showing posts from June, 2015

kubernetes - Cluster-insight on Google Container Engine -

hi trying enable graph tab in kubernetes ui on gke. there way enable on gke ? the instructions on cluster insight page (which linked to) explain how deploy graph service cluster , access interface using kubectl proxy , web browser.

SAS Macro quoting issues -

i trying perform operations on binary data saved macro variable. datastep below saves data macro variable without issues: data _null_; infile datalines truncover ; attrib x length=$300 informat=$300. format=$300.; input x $300.; put x=; call symput ('str',cats(x)); datalines4; ‰png > ihdr ) ) ëŠz srgb ®ÃŽ=é gama ±^üa phys ;à ;ÃÇo¨d zidat8oåŒ[ À½Ã¿¥Ã“¼”Ö5dˆ_v@aw|+¸anÅ ‡;6<ÞórÆÒÈefõu/'“#f™Ã™÷&É|&t"<ß}4¯Ã 6†Ã‹-Å’_È(%<É'™Ã¨nß%)˜ÃŽ{- iend®b`‚ ;;;; run; when try , use contents of macro variable in way, combinations of reserved characters making impossible work with. following reserved characters in value, , not matched: &%'"() i've tried every combination of macro quoting functions can think of , can't value print using %put() : %put %nrbquote(&str); results in: symbolgen: macro variable str resolves ‰png > ihdr ) ) ëŠz srgb ®ÃŽ=é gama ±^üa phys

Accessing a Flexible array Member in C -

i have struct looks this: typedef struct testcase testcase; typedef struct testcase { char * username; testcase *c[]; // flexible array member } testcase; and in file i'm trying set flexible array member null, doesn't seem work (i'm not allowed change how it's been defined) void readin(file * file, testcase ** t) { *t = malloc(sizeof(testcase)); (*t)->c = null; //gives error } i'm using double pointers because that's what's been specified me (this isn't entire code, snipit). (as there code later free variables allocated). any appreciated. take @ line: (*t)->c = null; this tries assign null array, isn't allowed. writing this: int array[137]; array = null; // not allowed when have flexible array member, intent when malloc memory object, overallocate memory need make room array elements. example, code *t = malloc(sizeof(testcase) + numarrayelems * sizeof(testcase*)); will allocate new t

Press Home button in Appium Java client -

i new appium. might silly question. wanted know how click home button using java bindings. thanks in advance well if want send app in background use driver.closeapp() function , relaunch driver.openapp() you can use press keycode method below codes home menu button - 82 button - 4 recent app - 187

php - Chat Application Database Query and Design -

this database scheme query below. this scenario confuses me. when login user_id = 1 , create conversation , receiver user_id = 4 query below works.. because query retrieve conversations based on sender. when log in user_id = 4 can't see conversation because i'm receiver , don't want create conversation i'm sender , receiver user_id = 1 because conversation started user_id = 1. can me query? change inner join include receiver well, so inner join conversations on (userprofiles.user_id = userprofiles.receiver_id or userprofiles.user_id = sender_id)

css - OpenSans Semibold Normal displayed as Italic -

Image
i have problem open sans font imported google web fonts. opensans semibold (600) normal on webpages rendered in italic. tried force font-style normal etc. same results. after changing font weight 500 or 800 it's normal style. @font-face { font-family: 'open sans'; font-style: normal; font-weight: 600; src: local('open sans semibold'), local('opensans-semibold'), url(http://fonts.gstatic.com/s/opensans/v13/mtp_ysujh_bn48vbg8snsuy5mlvxtdnkpsmpkkrdxp4.woff) format('woff'); } jsfiddle even google fonts shows in italic. had same issue, conflict open sans had installed locally. try disable locally installed fonts first.

multithreading - PHP react parallel requests -

i have app communicate through websocket server. using ratchet , works perfect. next thing want implement make requests other server , push responses through websocket clients. question how make parallel requests react. let have 5 endpoints response want parallel (thread). want call each endpoint every .2s example , send response websocket server clients. example (this demonstration code): $server->loop->addperiodictimer(.2, function ($timer) { curl('endpoint1'); }); $server->loop->addperiodictimer(.2, function ($timer) { curl('endpoint2'); }); $server->loop->addperiodictimer(.2, function ($timer) { curl('endpoint3'); }); but timer not work way. possible achive react? im not showing websocket code because communication between clients works nice. to start. " react (ratchet) " - operate in 1 thread mode (feature libevent). is, block process - bad idea... curl request - stop work socket server until rec

javascript - Mapbox single marker change color onclick -

iam wondering how change marker color using onclick function. im trying achieve in way: wrong...can me?? var testmarker = l.marker([74.18, -15.56], { icon: l.mapbox.marker.icon({ 'marker-color': '#9c89cc' }) }) .bindpopup(testmarker) .addto(map); testmarker.on('click', function(e) { l.marker(setcolor('red')); use seticon method of l.marker in click handler set new icon: changes marker icon. http://leafletjs.com/reference.html#marker-seticon testmarker.on('click', function() { this.seticon( l.mapbox.marker.icon({ 'marker-color': 'red' }) ); });

css media query resolution dpi versus width versus device-width -

when comes using media queries, see max-width , max-device-width used lot target "small screen" devices, or smartphones, why not use media query resolution? for example, @media screen , (min-resolution: 230dpi) allows me write css target smartphones, such galaxy s glide sgh i927r, has 480 x 800 pixels, 4 inches (~233 ppi pixel density) conversely, have use @media screen , (max-device-width: 480px) , (orientation: portrait) plus @media screen , (max-device-width: 800px) , (orientation: landscape) . it seems min-resolution save me time. have read several articles , blogs, not see advocating resolution. there must obvious point missing - not professional web designer - "wrong" approach of using resolution? makes width or device-width better target "small screens." my favorite site far on width vs device-width has been: http://www.javascriptkit.com/dhtmltutors/cssmediaqueries.shtml maybe reason had use max-device-width of 800px, seemed &quo

java - Connecting Array Index with Linked List -

i trying implement bucket sort in java without using collections framework, on own. have problem in implementing it. i wanted store list of elements in particular array index. for ex: arr[0]={1,2,3,4}; //here array index 0 storing 4 values. so chose have linked list store values , map array index linked list. but not aware of how map array index linked list. for ex: arr[0]->linkedlist1 arr[2]->linkedlist2 // ... , on please suggest how implement it. in java, arrays or collections collection of objects of same type. so, requirement, need array of lists. list[] arrayoflists = {}; this creates array each member list (you can create array of linkedlist if like). now, create linkedlist , assign index 0 of array. linkedlist list1 = new linkedlist(); arrayoflists[0] = list1; hope helps.

python - Selecting distinct values from a column in Peewee -

i looking select values 1 column distinct using peewee. for example if had table organization year company_1 2000 company_1 2001 company_2 2000 .... to return unique values in organization column [i.e. company_1 , company_2 ] i had assumed possible using distinct option documented http://docs.peewee-orm.com/en/latest/peewee/api.html#selectquery.distinct my current code: organizations_returned = organization_db.select().distinct(organization_db.organization_column).execute() item in organizations_returned: print (item.organization_column) does not result in distinct rows returned (it results in e.g. company_1 twice). the other option tried: organization_db.select().distinct([organization_db.organization_column]).execute() included [ ] within disctinct option, although appearing more consistent documentation, resulted in error peewee.operationalerror: near "on": syntax error : am correct in

regression - using SVM to predict traffic volume -

i used svm predict traffic volume data , using tool libsvm . input data in moment t-2, t-1 , t; output data in moment t+1. param below: param.svm_type = svm_parameter.nu_svr; param.kernel_type = svm_parameter.rbf; param.cache_size = 100; param.eps = 0.00001; param.c = 1.9; param.nu = 0.5; but predict value a constant number , don't know problem. thanks.

swing - Java: mouseDragged and moving around in a graphical interface -

Image
newbie programmer here. i'm making program renders user-inputted equations in cartesian coordinate system. @ moment i'm having issues letting user move view around freely in coordinate. mousedragged user can drag view around bit, once user releases mouse , tries move view again origin snaps current position of mouse cursor. best way let user move around freely? in advance! here's code drawing area. import java.awt.color; import java.awt.graphics; import java.awt.graphics2d; import java.awt.point; import java.awt.rectangle; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import java.awt.event.mousemotionlistener; import java.awt.geom.line2d; import java.awt.geom.point2d; import javax.swing.jpanel; public class drawingarea extends jpanel implements mousemotionlistener { private final int x_panel = 350; // width of panel private final int y_panel = 400; // height of panel private int div_x; // width of 1 square private int div_y; // height of

javascript - How to change select option with jquery? -

so have table class "vuln-table" , first column full of checkboxes, while last column options i've figured out how alert box rows contain checked checkbox; however, need figure out how change value of selected option here's js file: function change_severity(severity) { $(".vuln-table tr").each(function() { $(this).find('td input:checked').each(function() { // row has checkbox selected // row needs have select value changed }); }); } here's html contains options <tr role="row" class="even"> <td class="sorting_1"><input type="checkbox" name="asfasdfd" id="vuln_checked_" value="asdfsdfa"></td> <td>something</td> <td><select class="form-control" name="test" id="kjhtkjehtehr"><option value="severe">severe</option> <optio

Firefox keeps input value on browser close and reopen -

i using input field store destination value: <input type="text" id="dest_location" placeholder="enter destination" autocomplete="off"> however want clear value on browser reload. after reading found simple way add autocomplete="off" input above. this works noticed unusual in firefox browser. when enter value input field, close browser , reopen value still saved. after clicking page reload button value cleared. i wanted know why occurring in firefox browser? tried same open , close browser method on chrome, ie , opera , value cleared before clicking on page reload button. assistance. you must have enabled saving current tab instance in firefox option "when firefox starts": "show windows , tabs last time". i've tried similar option on google chrome says "on startup":"continue left off". but chrome is, stores urls next time reopen browser whereas fi

javascript - How to auto-adjust size of other input fields while typing into input field #1? -

i working html/javascript/css page looks this, input field: (base10) [100 ] output field #1 (base08) [144 ] output field #2 (base19) [55 ] output field #3 (base36) [2s ] and trying achieve this, input field: (base10) [100 ] output field #1 (base08) [144] output field #2 (base19) [55] output field #3 (base36) [2s] with real-time adjustment "output" field sizes. brackets denote field sizes visible on screen. how code that? all 4 of lines use html input tag unique id's. in case typed "100" base10 field arbitrarily long in size, , in real time javascript updates multiple output fields number 100 written in other counting systems, , works fine, no problem there. the problem output fields pre-determined/hard-coded size, whereas contents different sizes. need size attribute of fields called #1, #2, , #3 dynamically updated in real time too, field snugly

assembly - CreateWindowEx in masm x64 -

i'm coding in assembly under windows 10 using x64 masm, , enjoying it! haven't touched assembly in 25 years - uni days. learning , doing basic stuff, , getting speed rather quickly. i have gui front-end, window, , down track have menu , child windows... the 2 traditional ways (i guess) achieve are: in assembly use createwindowex , related windows api functions, or build front-end visual c++ code masm other areas program now since i'm programming purely fun, , want stick assembly language only, first option 1 me. but read on 1 assembly forums it's not recommended build/call windows via assembly. i'm not sure why? can imagine because it's painful when compared building front-end via high level language such vc++. questions : any reason not build gui windows front-end via assembly/createwindowex...? would building windows via directx crazy idea? any other techniques build front-end using assembly only? i haven't done programmin

javascript - jsonp callback function not recognized -

Image
i've ajax called like $.ajax({ url: geturl, type: 'get', crossdomain: true, data: { url: url, token: token }, datatype: 'jsonp', jsonpcallback: "getjsonp", success: function () { /* */ }, error: function() { console.log('failed!'); } }); and jsonpcallback function function getjsonp(data) { console.log(data.content); } on dev console, see it's returned properly however still uncaught referenceerror: getjsonp not defined . how should fix this?

html - bootstrap jumbotron full width image -

i have cover on pages.. using jumbotron have full width image. leaves space on right , left side. added margin-left blank space on left gone right 1 still there. when resize browser there large space on right side. <div id="cover-success" class="jumbotron"> <div class="container"> <div class="overlay"> <div class="text-center"> <h1>success stories</h1> <h2>here of many resolved complaints.</h2> </div> </div> </div> </div> css used: #cover-success.jumbotron { background-size: cover; background-image: url('images/cover-success-stories.jpg'); position:absolute; width:100%; margin-top: -14px; margin-left: -70px; margin-right:-50px; height: 270px; } try padding too #cover-success.jumbotron { background-size: cover; background-image: url('images/cover-succes

python - malformed header from script index.py Bad header -

i want run python code in apache2(ubuntu 14.04) server. have followed these steps , getting error: step 1: configuration 1: have created directory , file under /var/www/cgi-bin configuration 2 : have edited /etc/apache2/sites-available/000-default.conf alias /cgi-bin /var/www/cgi-bin <directory "/var/www/cgi-bin"> options indexes followsymlinks execcgi addhandler cgi-script .cgi .py allow </directory> <directory /var/www/cgi-bin> options </directory> step 2: and python script is: index.py #!/usr/bin/env python import cgi; import cgitb;cgitb.enable() print "content-type: text/plain\n" print "<b>hello python</b>" step 3: when ran through chrome browser using: url : http://localhost/cgi-bin/index.py step 4: i getting error in error-log malformed header script 'index.py': bad header: hello python you should end header \r\n, must print out yet \r\n signal body coming. (i

javascript - Input PHP content into a CSS Selector Using Ajax/jQuery -

i'm creating script has needle points various degrees , needs change dynamically. number of degrees needs move located in degrees.php (in page number) trying grab contents of degrees.php , input css selector move needle right direction. what have far, below jquery grabs content wind.php has number (139) example , loads div id #windraw. i've got setting interval keep grabbing content page , updating css on fly content changes. loading div id tag and.... part i'm stuck on, getting content #windraw css selector "rotate" ( https://github.com/jcubic/jquery.rotate ) jquery: <script> $(document).ready(function() { clearinterval(refreshid); $("#windraw").load("../raw/wind.php"); }); $(document).ready(function() { refreshid = setinterval(function() { $("#windraw").load("../raw/wind.php"); $('#winddirneedle').css('rotate', $"#windraw"); }, 5000); })

javascript - How To Include a google apps script in a html page,that has uploading functionality on google Drive -

i want collect files users (like resume) & store on google drive. working file google apps script below.i want add form html page. provided google form url https://script.google.com/macros/s/akfycbx8w-um_piwx8a1s_3r2crsyhqqylf6tyyjoquuhdft5jqbfp0/exec want add in shouttoday.com site's page. tried include js script,or iframe not working. there files --- server.gs function doget(e) { return htmlservice.createhtmloutputfromfile('form.html'); } function uploadfiles(form) { try { var dropbox = "student files"; var folder, folders = driveapp.getfoldersbyname(dropbox); if (folders.hasnext()) { folder = folders.next(); } else { folder = driveapp.createfolder(dropbox); } var blob = form.myfile; var file = folder.createfile(blob); file.setdescription("uploaded " + form.myname); return "file uploaded " + file.geturl(); } catch (error) { return error.tostring();

jquery - Bootstrap 3 sticky footer reval z-index issue -

Image
hello community [solved] sake of readability below provided steps i'm trying achieve result (see following demo , scroll bottom of page) http://iainandrew.github.io/footer-reveal/ you'll see footer reveal unveil gets uncovered below last section this source of useful script https://github.com/iainandrew/footer-reveal unfortunately i've tried find solution make working in bootstrap 3 basic page (header, main, footer), looks there need of trick make z-index work properly. i've tried hard find it, i'm in loop i'm surely blind see :-) if stand in front of me :-) this test page as can see, footer on top of content despite z-index value -101. can kindly make work? thank you [solution] main issue caused absence of background in main , missing container i've added 1 div i've called wrapper the wrapper div starts right after body tag , closes right before footer i gave wrapper solid white #fff background this allows nice sc

android - The cut/copy/selectall bar dissapears when click on SELECT ALL button -

i have multi lines edittext: <edittext android:id="@+id/et1" android:imeoptions="actiondone" android:layout_width="300sp" android:layout_height="90sp" android:layout_margintop="5dp" android:layout_marginleft="5dp" android:layout_marginbottom="5dp" android:background="@drawable/edittext_bg_white" android:ems="10" android:inputtype="textmultiline" android:lines="8" android:minlines="6" android:textsize="18sp" android:layout_gravity="left" android:gravity="top|left" /> i add text of 4 lines inside edittext. i double click on text , cut/copy/selectall bar shows. i click on select icon in cut/copy/sel

android namevaluepair alternate methods -

this question has answer here: namevaluepair deprecated openconnection 7 answers in andorid namevaluepair , basicnamevaluepair deprecated. have list<namevaluepair> pairs = new arraylist<namevaluepair>(1); pairs.add(new basicnamevaluepair("student",string1)); what alternative code? try using list of pair objects, code below this answer : list<pair<string, string>> params = new arraylist<>(); params.add(new pair<>("username", username)); params.add(new pair<>("password", password));

c - Comments(/*...*/) longer than one line -

i supposed count /*...*/ comments in file , wondering if code right or missing out? my code void commentslongerthanoneline(file* inputstream, file* outputstream) { int count = 0, c, state = 1; while ((c = fgetc(inputstream) != eof)) { switch (state) { case 1: switch (c) { case '/': state = 2; break; } break; case 2: switch (c) { case '/': state = 3; break; case '*': state = 4; break; default: state = 1; } break; case 3: switch (c) { case '\n': state = 1; break; default: state = 4; count++; } break; case 4:switch (c) { case'*': if (c == '\n') count++; break; default: state = 4; if (c == '\n') count++; } } } fprintf(outputstream, "c

java - SharedPreferences is not changing -

i have activity shows simple 2 textviews, , text string array located in class. trying load first string in array when loading, , change next time activity loading change value in textview string after string showed first on textview, , on. change value of sharedprefrences still shows me first string. problem? change value of index of string array, still shows me first string. in advanced. public class dailymessage extends appcompatactivity { public sharedpreferences startexplepref; string[] descs; string[] titles; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_daily_message); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); string currentdatetimestring = dateformat.getdatetimeinstance().format(new date()); startexplepref = preferencemanager.getdefaultsharedpreferences(this); boolean isfirstrun = startexplepref.getboolean(&qu

backbone.js - call route inside of a view in Backbone -

i know there great deal of tutorials/information orgaising application using backbone.js out there. creating gradually 1 aid of tutorials. seem fail understanding concept of routers. well, aware routers starting point(and tells state of app) , it's better avoid putting more logic there. i have 1 router. app firstly load header, footer, , main part of page. in main part, first, should login user. load login page, this: var approuter = backbone.router.extend({ initialize : function() { var headerview = new headerview({el:$('#header')}); headerview.render; var footerview = new footerview({el:$('#footer')}); footerview.render; var loginview = new loginview({el:$('#login')}); loginview.render; }, routes : { "inbox" : "inbox", "sentbox : "sentbox" }, inbox : function() {

angularjs - How would i create a promise function in this situation with javascript -

im building app using angularjs , using mediafire javascript sdk tasks. now i'm in situation when upload happens need create folder, function returns 'folderkey'. keep code clean in controller use .then on service functions continue through process of uploading new file. i have done fair bit if research still left baffled how it. perhaps example in situation me understand needs done. currently run function service create folder. mediafireservice.createfolder('testfolder'); i have mediafireservice.createfolder('testfolder'); .then(function(folderkey){ //upload file folder }); here factory functions. function createfolder(foldername){ var options = { foldername: foldername }; login(function(){ app.api('folder/create', options, function(data) { console.log(data.response.folderkey); return data.response.folderkey; }); }); } function login(callback){ app.lo

raspberry pi - python read file to turn on LED -

i'm trying python script read contents of text file , if it's 21 turn on led if it's 20 turn off. script prints out contents of text file on screen. the contents print out works ok led not turn on. import wiringpi2 import time wiringpi2.wiringpisetupgpio() wiringpi2.pinmode(17,1) while 1: fh=open("test1.txt","r") print fh.read() line = fh.read() fh.close() if line == "21": wiringpi2.digitalwrite(17,1) elif line == "20": wiringpi2.digitalwrite(17,0) time.sleep(2) print fh.read() reads entire contents of file, leaving file cursor @ end of file, when line = fh.read() there's nothing left read. change this: fh=open("test1.txt","r") print fh.read() line = fh.read() fh.close() to this: fh=open("test1.txt","r") line = fh.read() print line fh.close() i can't test code, since don't have raspberry pi, code ensur

android - Unable to start Activity component info -

hello guys second time facing problem in last 2 days. guess there place in code in going horribly wrong. anyways trying here invoke method in class display particular text file in activity class. mainactivity is: package com.example.testflashfile; public class mainactivity extends activity{ button nextbutton; button playbutton; button backbutton; readtext readtext=new readtext(this); context contextobject; gesturedetector gesturedetector; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setrequestedorientation(activityinfo.screen_orientation_sensor); setcontentview(r.layout.activity_main); textview hellotxt = (textview)findviewbyid(r.id.displaytext); hellotxt.settext(readtext.readtxt()); gesturedetector = new gesturedetector(this.getapplicationcontext(),new mygesturedetector()); vie

scala - Reference compound primary key -

i'm new slick , first attempt of creating application it. i have case class user(userid: uuid, firstname: string, lastname: string) . users can log in. case class logininfo(providerid: string, providerkey: string) comes in (i'm using silhouette authentication). i'd associate every user logininfo using slick table : class userswithlogininfos(tag:tag) extends table[(primarykey, uuid)](tag, "users_with_login_infos"){ def logininfoid = tablequery[logininfos].shaped.value.logininfoid def userid = column[uuid]("user_id") def * = (logininfoid, userid) <>(userwithlogininfo.tupled, userwithlogininfo.unapply) } this corresponding case class userwithlogininfo(logininfoid: primarykey, userid: uuid) . my tables user s , logininfo s straightforward: class logininfos(tag: tag) extends table[logininfo](tag, "login_infos") { // primary key of table compound: consists of provider's id , key def logininfoid = primarykey(

c# - Handle Event in Notification Library -

i'm trying application features https://toastspopuphelpballoon.codeplex.com/ library. i did fine simple toast w/o event handling, cant manage work of sample click , close events as sample i'm trying simple demo documentation says https://toastspopuphelpballoon.codeplex.com/documentation var toast = new toastpopup( "my title", "this main content.", "click hyperlink", notificationtype.information); toast.hyperlinkobjectforraisedevent = new object(); toast.hyperlinkclicked += this.toasthyperlinkclicked; toast.closedbyuser += this.toastclosedbyuser; toast.show(); and need use hyperlinkclicked event stuff... i cant figure out how use event i trying toast.hyperlinkclicked += new eventhandler(myevent_method); but vs keep throwing me errors, cant figure out how handle events using lib, need it. hope help, thank you the problem metho

datatable - jquery is not working when show table from ajax request page -

i using datatable plug-ins. when showing table ajax request page jquery function not working. $(document).ready(function() { $('#example').datatable(); }); you need call $('#example').datatable(); after ajax call finished (on success function example).

java - Showing progress image between httpGet and response in Android -

i use code below xml file web service : public string getxmlfromurl(string url) { string xml = null; try { // defaulthttpclient defaulthttpclient httpclient = new defaulthttpclient(); httpget httpget = new httpget(url); httpresponse httpresponse = httpclient.execute(httpget); httpentity httpentity = httpresponse.getentity(); xml = entityutils.tostring(httpentity,"utf-8"); } catch (unsupportedencodingexception e) { e.printstacktrace(); } catch (clientprotocolexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } // return xml return xml; } it takes 3-4 seconds web service response request. want display image in time between request , response. what best way so? any appreciated. use asynctask private class longoperation extends asynctask<string,

c++ - How to count the different packet number in two text file -

i have 2 text files in.text , out.text . read them in unsigned char ** , in each element of array stores data length t=32 bellow code char *filename = "in.text"; file *stream; int numpackets = 10; int t = 32; // length of each packets unsigned char **packetsin; fopen_s(&stream, filename, "rb"); fseek(stream, 0, seek_set); (int = 0; < numpackets; i++) { fread(packetsin[i], 1, t, stream); } fclose(stream); in same manner way, can obtain packetsout above code filename = "out.text"; file *streamout; numpackets = 10; t = 32; // length of each packets unsigned char **packetsout; fopen_s(&streamout, filename, "rb"); fseek(streamout, 0, seek_set); (int = 0; < numpackets; i++) { fread(packetsout[i], 1, t, streamout); } fclose(streamout); i want count how many different packet in packetsin , packetout (each of them has 10 packets, compare first packet in packetsin , first packet in packe

ios - Make transition between two Menus with UIScrollView -

Image
i want have 2 menus (the other 1 same 1 shown in screenshot, contain other items). each menu in own uistackview . i've decided rule out uipageviewcontroller , instead use uiscrollview because it's behaviour want. how can put both menus inside of uiscrollview , make nice animation? are avoiding uipageviewcontroller because of complexity? because if there easier way accomplish same gesture controlled transition using uiscrollview's pagingenabled property based on see in screenshots... var size = cgsize() size.height = self.view.frame.height size.width = self.view.frame.width * 2 let scrollview = uiscrollview() scrollview.frame = self.view.frame scrollview.contentsize = size scrollview.pagingenabled = true scrollview.showshorizontalscroll

sql - How do I create a user that can create users in Oracle 12c? -

i have created user, granted privileges can see in sql developer except sysdba , logged in new user, still cannot create other users. here have done far: login local sysdba; run: create user usera identified "pwdpwd123" default tablespace tbs1 temporary tablespace temp profile default account unlock; grant privileges , roles can see in sql developer usera; login usera; run: create user userb identified "pwd321" default tablespace tbs2 temporary tablespace temp profile default account unlock; and ora-01031 error . what's wrong? many help! you need grant create user system priviege user. grant create user username; you can grant alter user , drop user system privileges user. see documentation: https://docs.oracle.com/database/121/sqlrf/statements_9013.htm#i2077938 system privilege name: create user create users. privilege allows creator to: assign quotas on tablespace. set default , temporary tablespaces. a

r - Barplots with column names -

i have dataset : dat<-read.table(text = "pl freq abid 23 berl 54 cara 54 daka 10",header=t) i trying have histogram name of each columns (under columns (i.e. "pl" informations) , columns sorted in decreasing order... tried lot of ordering method, : barplot(dat$freq) seems not way... i have idea helpfull ! cheers, r. i beieve looking for: barplot(dat$freq, names.arg = dat$pl) and if want have barplot sorted according frequencies: dat <- dat[order(dat$freq, decreasing = true), ] thomas

python - Half of json disappearing -

i trying scrape site in python prices , querying url api endpoint(??). when copy paste url parameters, complete json in browsers complete in chrome developers console. code looks this.. import requests import json api_woolies=('https://www.woolworths.com.au/apis/ui/search/products?ismultisearch=true&isspecial=false&pagenumber=1&pagesize=5&searchterm=chicken&sorttype=relevance') #the url woolies_data=(requests.get(api_woolies)) print woolies_data.text # woolies_data.text contains full json want woolies_data_=json.loads(woolies_data.text) # removes part want , leaves jsondata dont need print woolies_data_ the response content-type json. calling json on reponse object woolies_data.json() , using json.loads(woolies_data.text) or json.loads(woolies_data.content) removes data @ front , starts corrections:none can see in browser. tried using json.dumps adds backslash , inverted comma @ start of key , values. researched error , came know happens if d

php - to Global Variables inside functions -

i have problem global variables inside functions <?php function main(){ $var = "my variable"; function sub() { global $var; echo $var; // show "my variable" } sub(); echo $var; // show "my variable" } main(); sub(); // not show , sub() cant use outside main() function ?> i want global $var inside sub functions sub() not work outside main() function i tied use global show nothing ... ? not sure if understand want, $var not global. local variable inside main() a variable global, if declare outside of function or class. <?php $var = "my variable"; // made $var global function main(){ //removed $var here function sub() { global $var; echo $var; // show "my variable" } sub(); echo $var; // throw notice: undefined variable: var } main(); su

continuous integration - Running Remote Bamboo Agents on Demand Using Docker -

i'm trying see if viable automatically spin bamboo containers ci build enviroment ideally want number of random containers able spin automatically , destroy build without having tinkering on remote server docker compose. we have tons of different projects different mishmashes of dependencies. when dev runs build, goal container specific build should come up, add list of viable remote agents, run build, , destroy itself. has tried similar or have advice see if viable? thanks i've been working while bamboo , remote agents on docker , happened have tried achieve same thing. answer question : no, not viable in opinion . trying atlassian calls elastic agents works aws now. in current situation there no way spawn new agents when build queued. however, can setup first stage each of plans start docker container needed perform second stage. next stage need have bamboo dependencies set docker container have spawned able take care of it. while work, let me tell fl

ggplot2 - Keepin the x and y scale to max values with defined intervals in ggplot in R -

i have set of data frame values , have plotted of ggplot code have follows: ggplot(lung_dfdsa, aes(x=z_lung_con, y=lung_dsa)) + geom_point(shape=21, colour = "blue")+ scale_x_continuous(breaks = seq(0,20,2)) + scale_y_continuous(breaks = seq(0,20,by= 2)) +geom_smooth(method=lm)+ labs(x = "measured lung expression values", y = "estimated lung expression values") + theme_bw() + theme( panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.border = element_rect(colour = "black")) this code creates graph axis limits upto 14 because there data upto that, want have max limit upto 20 intervals have defined if there aren't values in dataset upto range. possible? you can use expand_limits . see http://docs.ggplot2.org/current/expand_limits.html

git - Cloned from a colleague's computer, now pull from Bitbucket still downloads a lot -

we have git repository quite large , behind slow internet connection. my colleague had recent copy of repository, did git clone him:/home/foo/repo in lan - fast :) after that, made changes, did git pull . during that, had conflicts merged. next, made git remote rename origin him git remote add <bitbucketurl> i made changes , tried to git push origin master which rejected (no fast forward). so tried git pull origin but now, git wants download megabytes of data, not understand. thinking git smart enough cross match objects has. right? additionally, tried cloning , adding bitbucket url without merging; same problem. what should fix this? edit address questions in comments : there no other branches aware of, git pull origin master has same effect doing git pull origin master print: remote: counting objects: 1535 - there no chance many chances done in meantime. i did compare log, there no changes online (bitbucket) not on colleague's compute

javascript - if a web page is iframe on example.com site it shows some data not full page -

i want make website (example.com) open in iframe pages website (mydomain.com). in iframe should show different content original page linked in iframe. <?php $url="http://example.com"; if (stripos($_server['request_uri'], '$url')) { echo 'this content gose on iframe page http://example.com '; else { echo "this content main web page (mydomain.com) , other websites webpage iframed "; } ?> i have added sample code show want code? there few things wrong here. (consult edit below). firstly, variables not parsed in single quotes. if (stripos($_server['request_uri'], "$url")) or remove them if (stripos($_server['request_uri'], $url)) you have missing closing brace } conditional statement: if (stripos($_server['request_uri'], '$url')) { $url="http://example.com"; if (stripos($_server['request_uri'], $url)) { echo 'this content gose on iframe page ht

echo xml in php and can used to decode in php -

i have script : <?php $url = 'http://www.example.com'; $post = 'response=xml'; $ch = curl_init(); curl_setopt($ch, curlopt_post ,1); curl_setopt ($ch, curlopt_postfields, $post); curl_setopt($ch, curlopt_url, $url) curl_setopt($ch, curlopt_returntransfer,1); $result=curl_exec ($ch); echo $result; ?> but show : <?xml version="1.0" encoding="utf-8"?> <interface-response> <test>this test</test><done>true</done> <requestdatetime>1/16/2016 7:50:01 am</requestdatetime> <debug><![cdata[]]></debug> </interface-response> it's text , can't used,i want echo this it this want this add below line first statement in php script. solves it header('content-type: application/xml');

How to set outlook folder initial view programatically -

i want set public folder have initial view (custom view), know how manually on outlook 2007, however, cannot find property or method can use in interop (folder , mapi folder) can this. after few hours of googling, came out following: imports nunit.framework imports system.windows.forms imports system.net.mail imports system.net.mime imports system.net imports system.runtime.interopservices imports outlook = microsoft.office.interop.outlook <testfixture()> public class testoutlook <explicit()> <test()> public sub testsetfolderinitialview() dim ol new outlook.application dim excatched exception = nothing try ' mailbox dim myfolder outlook.mapifolder = nothing integer = 0 ol.session.folders.count - 1 myfolder = ol.session.folders(i + 1) if myfolder.name = "mailbox - rex" ' change mail box name exit end if