Posts

Showing posts from September, 2015

apache - PHP Soap issue while content length is larger -

we have developed soap based webservice post data third party webservice. accepts 4 params. in 1 of parameters accepts xml string no size limit restriction put in place. the webservice works fine in local environment running on php 5.2 , apache2. works content length long 10 mb. in staging server running nginx , php fpm.we have updated max post size , max upload filesize in php.ini , client_max_body param in nginx.conf allow upto 50 mb. but webservice client keeps on loading in staging environment. gives 502 timeout , gives soap error. can me understand issue here?

knockout.js - KnockoutJS Changes Model to Controller -

i have dropdownbox binded videmodel foreach <td> <input class='required' type="text" data-bind="value: muhasebekodu" id="muhasebekodu" /></td> <td> <select data-bind="options: gidertipleri, value: selectedoptionvalue" onchange="setcodefield(this.value);" id="muhcodes" name="muhcodess"></select></td> and model this var self = null; var viewmodel = null; $(document).ready(function () { var giderlers = json.parse(document.getelementbyid('contentplaceholder1_hdnoutgoingtypes').value); var selectedgider = document.getelementbyid('contentplaceholder1_hdnoutgoingtypesselected').value; var odemetipleri = json.parse(document.getelementbyid('contentplaceholder1_hdnfirmpaymenttypes').value); var selectedodemetipi = document.getelementb...

java - Get more than One value and display it -

i checking 'n' number of servers every minute, if servers down mail triggered user server name down. issue facing if more 1 server down getting 1 server name down. how name of servers down. obj = dataaccess.getservers(); //getting status , links of servers mailserver sender = new mailserver(from,password); list<string> downserver = new arraylist(); (map<string, string> objs : obj) { //iterating each server serverstatus = objs.get("status"); if (serverstatus.equals("down")) { servername = objs.get("name"); statusserver=objs.get("status"); } downserver.add(servername); if(!(servername.equals(null))){ sender.sendmail("server status",downserver.get(i),from,to) } without checking reasonability of code or trying improve anything, code should little more following (at least) come clo...

javascript - Complete OpenIDConnect auth when requesting via Ajax -

the normal openidconnect server works like: you go a.com/secure-resource you 302 server your browser handles , sends identity server you login there it sends a.com via post you logged in on a.com , a.com/secure-resource on browser. however have scenario i'm trying solve need help. the user logged in on idserver the user logged in on a.com the user not logged in on b.com we need send ajax call web server b.com (from domain a.com ) b.com configured use openidconnect. but because request b.com via ajax, user cannot redirected idserver. (all in response 302 ) we can go ahead , handle 302 via ajax (i'm still not sure whether work, security-wise). but is there scenario in identityserver/openidconnect designed these situations? with identityserver in scenario setup server b.com use bearer token authentication, need use access token provided a.com in headers of ajax call $.ajax({ url: 'http://b.com', headers: { ...

c# - Replace text in MailItem Body -

i've added ribbon button in outlook explorer, creates new email selected email when clicked. works fine using mailitem.copy method. need replace text in message body different value. the problem email html/richtext formatted email , contain text formatting and/or pictures. , replacing text value in body property loses text formatting , pictures. so code below no good newmailitem.body = newmailitem.body.replace("old value", "new value"); and i've tried loading html , rtf value devexpress richeditcontrol , used richeditcontrol.document.replaceall method try , replace text occurrences. devexpress richeditcontrol changes/formats rtf / html value differently , causes message wrong when html / rtf set in mailitem. i've tried replacing text getting reference word document (see code below). doesn't work either. inspector inspector = newmailitem.getinspector; if (inspector.iswordmail()) { microsoft.office.interop.word.document worddocument...

Where does a browser event's timeStamp come from in Javascript? -

event objects passed event handler callbacks contain event.timestamp of when event occurred, timestamp produced? bubbles underlying os, or generated browser? i'm interested in gauging reliability of timestamp , recognise later timestamp produced less accurate it's be. also, way in timestamp produced vary between platforms , browser implementations? thanks. according dom4 specification §4.2 , it's assigned when event created (you have scroll down bit): the timestamp attribute must return value initialized to. when event created attribute must initialized number of milliseconds have passed since 00:00:00 utc on 1 january 1970, ignoring leap seconds. which leads question of: when event created? can think of 3 times might done: when os notifies browser when javascript main ui thread next able anything when javascript main ui thread dispatch task related event using snippet below, @ least click event, seems vary browser: chrome seems assi...

c++ - Synchronization mode in mutex protected block -

http://www.boost.org/doc/libs/1_58_0/doc/html/atomic/usage_examples.html in "singleton double-checked locking pattern" example of above boost examples, memory_order_consume second load of _instance , memory_order_release store of _instance necessary? thought scoped_lock has acquire , release semantics , first load of _instance has synchronization mode memory_order_consume. under assumption boost primitives used here support same functionality std counterparts, second load not require memory_order_consume since guaranteed synchronized store/release based on acquire/release semantics of mutex , right that. perhaps, use of memory_order_consume based on false assumption load/relaxed may float across mutex/acquire barrier, not possible per mutex guarantees , such memory_order_relaxed fine. the store/release on other hand absolutely necessary because synchronizes first load/consume not protected mutex .

ios - Determining maximum font size for UITextView -

is possible determine maximum font size uitextview keeps texts inside without cropping, while containing text set , constant. note : i'm using custom fonts, , swift. you can calculate height of content .then resize frame. cgsize strsize= [textview.text sizewithfont:[uifont systemfontofsize:17.0] constrainedtosize:cgsizemake(290.0,99999.0)]; frame.size.height = strsize.height

Need information on SQL Injection in ASP.Net MVC 4 -

Image
i have report generated ibm appscanner tool. scanned mvc application , on urls gave me high alerts. i'm trying figure out how perform parameter manipulation on page above information provided in report find issue. example of link on above report based : localhost:46887/myproject/country/edit/1 as rule of thumb: aways cast values (provided through request) concrete type using in application logic. if using orm/odm access data storage recieve built in sql injection protection :). tool may examins the query string , assumes injection possible.

java - Gridview not scrolling: Android -

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/textviewselectalbum" android:layout_margintop="16dp" android:textsize="16dp" android:textcolor="@color/link_text_material_dark" android:text="select album" /> <spinner android:id="@+id/spinnerselectalbum" android:layout_width="wrap_content" android:background="@color/link_text_material_dark" android:layout_margintop="12dp" android:popupbackground="@color...

imagemagick - what is best way to rotate an image using php or convert command? -

what best way rotate image using php or convert command? use php function imagerotate http://php.net/manual/en/function.imagerotate.php example: <?php // file , rotation $filename = 'test.jpg'; $degrees = 180; // content type header('content-type: image/jpeg'); // load $source = imagecreatefromjpeg($filename); // rotate $rotate = imagerotate($source, $degrees, 0); // output imagejpeg($rotate); // free memory imagedestroy($source); imagedestroy($rotate); ?>

python - Django custom command error: unrecognized arguments -

i'm trying create command similar createsuperuser take 2 arguments (username , password) its working fine in django 1.7 not in 1.8. (i'm using python3.4) this code wrote myapp/management/commands/createmysuperuser.py from django.core.management.base import basecommand, commanderror django.contrib.auth.models import user class command(basecommand): = 'create super user' def handle(self, *args, **options): if len(args) != 2: raise commanderror('need 2 arguments username , password') username, password = args u, created = user.objects.get_or_create(username=username) if created: u.is_superuser = true u.is_staff = true u.set_password(password) u.save() else: raise commanderror("user '%s' exist" % username) return "password changed user '%s'" % u.username and when try run command $ ...

JavaScript Multidimensional Array - Object Linking -

i working javascript multidimensional array. here scenario:- i have educational institution user can take classes subject. subjects not fixed vary. there exam day suppose there php lang faculty enter subject name student name , marks. if student enrolled himself more 1 subject marks listed in same row. for example mr. anand has enrolled php , html , mr. deep has enrolled himself php only. additionally want show minimum , maximum marks well. so on result day result card name\subject | php | html | java -------------------------------------- anand | 80 | 60 | -- deep | 70 | -- | -- sachin | 55 | 56 | 45 on ... | -- | -- | 80 -------------------------------------- min marks | 70 | 56 | 45 max mark | 80 | 60 | 80 i have created multidimensional array unable reproduce code per visual. think doing wrong. below code have created of :- var data = [ ["html", [{ "...

css3 - Styling HTML5 Progress Element as Circle/Pie -

html5 introduced new "progress" element default rendered progress bar (thermometer). a basic example is: <progress max="100" value="85"></progress> i have been experimenting variety of progress circle options using javascript, , have been impressed pure css approaches discussed here: css progress circle i interested know if has applied css "progress" element provide pie/clock/circle rendering rather linear display? edit/addendum: "meter" element quite similar "progress" provides low/high range...i mention more might stumble upon post in future , want apply similar technique html5 meter element.

javascript - How to add css to dynamically created tables -

html <div class="wrapper"> <div class="profile"> <div id='entrydata'></div> </div> </div> javascript <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script> $(function() { var dmjson = "data.json"; $.getjson(dmjson, function(data) { $.each(data.records, function(i, f) { var $table = "<table border=5><tbody><tr>" + "<td>" + f.clue + "</td></tr>" + "<tr><td>" + f.answer + "</td></tr>" + "<tr><td>" + f.status + "</td></tr>" + "<tr><td> " + f.views + "</td></tr>" + "</tbody>&nbsp;&nbsp;&nbsp;</table>" $("#entrydata...

jquery - I am trying to swipe my images in an image gallery.i am trying to do this on this site.( http://klaret.dk/ ) But my swipe function doesnt work -

i trying swipe images in image gallery.i trying on site.( http://klaret.dk/ ) swipe function doesnt work. here code using.i have added jquery library aswell jquery mobile ui library. still doesnt work $(document).on("pagecreate", function(){ alert("here"); //alert($('.fs_gallery_wrapper').html()) $(".fs_slide").on("swipe", function() { alert("hello"); }); }); i did , worked. awesome. <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <script type="text/javascript"> $(document).on("swipeleft",'.fs_gallery_wrapper', function(){ //alert("here"); nextslide(); }); $(document).on("swiperight",'.fs_gallery_wrapper', function(){ //alert("here"); prevslide(); }); </scri...

c# - Inconsistent Accessibility -

i have taken simple interface public interface ibinaryhelper { tobinary converttobinary(string pathbinary); } i trying access in class below it public class apihelper : ibinaryhelper { private readonly restclient _client; public tobinary converttobinary(string pathbinary) { tobinary binary = null; var request = new restrequest("sampleapi/converttobinary/{pathbinary}", method.get) { requestformat = dataformat.json }; request.addparameter("pathbinary", pathbinary, parametertype.urlsegment); var response = _client.execute<tobinary>(request); binary = response.data; return binary; } } now when build it, error getting error inconsisten accessibility: return type apihelper.tobinary less accessible method apihelper.apihelper.converttobinary(string) @ converttobinary method both in interface , in class you returning object of type tobinary public method on public class....

Translate PDF file using Google Translate API -

Image
i want use google translate in project. completed formalities google. have api key me. key can translate word javascript. how translate pdf file can in google translate site? found 1 thing this: http://translate.google.com/translate?hl=fr&sl=auto&tl=en&u=http://www.example.com/pdf.pdf but here cannot use key, result takes time translate. want use key , translate pdf file. please me out. approach this: 1. 1 html page have. 2. 1 browse button pdf 3. upload file 4. transalte pdf google api , show in html page. i searched pdf translate did not find anything. please me out. tl:dr : use headless browser render pdf google's pdf translation service. pdf complex format , can include many components text. translate describe solution easy 1 more advanced. translate raw text if need translation without visual output, can extract text , give google translate. since did not provide information on project (language, environment, ...) redirect thread o...

html - Place a div along border edge of div -

Image
in web application, wanted place small div along border edge of div this: this code: <div style="border:1px solid black; height:1em; width:10em;"> <div style="border:1px solid black; display:inline-block; height:10em; width:10em;"> along edge </div> </div> how can done? following way can it. make main div position:relative , along edge div position:absolute main div. , give top , right sub div. .main{ border:2px solid; position:relative; width:400px; height:150px; top:50px; } .sub{ border:1px solid; position:absolute; right:10px; top:-10px; z-index:99; background-color: #fff; } <div class="main"> main div <div class="sub"> along edge </div> </div> hope helps.

PHP Split string with exception -

i have string need split out : 3,1,'2015,05,14,11,18,0', 99 i want split 3 1 '2015,05,14,11,18,0' 99 how php ? one of comments (@tuananh in particular) said csv parser , little bit of trial, fgetcsv work too, you'll got have temporary file holds simple string, unlink after operation. just set enclosure single quotes when parser breaks up, gets whole string enclosed single quotes. $string = "3,1,'2015,05,14,11,18,0', 99"; file_put_contents('temp.csv', $string); // create temporary file $fh = fopen('temp.csv', 'r'); // open $line = fgetcsv($fh, strlen($string) + 1, ',', "'"); // set enclosure single quotes fclose($fh); unlink('temp.csv'); // remove temp file print_r($line); // array ( [0] => 3 [1] => 1 [2] => 2015,05,14,11,18,0 [3] => 99 ) // echo implode("\n", $line); sidenote: if indeed csv file, use fgetcsv whole thing. edit: @deceze said use...

c# - Filestream seeks correct position whereas fstream doesn't -

in c# filestream fs("file.bin",/*open in binary, read mode*/); var bytes = new byte[100]; fs.seek(20000000, seekorigin.begin); //*20000000* fs.read(bytes, 0, 100); in c++, istream becomes null typedef std::shared_ptr<boost::iostreams::mapped_file_source> filestream; filestream fs = filestream(new boost::iostreams::mapped_file_source("file.bin", 100, 0)); if (fs->is_open()) { boost::iostreams::stream<boost::iostreams::mapped_file_source> is(*fs.get()); if (is.seekg(20000000, is.beg)) //read 100 characters 20000000th position fs->close(); } if change boost::iostreams::stream<boost::iostreams::mapped_file_source> is(*fs.get()); into boost::iostreams::stream<boost::iostreams::mapped_file_source> is("file.bin"); is initialized reading 20000000th byte still impossible. error occurs same when file specified isn't found. you excplicitly telling mapped_file_source maximum file size ...

perl - Initialize hash elements to 0 -

i declare hash in perl doing this: my %hash = (); i go on adding elements hashes. sometimes, $hash{$x} not defined, meaning null . when try print it, not anything. expect see 0 in case entry $x not defined. can tell me how do this? how initialize hash elements 0 initially? instead of trying set default value, can print default value when encounter undefined value using defined-or operator , // (works perl 5.10 , higher). in example, when print hash elements, either print element, or if not defined, 0 : use 5.010; $hash{$x} // 0;

android - Is it possible to refactor package without corrupting AndroidManifest XML? -

every time refactor package, random sections of androidmanifest file gets deleted or overwritten incorrectly. is there way prevent happening, or disable automatic editing of androidmanifest file when refactoring? @krikara,i think so. met problem before , find url on stackoverflow. android project no same common java project. after using android tools -> rename application package menu, refactor java package. may need clean on project or src(right click on src dir->soruces->clean up...).

c++ - How to increment a Global Variable in a LLVM module? -

i want add instruction @ end of basic block increment globalvariable (using llvm c++ library). pretty new to llvm, can directly or require loading global variable, incrementing desired value , writing global variable ? even if load variable (with loadinst constructor), how "add" instruction know variable ? for example, @ ir ocde : %cell_index = load i32* %cell_index_ptr %new_cell_index = add i32 1, %cell_index the add instruction knows on variable operate (cell_index). since create load instruction c++ don't know variable created. yes, you'll have create load, add, , store instructions. in llvm's c++ class hierarchy, instruction subclasses value . when create loadinst , can refer directly when creating new instructions. example: irbuilder<> ir(someinsertionpoint); loadinst *load = ir.createload(myglobalvariable); value *inc = ir.createadd(ir.getint32(1), load); storeinst *store = ir.createstore(inc, myglobalvariable);

Spring: How to choose response type on run time? -

i want choose response media type on run time in method. for example, following code: @requestmapping(value = "/getrecord", produces = {"application/octet-stream", "application/json;charset=utf-8" }) public byte[] getdata( @requestparam(value="id", required=true) integer id) throws ioexception { if (id == 1) return createbytearray(); throw new mydataexception(); } in code, kind of possible response types 2. byte[] (by normal execution path) mydataexception (by exception execution path) mydataexception later handled exception handler, , converted simple class. can converted json response. first, thought if provide 2 response types produces option of @requestmapping annotation, message converter convert 2 types according actual return object. not case. in spring class org.springframework.web.servlet.mvc.method.annotation.abstractmessageconvertermethodprocessor , writewithmessageconverters() method...

Thousand Seperator function in oracle? -

when executing function compiled , doesn't give errors,but when using function in select statement giving error. please me . select query this. select numericformat(facval,5) dual; create or replace function numericformat (num in decimal, decimals in int ) return varchar2 returnval varchar(50) ; spdecformat varchar(20) ; sdecformat varchar(50) ; counter int; begin counter := 4 ; spdecformat :='.00'; while counter<=decimals loop if counter > 2 spdecformat :=spdecformat + '0'; counter :=counter+1; end if; end loop; sdecformat := '###0' + spdecformat ; returnval := to_char(num,sdecformat); return returnval; end numericformat; the error error report: sql error: ora-06502: pl/sql: numeric or value error: character number conversion error ora-06512: @ "acc07.numericformat", line 21 06502. 00000 - "pl/sql: numeric or value error%s" *cause: *action: ...

pymongo - how to test for empty mongodb query in pymong -

how test query no results in pymongo? x = collection.find( { "$and" : [ { "$or" : [ {"template":"template3.1"} , {"type" : "gift"} ] }, {"to":"test@test.com"} ] } ) can test if x has returned nothing before doing data? use cursor method count() check number of documents in cursor. if x.count()>0: //use cursor

javascript - JS/HTML - .SlideToggle two tables next to each other -

i have 2 tables different heights next each other. tables slidetoggle independently. when selecting table headers, nothing happening... the fiddle: http://jsfiddle.net/wod51fvl/ any comments welcomed!! thanks the html: <h1>test heading 1</h1> <table> <tr> <td valign="top"> <table class="tablesort"> <thead> <tr> <th id="clientclick" colspan="3" style="cursor:pointer;">client</th> </tr> </thead> <div id="clientresult"> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>1</td> <td>2</td> <td...

javascript - Why this code update every 13 second? -

just experimenting measuring distances via geolocation, script auto update every 13 seconds on galaxy s3 wonder part of script trigger timing update, how make update quicker every second . window.onload = function () { var startpos; if (navigator.geolocation) { navigator.geolocation.getcurrentposition(function (position) { startpos = position; document.getelementbyid("startlat").innerhtml = startpos.coords.latitude; document.getelementbyid("startlon").innerhtml = startpos.coords.longitude; }, function (error) { alert("error occurred. error code: " + error.code); // error.code can be: // 0: unknown error // 1: permission denied // 2: position unavailable (error response locaton provider) // 3: timed out }); navigator.geolocation.watchposition(function (position) { document.getelementb...

python - Internal Server Error while entering points using JSON in InfluxDB -

i trying enter points using json in influxdb version 0.9. run localhost:8083 on browser. enabling me create db, when try enter points using json, shoeing 'internal server error'. tried same using python api influx db. from influxdb import influxdbclient json_body = [ { "name": "cpu_load_short", "tags": { "host": "server01", "region": "us-west" }, "timestamp": "2009-11-10t23:00:00z", "fields": { "value":0.64 } } ] client = influxdbclient('localhost', 8086, 'root', 'mydb') client.create_database('mydb') client.write_points(json_body) for clients.write_points(json_body) , following error shown: traceback (most recent call last): file "<pyshell#17>", line 1, in <module> client.write_points(json_body...

.net - How to push notification to a console application using c#? -

code below gets status , file db pull mechanism, since breaks loop if status changed completed but, have problem here. should fail in error codes , keep going in case of error codes. while (keeprunning) { try { if (!finder.getfile(processid, out file)) { keeprunning = false; } } catch (exception ex) { console.foregroundcolor = consolecolor.red; console.writeline("error message: {0}", ex.message); console.resetcolor(); } } i think, need opposite direction call. instead keeping loop on until status changes, want keep client app wait on notification server, way can on come problem error code. in sort, instead of pull mechanism, need push mechanism. how can done? know reference implement pushing server client? thanks.

ruby on rails - Has_and_belong_to_many relation with the same model -

i trying implement has_and_belong_to_many relation same model, don't know how. for example, user should able follow other users. also, have multiple fields of same model in model; how give name? there 2 scenarios , 2 different implementations: the 'friends' model let's 1 user can have many :friends each friend object of user model. can way: has_and_belongs_to_many :friends, class_name: 'user' this tells rails object of user class can have many-to-many relation friends . can call this: @user_a.friends #=> [@user_x, @user_y, @user_z] # array of user objects @user_x.friends #=> [@user_a, @user_b, @user_c] # array of user objects the 'followers/following' model let's 1 user can follow other users have other users follow him. how you'll implement it: has_many :followers, class_name: 'user', inverse_of: :following belongs_to :following, class_name: 'user', inverse_of: :followers th...

php - MediaWiki (IIS) - CSS Is Not Loading Properly -

i have mediawiki running in azure web sites. when go directly site, css pages load fine. however, have several redirects site in place. when go through redirects, css fails load particular page. here specific errors/warnings in developer console of each browser: in ie: sec7113: css ignored due mime type mismatch in firefox: the stylesheet https://login.foobar.com/some_guid/oauth2/authorize?response_type=id_token&redirect_uri=https%3a%2f%2fwww.foowiki.com%2fsome_guid%2flogin&client_id=some_guid&scope=openid+profile+email&response_mode=form_post&state=%2fload.php%3fdebug%3dfalse%26lang%3den%26modules%3dmediawiki.legacy.commonprint%252cshared%257cmediawiki.skinning.interface%257cmediawiki.ui.button%257cskins.vector.styles%26only%3dstyles%26skin%3dvector%26 *&nonce=some_guid_20150513234555 not loaded because mime type, "text/html", not "text/css". in chrome: refused execute script ' https://www.foowiki.com/load....

asp.net mvc 5 - MVC 5 Web Application Share Master files -

i have large asp.net 4.5.1 web application have added mvc 5 (using guide ) i presented challenge of making mvc content web forms content. use .master files in of web forms microsoft intended, not seeing clear solution how share these .master files mvc views (since layouts appear have replaced .master files). the almighty hanselman posted few options mvc 3 on 4 years ago, can't believe microsoft hasn't come cleaner way share .master pages between forms , views. my googlefoo has failed me , i'm hoping has slicker new way of making frankenstein web application consistent across both forms , views.

javascript - Momentjs returning different results on firefox compared to chrome -

just typing out line on firefox , chrome moment("september 2015") < moment("september 2015").endof('month') i true on chrome , false on firefox, how can make result more consistent? from momentjs docs http://momentjs.com/docs/#/parsing/now/ browser support parsing strings inconsistent. because there no specification on formats should supported, works in browsers not work in other browsers. consistent results parsing other iso 8601 strings, should use string + format. so specify format moment("september 2015", "mmmm yyyy") < moment("september 2015", "mmmm yyyy").endof('month') and should work same.

algorithm - Generate all permutations in go -

i looking way generate possible permutations of list of elements. similar python's itertools.permutations(arr) permutations ([]) [] permutations ([1]) [1] permutations ([1,2]) [1, 2] [2, 1] permutations ([1,2,3]) [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1] with difference not care whether permutations generated on demand (like generator in python) or together. not care whether lexicographically sorted. need somehow these n! permutations. there lot of algorithms generate permutations . 1 of easiest found heap's algorithm : it generates each permutation previous 1 choosing pair of elements interchange. the idea , pseudocode prints permutations 1 after outlined in above link. here implementation of algorithm returns permutations func permutations(arr []int)[][]int{ var helper func([]int, int) res := [][]int{} helper = func(arr []int, n int){ if n == 1{ tmp := make([]int, len(arr)) copy(t...

osx - Heroku Toolbelt requires Ruby 1.9+ -

during heroku login in terminal message: heroku toolbelt requires ruby 1.9+ i'm using vagrant, while in vagrant ran which ruby command , got: /usr/bin/ruby , , ruby -v gives me: ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] running which ruby command in bash gives me: /usr/local/rbenv/shims/ruby and ruby -v gives me: ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin14.0] so seems have update mac osx version 1.9+, i'm not sure how. also, don't believe have rvm installed. i'm new , appreciated. everyone. vagrant virtual machine, host different environment current machine. you need log in vagrant box, , upgrade ruby inside vagrant container. you can either manually , rvm or rbenv . first port of call try sudo apt-get install ruby1.9.3 inside vagrant vm.

pointers - Passing by reference or use global variable in C -

which 1 better if want modify value function , bring main? , saying passing reference in c, mean using pointers, example. should put 'a' global variable? #include <stdio.h> #include <conio.h> int sum; int example(int *a,int b) { sum = *a + b; (*a)++; } int main(void) { int a, b; printf("tell me value of , b: \n"); scanf("%d %d", &a, &b); example(&a, b); printf("the result: %d . , new value of a: %d", sum, a); printf("\n\nthe end\n"); getch(); return 0; } i find helps think of global variables existing in sort of special space outside normal hierarchy of functions in c program. if drew diagram each function in box, , lines between boxes showing function calls others during execution of program, main() @ top (because has no callers), , other functions appear below main() on 1 level or another, lines leading other functions above them. most data lives wit...

Neo4j -- WHERE, ORDER BY, and LIMIT after UNION -

i'm trying query involves union, filters where, order by, , limit after union. the basic idea find posts starred or posted users user follows. example, posts s , p posts of interest. match (a:user {id:0})-[:follows]->(b:user), (b)-[:starred]->(s:post), (b)-[:posted]->(p:post) i'd return union of id property of both s , p after filtering, sorting, , limiting results. relevant indexes create make query efficient helpful well. if u union of s , p , i'd want like: where u.time > 1431546036148 return u.id order u.time skip 0 limit 20 i don't know how u s , p , , don't know indexes create make query efficient. you can use multiple relationships types you'll not have union. i guess time property on post node : match (user:user {id:0})-[:follows]->(friend:user) match (friend)-[:starred|:posted]->(p:post) p.time > 1431546036148 return p order p.time limit 25

android - EditText remove focus if setText() -

i have edittext textchangedlistener when use myedittext.settext("") 2 things happen: the keyboard pops up the texchangedlistener (textwatcher) fired. i want know if there way of removing related events when use settext() the first problem i've solved with if (getwindow() != null) { getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_hidden); } just before myedittext.settext("") still think should way of disabling events firing in specific situations. any idea 2 point or how should handle events? set edittext change listener null, set text empty string, , set change listener again.

sql - Creating Stats page. Php -

i trying create stat page within website display products belonging trader, amount of each product sold , total price of product has been sold. my code @ moment creates while loop loops through database, displays items multiple times (instead of once each product) , total amount of each product sold isn't set product, showing total amount every product sold. here select statement: $querytest = "select * product inner join trader on product.stall_id=trader.stall_id inner join order_items on product.product_id=order_items.product_id trader.username='". $_session['username'] ."'"; $testresult = oci_parse($connection, $querytest); oci_execute($testresult) here while loop. wish output products in database once. outputting them numerous times. while($row = oci_fetch_assoc($testresult)) { $dname = $row ['name...

jquery - Access Actual File Name -

for file name encoding concerns (users in spain) , other concerns, need manually structure file name uploaded file. when fine uploader passes information server, code changes target filename (in use case below, "my_name.jpg"). handler.php file saves file name file system, returns new file name in uploadname parameter. working properly. when return information fine uploader via uploadname parameter, i'm expecting able access new file name in javascript, can make calls store file name database. the relevant code below: settings: var settings = { debug: true, request: { endpoint: 'ajax/endpoint.php', }, deletefile: { enabled: true, endpoint: 'ajax/endpoint.php' }, retry: { enableauto: true }, callbacks: { oncomplete: function(id, name, response) { this.setname(id, response.uploadname); } }, autoupload: true, editfilename: false, retry:...

android - WebRTC VideoRendererGui -

i want send video android webrtc client. need glsurfaceview.renderer 1 obtained via videorenderergui? , if not, pass eglcontext part of this: peerconnectionfactory.initializeandroidglobals( object context, boolean initializeaudio, boolean initializevideo, boolean vp8hwacceleration, object rendereglcontext) did found solution ? use case similar your's. guess, explored how videocapturerandroid.java library, specially "startcaptureoncamerathread" function implemented in webrtc, , found solution. in case if still having problems it; yes, can sure escape creating local egl surface renderer if don't need to, , can pass null fifth parameter.

css - Zurb Foundation Overflow -

i have problem need able scroll on mobile specific piece of content. so have row lets say, left half of want stay - right half of need content in overflow , able scroll. part of row extend out past screen width , user scroll content. how go this? currently have rows setup need them anytime put more content in right hand side tries push underneath current content. ignore custom css make changes base padding. <div class="row"> <div class="row"> <div class="small-6 columns smallpadding-right"> <div class="small-5 columns"> <img class="productimg" src="images/sub_subcategories/airtools.jpg"> </div> <div class="small-5 columns font10 nopadding"> <a href="#">brooks dewalt d25123k-gb </a><br /> <a href="#" class="button tiny">remov...

Android - Scrollview start at the bottom -

is there anyway can make scrollview start on bottom? tried to: post(new runnable() { @override public void run() { fullscroll(scrollview.focus_down); } }); and setting android:focusableintouchmode="true" on lowest element in layout. but can see scrolling bottom sometimes. idea make imperceptible user. thanks lot. try scrollview.fullscroll(view.focus_down)

vba - Opening a table from another mdb file with ADO in MSAccess -

i'm trying access table mdb file. isn't linked table can fix, please don't suggest it. edit: part of archive tool creates backup file of backend of database date range, , deletes data. before delete data, suggested check , make sure data copied on created backup. (ie, if worst case scenario happened , share folder lost connection or something, , not data copied over, access database deleted data anyway) if there's way create linked table in access , delete link in end vba, not manually, maybe work(?) hoping way wouldn't cause database bloat as has been in past. i'm trying check if data copied on backup file before delete ones in current database. dim rs adodb.recordset rs.connectionstring = "driver={microsoft access driver (*.mdb)};" & _ "dbq=backup.mdb;defaultdir=c:\fish;" i'm having trouble here syntax. know works currentdb, if table in different mdb file? tried defaultdir=c:\fish , defaultdir=c:\fish\...

android - Nexus 5 Wireless driver for BCM4339 -

i want work on access point (ap) , power saving mode (psm) behaviour nexus 5 , has bcm4339 wireless chipset. currently, there 4 drivers (1 experimental) available broadcom chipsets: broadcom-iw (proprietary). firmware, no change possible. brcm80211 (broadcom open-source mac80211-based). no support ap mode. b43 (reverse engineered). best choice, because support ap, power saving mode (psm), master mode (or monitor mode). bcmon (experimental brcm80211-based driver). supports ap , monitor mode, modified support power saving mode. as documentation kind of blurry concerning particular chipset, questions are: what "default" wireless driver used on nexus 5 ? is b43 supported bcm4339 ? according page, broadcom - bcm43xx , should, not listed on page b43 - known pci devices . if b43 indeed supported, procedure switch b43 driver ? edit: found out chipset had sdio interface, driver used fullmac driver (brcmfmac). if understand correctly, means cannot modi...