Posts

Showing posts from September, 2011

javascript - Two chrome extensions using AngularJS and sharing the Gmail DOM crashing both -

i have chrome extension injects functionality gmail dom works fine when no other extensions trying same. need use angular.bootstrap bootstrap injected html code since dynamic after page has been rendered gmail think extensions operate in gmail do. as extension in gmail uses angular attempts bootstrap itself, @ top html tag , injects on top of bootstrapped code , generates error in bootstrapping routine: uncaught error: [ng:btstrpd] app bootstrapped element then, worse, both apps sharing scope in strange way neither functions after (the angular core code starts crashing around mutating dom bindings, etc.). it appear since both of operating in our own sandboxes @ least partially , trying bootstrap @ top level there no way detect and/or prevent overlap. have options here?

python - Format Pandas Pivot Table -

i met problem in formatting pivot table created pandas. made matrix table between 2 columns (a,b) source data, using pandas.pivot_table column, , b index. >> df = pd.read_excel("data.xls") >> table = pd.pivot_table(df,index=["b"], values='count',columns=["a"],aggfunc=[num.sum], fill_value=0,margins=true,dropna= true) >> table it returns as: sum 1 2 3 b 1 23 52 0 75 2 16 35 12 65 3 56 0 0 56 95 87 12 196 and hope have format this: all_b 1 2 3 1 23 52 0 75 b 2 16 35 12 65 3 56 0 0 56 all_a 95 87 12 196 how should this? ahead. the table returned pd.pivot_table convenient work on (it's single-level index/column) , not require further format manipulation. if insist on changing format 1 mentioned in post, need construct multi-level index/column using pd.mult

playframework - How to safely shutdown a Play Framework app -

i want sure request threads have finished processing before play app exits, have 2 questions: 1) signal can send invoke global onstop method? i've used ctrl-d running activator on command line while developing, when deployed, app started , stopped script wants send kill signal stop it. i've tried different signals, none have called onstop. there way? 2) when onstop called, want verify there no request threads running , wait on are. best way this? thanks!

osx - SWIFT OS X - Pre-selecting row in tableView not working -

i using code below in viewdidload() try , pre-select table row in tableview object (tblprojectnumber). no errors @ compile or run time. everything loads ok , can select table rows mouse click without problems once view loaded. however, cannot load view required default row pre-selected. have tried following code in viewdidload() (the last 3 lines refer). tableview not show selected row , not scroll row @ index(100) when data loads. override func viewdidload() { super.viewdidload() self.view.wantslayer = true self.view.layer?.backgroundcolor = nscolor.windowbackgroundcolor().cgcolor self.view.window?.title = "project detail module" self.view.window?.titlevisibility // sort list of project numbers display correctly when view first loaded self.sortprojectnumberarray() self.loadprojectrowdataarray() self.sortpprfilesforlatestdate() // pre-select table row load on initial display of tableview let index = nsindexset(index: 1

python - Get variable from url in view -

i want make http request ip:port/this1234 , use "1234" variable in python code. "1234" arbitrary int. how int argument view? @app.route('/stop####') def stop####(): global stopped if stopped: call(["./stop.sh"], shell = true) stopped = false return "started" return "already started" you'll want take @ quickstart guide . meanwhile, can post data using myvar = request.form["myvar"] and using myvar = request.args.get("myvar") the guide goes on mention error handling recommendations , references more in depth request object page . we recommend accessing url parameters or catching keyerror because users might change url , presenting them 400 bad request page in case not user friendly. for full list of methods , attributes of request object, head on request documentation. you might want @ routing bit. i&

javascript - Simple math addition in JS giving wrong result -

i have strange problem can't head around. try find highest number in list of elements have data-index attribute respective number. when iterating on them, js insists 9 < 10 false. see fiddle: http://jsfiddle.net/1ztbxbjx/ what i'm doing wrong? i can't use for (i = 0; < $('div[data-index]'; i++)) sometimes there numbers out of order in list (eg. 1,2,3,4,5,25,31). you need parse id, otherwise you're comparing strings. here example using parseint()

linkedin oauth2.0 authorization invalid client id error -

i using linkedin api oauth library. request url authorization https://www.linkedin.com/uas/oauth2/authorization/?client_id=75gq3kju41jx44&redirect_uri=https%3a%2f%2flocalhost%2fsocial%2flinkedin%2fsettings&scope=r_basicprofile%2cw_share&response_type=code&state=1436579926-c05e44 but giving me error of page not found showing me invalid client id.please let me know going wrong.i working on localhost. for getting rid of page not found, remove '/' before '?' https://www.linkedin.com/uas/oauth2/authorization?client_id=75gq3kju41jx44&redirect_uri=https%3a%2f%2flocalhost%2fsocial%2flinkedin%2fsettings&scope=r_basicprofile%2cw_share&response_type=code&state=1436579926-c05e44

python - sql.h not found when installing PyODBC on Heroku -

i'm trying install pyodbc on heroku, fatal error: sql.h: no such file or directory in logs when pip runs. how fix error? to follow on answer below... example ubuntu: sudo apt-get install unixodbc unixodbc-dev example centos: sudo yum install unixodbc-devel on windows: conn = pyodbc.connect('driver={sql server};server=yourserver.yourcompany.com;database=yourdb;uid=user;pwd=password') on linux: conn = pyodbc.connect('driver={freetds};server=yourserver.yourcompany.com;port=1433;database=yourdb;uid=user;pwd=password;tds_version=7.2')

apt get - UBUNTU 14.04 64BIT can not install lib32stdc++6 -

i want install 32bit application,but can not install lib32stdc++6 here is: sudo apt-get install lib32stdc++6 reading package lists... done building dependency tree reading state information... done packages not installed. may mean have requested impossible situation or if using unstable distribution required packages have not yet been created or been moved out of incoming. following information may resolve situation: following packages have unmet dependencies: lib32stdc++6 : depends: gcc-4.8-base (= 4.8.2-19ubuntu1) 4.8.4-2ubuntu1~14.04 installed e: unable correct problems, have held broken packages. finally,i found https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages , use aptitude force install this sudo aptitude -f install lib32stdc++6 run command ,and choose 'n',then give choice,then choose 'y'. done , success

sql server - (T-SQL): How do I use result set A to calculate result set B? -

i have 2 queries, , b, use independently each other. both return employee id , metric values. want use employee ids returned result set in query b. a's query structured this: select employee_id employee employee_team = 1 , employee_role = 1 b's query structured this: declare @tester int = 123450 --plug in employee id select employee_id ,employee_name ,sum(case when notes.note_author!=employee_id , logs.log_date<@today 1 else 0 end) metric notes inner join note_to_log_bridge br on notes.note_id=br.note_id inner join logs on br.log_id=logs.log_id inner join employee on employee_id=@tester if want b's metrics 5 employees, have run query b 5 times, changing @tester variable each time. i'd instead find way of automating that, metrics query b every employee_id in result set a. i tried stored result set cte , using while loop run through query b: declare @line=1 cte (employee_id) <query_a> while (@line<=count(cte.employee_id)) begin <quer

ios - Making four separate variables -

i trying make 4 separate variables different , b different, , c different, b , c different , on forth. here 4 variables. var = int(arc4random_uniform(5)) var b = int(arc4random_uniform(5)) var c = int(arc4random_uniform(5)) var d = int(arc4random_uniform(5)) let = int(arc4random_uniform(5)) var b = int(arc4random_uniform(5)) while b == { b = int(arc4random_uniform(5)) } var c = int(arc4random_uniform(5)) while c == || c == b { c = int(arc4random_uniform(5)) } var d = int(arc4random_uniform(5)) while d == c || d == b || d == { d = int(arc4random_uniform(5)) } println(a) // 2 println(b) // 0 println(c) // 4 println(d) // 3

How to redirect page to another page in django for class based view? -

i new in django therefore don't know how redirect page page in django. please me solve issue. urls.py file urlpatterns = patterns('', url(r'^demo$', views.booklist.as_view(), name='demo'), ) this views.py file class booklist(listview): model = book template_name = "demo.html" here trying redirect demo.html file. didn't error code still page not redirected. to make view redirect page, have specify url should redirect. you don't "redirect" template, "render" template. can redirect url renders template. to redirect in view, can use redirectview . redirect given url. example: suppose there view myview has url defined in it. then, whenever there request myview , redirect specified url . class myview(redirectview): url = 'my_redirect_url' you can pass url directly in urls.py like: url(r'^my_view_url/$', redirectview.as_view(url='my-redirect-ur

amazon web services - How to add nodes of a autoscaling group automatically to nginx or HAProxy? -

Image
in above architecture (source: http://media.amazonwebservices.com/aws_web_hosting_best_practices.pdf ), application server cluster belong autoscaling group. load balanced software loadbalancer (like nginx or haproxy). question if how nodes in autoscaling group registers automatically loadbalancer(as understand elastic loadbalancer has capability builtinm may not case nginx or haproxy) when create autoscaling group in aws, connect launch configuration responsible launching new instances of specific image, each instance automatically assigned autoscaling group. in next step, register load balancer autoscaling group, load balancer can use of instances belongs group. please check tutorial http://docs.aws.amazon.com/autoscaling/latest/developerguide/as-register-lbs-with-asg.html zoran

mysql - Optimize sql query to get duplicates -

a have following sql query: select users.* users users users.name <> '' , users.email <> '' , users.phone <> '' , users.name in ( select name users name <> '' , name not null group name having count(name) > 1 ) , users.email in ( select email users email <> '' , email not null group email having count(email) > 1 ) , users.phone in ( select phone users phone <> '' , phone not null group phone having count(phone) > 1 ) order users.name+users.email+users.phone asc limit 0,200 which unfortunately run slow on huge database. there option optimize query? idea query result: records has duplicates in database (for example users same name+same phone+same email i tried inner join seems not work correctly if want users same nam

mongodb - Can't get any db data out of Meteor -

i completed meteor 'simple todo' tutorial , thought i'd gotten basic gist of how works. i'm starting own project , hitting problems immediately. whatever try cannot data out of meteor , template, or console.log . it's undefined . i've double-checked collections via meteor mongo in terminal , data i'm passing in correct. i've tried hardcoding document id. i'm hoping can point @ must wrong code. this current iteration doesn't work, seem have tried every variation can find on net: js: pros = new mongo.collection("pros"); if (meteor.isclient) { meteor.subscribe("pros"); router.configure({ layouttemplate: 'main' }); router.route('/brief/:_id', function () { this.render('brief', { data: function(){ var proid = this.params._id; return pros.findone({ _id: proid }); } }); }); } if(meteor.isserver){ meteor.publish("pros", func

tapi - How to edit callto registry so it automatically dials a number in Windows Phone Dialer -

i have isdn phone supports tapi/cti , connects pc via serial port. can use windows dialer (dialer.exe) pre installed on windows tell phone number call. works , have lift reciever! what want able use callto: url when clicked, automatically opens application , begins dialling (like skype do). in registry editor, can edit command from "c:\progra~2\skype\phone\skype.exe" "/callto:%l" to "c:\windows\system32\dialer.exe" "/callto:%l" now when click on callto: url, program opens nothing happens. have tried few different variations in "/callto:%l" part getting nowhere. is registry edits? can done program? edit: on second thoughts, if cant achieve want above, can set callto link when clicked, copies link clipboard? manual paste can done. we use dial.exe app uses dialer. can find more info here: http://www.atrandom.iansharpe.com/phone-dial.php i'll taking code , modifying support tel: links work on cell phones

Ruby equivalent of curl with -H (header) switch -

i want curl request does, in ruby: curl https://api.wheniwork.com/2/shifts/?location_id=1&start=2014-03-05 \ -h "w-token: ilovemyboss" the part struggling is: how can add w-token @ end of regular https request? here's example how can accomplished standard library net/http: require 'net/http' url = '...' uri = uri(url) http = net::http.new(uri.host) request = net::http::get.new(uri.path) request['authorization'] = %{token token="#{password}", userid="#{user_id}"} res = http.request(request)

Saving TimeSpan into SQL Server 2012 as a Time column with ServiceStack OrmLite and C# -

i have time(7) column in database table, , want save timespan using c# , ormlite object relational mapper. while performing action exception operand type clash: bigint incompatible time this server stack trace; [updatejobfrequency: 11/07/2015 5:43:39 am]: [request: {jobfrequency:{id:0,jobid:3,frequencyid:2,instanceoffrequency:1,time:pt1h,weeknumber:0}}] system.data.sqlclient.sqlexception (0x80131904): operand type clash: bigint incompatible time @ system.data.sqlclient.sqlconnection.onerror(sqlexception exception, boolean breakconnection, action`1 wrapcloseinaction) @ system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj, boolean callerhasconnectionlock, boolean asyncclose) @ system.data.sqlclient.tdsparser.tryrun(runbehavior runbehavior, sqlcommand cmdhandler, sqldatareader datastream, bulkcopysimpleresultset bulkcopyhandler, tdsparserstateobject stateobj, boolean& dataready) @ system.data.sqlclient.sqldatareader.trycons

mysql - I am having error #1064 while creating trigger -

1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '' here trigger statement create trigger teq_after_insert after insert on table_name each row begin insert rpt_process( last_update, updater, table_id ) values ( new.last_updated, new.updater, new.iddev_est_reqs ); please me solve issue wrap with; delimiter // end; // delimiter ;

javascript - Meteor : Changes in collections are not reflected in rendered HTML -

i have been trying doing simple publish/subscribe in meteor , cannot work expect reading sources available such meteor documentation. i using macbook pro osx yosemite , running node.js v0.10.40, meteor v1.1.0.2 , chrome version 43.0.2357.132 (64-bit). here experiencing 2 different examples: first: simple todos tutorial. simple-todos.html <head> <title>todo list</title> </head> <body> <div class="container"> <header> <h1>todo list</h1> </header> <ul> {{#each tasks}} {{> task}} {{/each}} </ul> </div> </body> <template name="task"> <li>{{text}}</li> </template> simple-todos.js tasks = new meteor.collection("tasks"); // simple-todos.js if (meteor.isclient) { // code runs on client template.body.helpers({ tasks: function(){ tasks.find({}); } }); } problem desc

android - How to add sliding tabs on an existing navigation bar? -

i have navigation drawer on current application. however, seems i'm having more modules coming in, have make sure application still organized. thinking add sliding tab on 1 of navigation drawer fragment. during attempt, went wrong , log shows following error nullpointerexception: attempt invoke virtual method 'boolean android.content.intent.migrateextrastreamtoclipdata()' on null object reference i tried googling issue no success in getting solution. can tell me wrong code? my following files are. mainactivity.java package com.epsilon.rfcalculator; import android.content.intent; import android.content.res.configuration; import android.os.bundle; import android.support.v4.widget.drawerlayout; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbardrawertoggle; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.adapterview; import android.widget.arrayadapter; import android.

c++ - Making a dice game. Trying to get the loop to break as soon as one player reaches 100 -

fairly new c++. i'm create dice game lets set number of sides die , number of players. starts @ 1 pt , game ends hits 100 or more. this code have far int players = 5; int playerposition[players]; for(int i=0; < players; i++) { playerposition[i] = 1; } for(int = 0; < players; i++) { while(playerposition[i] < 100) { int roll; (int j = 0; j < players; j++) { roll = dieroll(6); // dieroll function made simulate die roll playerposition[j] += roll; cout << "player " << j + 1 << " rolled " << roll << " , in position " << playerposition [j] << endl; } } } so @ moment, output print out each turn each player fine. problem it'll keep going until every player reaches >= 100. have tried adding if(playerposition[i] >= 100) { break; } in loop , in while loop. still don't work way want t

java - store arraylist in oracle database -

this code storing arraylist in database facing problem first element of arraylist stored in database. pls help int invoice_no,bookno; static arraylist<integer> reference=new arraylist<>(); static arraylist<integer> quantity2 = new arraylist<>(); public void abc1() { try { system.out.println("hello"); class.forname("oracle.jdbc.driver.oracledriver"); connection connection=drivermanager.getconnection("jdbc:oracle:thin:@localhost:1521:xe","system","anchit"); statement statement=connection.createstatement(); resultset r1=statement.executequery("select max(invoice_no) invoice_detail"); int a=1; while(r1.next()) { a=r1.getint(1); system.out.println(r1.getint(1)); } system.out.println("a="+a); invoice_no=a+1; if(invoice_no%50==0) bookno=(i

sql server - Stored Procedure only authenticates first user in tblUsers -

i have stored procedure authenticates users on login page.the proc first checks if email exists in table,if doesnt exist,it gives out select 0 emailexists and if email exists,it goes on checking correct password , on.my entire proc given below.the problem validates first user in tblusers , shows emailexists 0 other users.why that? alter proc spvalidateuser @emailadd nvarchar(20), @password nvarchar(20) begin set nocount on; declare @emailexists bit,@userid nvarchar(10),@lastlogin datetime,@roleid int,@accountlocked bit,@retrycount int if exists(select 1 tblallusers emailadd=@emailadd) begin select @accountlocked=islocked tblallusers emailadd=@emailadd ----if account locked------ if(@accountlocked = 1) begin select 1 accountlocked,0 authenticated,0 retryattempts,1 emailexists end else begin -----check if username , password match----- select @userid = userid, @

Convert iptables line to command-line syntax for CSF bash script -

this question command-line iptables syntax. have following chains in /etc/sysconfig/iptables # generated iptables-save v1.4.21 on fri may 22 07:51:03 2015 *nat :prerouting accept [0:0] :postrouting accept [0:0] commit but need them write bash csfpre.sh csf firewall, should in command-line like iptables -t nat -i postrouting -s 192.168.254.0/24 -o br0 -j snat --to-source 69.64.56.847 or iptables -a forward -s 192.168.254.0/24 -m state --state new -j accept but lines above have stumbling block. tried like iptables :prerouting accept [0:0] iptables -t nat -i :prerouting accept [0:0] but no success. iptables -p prerouting accept says iptables: bad built-in chain name. so still not solution. in advance hint else try after tests solution was iptables -t nat -p prerouting accept iptables -t nat -p postrouting accept

elixir - How to alter a column name in an Ecto model with a migration? -

does know of (or can provide) example of how alter table column name using ecto dsl i'm guessing use mix ecto.gen.migration fill in empty created file custom code (if so, how edit column name, docs show modify change column type) or there command line flag can pass generate migration code me? you can rename/3 : rename table(:posts), :title, to: :summary

java - Spring MVC + AngularJS - Adding multiple entries to the data base -

i'm working on " absence management " web app using angularjs , spring mvc. in jsp, used angularjs retrieve specific students. want select absent students , add, each 1 of them, absence instance in db. have 2 classes : student.java , absence.java . @entity @table(name = "student") public class student { @id @generatedvalue(strategy = generationtype.identity) @column(name = "id_student") private long idstudent; @column(name = "name") private string name; @onetomany(cascade = cascadetype.all) @joincolumn(name = "idstudent") private list<absence> absences = new arraylist<absence>(); //getters & setters... } @entity @table(name = "absence") public class absence { @id @generatedvalue(strategy = generationtype.identity) @column(name = "id_absence") private long idabsence; @column(name = "absence_date") private date

sql server - Conditional counting based on comparison to previous row sql -

let's start sample of data i'm working with: policy no | start date 1 | 2/15/2006 1 | 2/15/2009 1 | 2/15/2012 2 | 3/15/2006 3 | 3/19/2006 3 | 3/19/2012 4 | 3/31/2006 4 | 3/31/2009 i'm trying write code in sql server 2008 counts few things. principle policyholder's earliest start date when policy began. every 3 years increase offered client. if agree increase, start date refreshed same date original, 3 years later. if decline, nothing added database @ all. i'm trying not count number of times customer accepted offer (or increased start date 3 years), separate out first offer or second offer. taking original start date , dividing number of days between , 1095 gets me total number of offers, i've gotten far. want compare each policy number 1 before see if it's same (it's ordered policy number), count date change in new "accepted&

objective c - How to get result of google place API In Hindi/Korean? -

i need api response in hindi , korean. have passed languge parameter with(hi hindi) , checking response simulator it's result in english. here url made me getting search places result in hindi https://maps.googleapis.com/maps/api/place/search/json?location=28.580000,77.330000&sensor=true&key=aizasyanas2zrugcxu5zp_jvucrbwlwndv7reli&name=burger&rankby=distance&language=hi please tell me if has idea bout question. see description of language -parameter: the language code, indicating in language results should returned, if possible there no guarantee results in desired language. when there no translation desired language/particular place-detail available, not it. so attempt correct, may not better results. when inspect response you'll see results in hindi(where available) e.g. sangam fry burger -> संगम फ्राय बर्गर

linux - tcp server in python not handling multiple clients -

i need tcp server run on raspberry pi allow multiple simultaneous client connections, process requests, allow clients disconnect gracefully, , continue listen forever. found code on older post here close has few problems cannot find solution for. server script is: import socket,threading tip = '192.168.99.161' tport = 3006 buffer_size = 20 class clientthread(threading.thread): def __init__(self,ip,port,socket): threading.thread.__init__(self) self.ip = ip self.port = port self.socket = socket print "[+] new thread started "+ip+":"+str(port) def run(self): print "connection : "+ip+":"+str(port) clientsock.send("\nrpi02\n") data = "111" eof=false while len(data): data = clientsock.recv(20) c in data: print ("%02x"%(ord(c))) if(c == 'z'):

angularjs - ionic collection-repeat not working -

when refer item individualy on angularjs works fine, in collection not work. this colletcion not working in ionic project, knows wrong ?? ! //javascript part //html part mapapp.controller('menuctrl', function($scope) { $scope.itens = [ {titulo: 'mapa'}, {titulo: 'login'}, {titulo: 'sobre'} ]; $scope.titulomenu = 'menu'; //$scope.curritens = $scope.itens; }); <!-- not work --> <ion-item nav-clear menu-close href="#/map/login" collection-item-height="52" collection-repeat"item in itens" class="item item-icon-left" item-height="250" item-width="100%"> <i class="icon ion-chevron-right"></i>{{item.titulo}} </ion-item> <!-- work --> <ion-item nav-clear menu-close href="#/map/login" class="item item-icon-left" > <i class=&q

ruby on rails - pg gem sslmode=verify-full, where to place certificates? -

is there way pg-gem use sslmode = verify-full it's postgres connection? simple passing string in? have rails app want full ca protected ssl connections on external db , don't know how setup ca part of that. using require on sslmode defaults use ssl traffic don't know (or under user, etc.) should placing certificates verification. should place them under ~/.postgresql/ in normal psql client workflow verified ssl certs names root.crt , postgresql.cert , postgresql.key? i'm using postgres 9.1 if helps @ all. edit come later: the following database.yml file seems work test on dev machine. i'll writing blog post on issue sure since such pita figure out going wrong. host: 127.0.0.1 sslcert: <%= rails.root.join('config', 'client.crt') %> sslkey: <%= rails.root.join('config', 'client.key') %> sslrootcert: <%= rails.root.join('config', 'root.crt') %> sslmode: verify-full database: pg-te

android - How to keep my app service keep running even if app is closed from task manger in MI phone -

my app has background service keep on running if app killed task manger when have tested app on mi(xiaomi) phone kills app service when close app task manager , service keep on running , work on devices except mi if kill app task manager. so please tell me how keep srevice running in background when app killed task manager? miui has built-in security app. in security app there 'autostart' section, user can configure app can , app can't run on startup. application disabled default. need enable app , enable permission manager permission section.

ruby on rails - Heroku Command Line Interface and Interacting with a Postgres -

i trying delete instance post model on heroku database. command line, should 'heroku run post.first.delete' work? i've been trying , doesn't seem work , can't find how this. appreciated. heroku run x won't directly put rails console. as per this article you'll want: heroku run rails console from there can delete records.

curl - unable to download box - 'An error occurred while downloading the remote file.' -

i'm trying download box, , run following error: snowch:~/demo$ vagrant box add zyga/ubuntu-precise-desktop-i386 ==> box: loading metadata box 'zyga/ubuntu-precise-desktop-i386' box: url: https://atlas.hashicorp.com/zyga/ubuntu-precise-desktop-i386 ==> box: adding box 'zyga/ubuntu-precise-desktop-i386' (v1.0) provider: virtualbox box: downloading: https://vagrantcloud.com/zyga/boxes/ubuntu-precise-desktop-i386/versions/1.0/providers/virtualbox.box error occurred while downloading remote file. error message, if any, reproduced below. please fix error , try again. transfer closed 1403398904 bytes remaining read if try download curl, get: snowch:~/demo$ curl --insecure -l -v https://vagrantcloud.com/zyga/boxes/ubuntu-precise-desktop-i386/versions/1.0/providers/virtualbox.box ... * sslv3, tls alert, client hello (1): * transfer closed 1403398904 bytes remaining read * closing connection 1 * sslv3, tls alert, client hello (1): curl: (18) transfer

scaffold command does not work with Rails 4.2.2 -

i'm trying generate rails app scaffold command in every beginner's tutorial: rails generate scaffold post name:string title:string content:text i'm getting junk: > usage: > rails new app_path [options] > > options: > -r, [--ruby=path] # path ruby binary of choice > # default: /users/etayluz/.rvm/rubies/ruby-2.2.1/bin/ruby > -m, [--template=template] # path application template (can filesystem path or url) what missing here? you cannot create rails app scaffold command. first create new rails application using rails new app_name then use scaffold command generate migration file, model, controller etc

scala - spark job cassandra error -

i getting error everytime running scala program in spark cassandra connector exception during preparation of select count(*) "eventtest"."simpletbl" token("a") > ? , token("a") <= ? allow filtering: class org.joda.time.datetime in javamirror org.apache.spark.util.mutableurlclassloader@23041911 of type class org.apache.spark.util.mutableurlclassloader classpath [file:/home/sysadmin/apachespark/spark-1.4.0-bin-hadoop2.4/work/app-20150711142923-0023/0/./spark-cassandra-connector_2.10-1.4.0-m1.jar,file:/home/sysadmin/apachespark/spark-1.4.0-bin-hadoop2.4/work/app-20150711142923-0023/0/./cassandra-driver-core-2.1.5.jar,file:/home/sysadmin/apachespark/spark-1.4.0-bin-hadoop2.4/work/app-20150711142923-0023/0/./cassandra-spark-job_2.10-1.0.jar,file:/home/sysadmin/apachespark/spark-1.4.0-bin-hadoop2.4/work/app-20150711142923-0023/0/./guava-18.0.jar,file:/home/sysadmin/apachespark/spark-1.4.0-bin-hadoop2.4/work/app-20150711142923-0023/0/./jod

c# - Code Written for .NET 4 returning Error For .NET 3.5 Client -

i trying take library coded .net 4 , recompile use .net 3.5 client. library available @ https://github.com/cshivers/ircclient-csharp/tree/master/ircclient-csharp this block of code in program gets error when calling irc.channelmessage in external library. private sub irc_channelmessage(channel string, user string, message string) handles irc.channelmessage rtboutput.clear() rtboutput.text = message if rtboutput.text.startswith("!listen ") dim s string = rtboutput.text dim pars new list(of string)(s.split(" "c)) checkparams(pars) end if end sub the library works program when set use .net 4, when set use .net 3.5 client returns error below error 4 method 'private sub irc_channelmessage(channel string, user string, message string)' cannot handle event 'public event channelmessage(sender object, e techlifeforum.channelmessageeventargs)' because not have co

c - I wonder whats happens when if(i%2) what does it checks to come to continue. It misses == but it prints out the sum as 20? Why? -

#import <stdio.h> int main(void) { int sum,i; sum = 0; for(i=0;i<10;i++) { if(i%2) continue; sum+=i; } printf("\n%d",sum); return 0; } how if(i%2) works in above code? in computing, modulo operation finds remainder after division of 1 number (sometimes called modulus).% modulus operator. so i%2 returns remainder left after divided 2. therefore if odd i%2=1(true) else 0(false).(even condition) therefore if added sum else loop continues.

mysql - How to query S3 public dataset using redshift -

amazon aws documentation awful , totally unhelpful. feels out can down actual issue. i using sql workbench connect redshift cluster able connect fine can't run commands... how can query common crawl s3 dataset? the common crawl corpus dataset provided in amazon s3 apparently formatted warc files . however, amazon redshift can load csv files (uncompressed, gzip or lzop). therefore, need pre-process common crawl files appropriate format loading amazon redshift. 1 way of doing use amazon elastic mapreduce (emr). page says: common crawl provides glue code required launch hadoop jobs on amazon elastic mapreduce can run against crawl corpus residing here in amazon public data sets. please note rather complex process (as involving hadoop).

javascript - Create pages with pre-compiling the templates -

in current project, work html , css ( html skinning ). there many pages have repeated sections header, footer, sharing links etc. i don't want repeat common sections again , again in each page. want these repeated sections call somehow using gulp or other task runner. something example ( using lodash ) index.html <!doctype html> <html> <%= _.template(templates['head'])() %> <body> <%= _.template(templates['header'])() %> <!-- unique content here --> <%= _.template(templates['footer'])() %> </body> </html> and using gulp-template rendering in each page. preferring lodash because had worked it. as can see, assuming if somehow keep repeating sections in javascript object ( with name templates ), can call in 1 line code. , if change in repeating section, change occur in pages. to make possible, first need generate javascript object repeating html strin

Laravel: return post request body from Postman in json -

i trying make test work. use rest client, "postman" send post request object laravel. idea request object. don't think getting right result. in postman, specify adress send to, choose "post", , send this: { "url": "http://testingtesting.com" } in laravel have route adress: route::post('api/test', 'testcontroller@index'); and controller should return json object. if this: class testcontroller extends basecontroller{ public function index(){ $input = input::json()->all(); var_dump($input); } } i array in postman: array (size=1) 'url' => string 'http://testingtesting.com' (length=18) that's when @ "preview". if switch "pretty" shows this: <pre class='xdebug-var-dump' dir='ltr'> <b>array</b> <i>(size=1)</i> 'url' <font color='#888a85&#

c# - Double await operations during POST -

using c# httpclient post data, hypothetically i'm concerned returned content. i'm optimizing app , trying understand performance impact of 2 await calls in same method. question popped following code snippet, public static async task<string> asyncrequest(string url, string data = null) { using (var client = new httpclient()) { var post = await client.postasync(url, new stringcontent(data, encoding.utf8, "application/json")).configureawait(false); post.ensuresuccessstatuscode(); var response = await post.content.readasstringasync(); return response; } } assume have error handling in there :) know await calls expensive double await caught attention. after first await completes post response in memory more efficient return result directly, var response = post.content.readasstringasync().result; what performance considerations when making 2 await/async calls in same method? will above code result in thread pe

html - If an element has ancestors with heights < 100%, is there a way to still make it the height of the browser window without using JS? -

maybe there's way figure out browser height , use variable in sass? or perhaps sort of absolute positioning takes account window itself? yes. you can use position: fixed; starters, fix element relative window , height: 100% make take full height of window. option take element out of scroll. a second way setting position: relative; on <html> or <body> tag, making sure elements down dom tree target element defaulted position: static; . finally, setting position: absolute; or position: relative; on target element make refer next element tree not set static. more on position here at mdn , css tricks . i final way use vh units. unit 1% of current viewport height value of 100 make element 100% height of screen. support not perfect , provide fallback. finally, sass pre-compiled language never gets far browser. generated css used browser , used add power our css programming.

angularjs - angular-slidezilla: <slider> not showing in site -

i tried intgrating angular-slidezilla web site, slider elements not show. observations: i copied .js file /lib folder , .css /css folder. the site uses requirejs; added source file requirements list. i added css stylesheet link next other css files in index.html file. to test, copied demo page (the entire part) html page , added $scope.slider1.val etc. variables angularjs controller object. added function periodically changes value of scope variables. when deploy site , load page, see values changing every second (these shown text near sliders). sliders not show. "inspect element" function shows generated piece of dom (div objects related slider), slider has size 0px*0px. no errors in javascript console. can give me hint how investigate further? found solution. javascript code in angular-slidezilla.js never executed. result widgets not initialized , remained in initial hidden state. i needed edit 1 line of javascript code working: // app.js v

android - Compact alternatives to Java ArrayList<String> -

this question has answer here: hashset of strings taking memory, suggestions…? 8 answers i need store large dictionary of natural language words -- 120,000, depending on language. these need kept in memory profiling has shown algorithm utilises array time bottleneck in system. (it's spellchecking/autocorrect algorithm, though details don't matter.) on android devices 16mb memory, memory overhead associated java string s causing run out of space. note each string has 38 byte overhead associated it, gives 5mb overhead. at first sight, 1 option substitute char[] string . (or byte[] , utf-8 more compact in case.) again, memory overhead issue: each java array has 32 byte overhead . one alternative arraylist<string> , etc. create class same interface internally concatenates strings 1 gigantic string, e.g. represented single byte[] , , store offsets h

How can we convert an array of Object to List in Java? -

this question has answer here: converting array list in java 16 answers ex: object[] arrobject1 = new object[]{true, true, false, true, false} object[] arrobject2 = new object[]{1, 2, 3, 4, 5} how can convert object[] list ? use list<object> list = arrays.aslist(array);

Does google app engine support environment variables? -

i've noticed developer console doesn't seem expose anywhere can configure static environment variables. is expectation on gae bundle variables part of deployment build server? if so, there documentation on gae/google cloud covers why or details philosophy? environment variables can defined in application's app.yaml an example python/php/(maybe go?) app. java uses different format. env_variables: my_env_var: 'some value here' https://cloud.google.com/appengine/docs/python/config/appconfig#python_app_yaml_defining_environment_variables you can set these values during ci process if need programmatically appending them app.yaml before deploying.