Posts

Showing posts from May, 2015

javascript - Issue Copying Code From JSFiddle -

i trying copy code jsfiddle, it's radial loading bar. wanted put html/css files , mess code, can't seem work. shows blank, not displaying anything. jsfiddle link http://jsfiddle.net/andsens/d7vkd/ . :) here exact copy of html/javascript put html document: <html> <link rel="stylesheet" type="text/css" href="loadercss.css"> <head> <script src="jquery.js"></script> <script type="text/javascript"> $('head style[type="text/css"]').attr('type', 'text/less'); less.refreshstyles(); window.randomize = function() { $('.radial-progress').attr('data-progress', math.floor(math.random() * 100)); } settimeout(window.randomize, 200); $('.radial-progress').click(window.randomize); </script> </head> <body> <div class="radial-progress" data-progress="0"> <div class="circle">

html - Stacking divs side by side -

i'm trying stack these divs side side - left , right. right stack of divs won't clear. should float left stack left , same right stack or left , right floats? i'm trying emulate this, i'm trying make table divs. http://www.weareint.io/ demo https://jsfiddle.net/zeegn9cn/ * { padding: 0px; margin: 0px; } #sections { /*--left section columns--*/ width: 1000px; height: 400px; margin: 0 auto; background: red; } .sectionlfirst { width: 500px; background: orange; } .sectionlsecond { width: 500px; background: skyblue; } .sectionlthird { width: 500px; background: indigo; clear: both; } .sectionrfirst { /*--right section columns--*/ float: right; width: 500px; background: orange; clear: both; } .sectionrsecond { float: right; width: 500px; background: skyblue; clear: both; } .sectionrthird { float: right; width: 500px; background

shell - Assign BASH variable from file with specific criteria -

a config file last line contains data want assign right of = sign variable can display , call later in script. example: /path/to/magic.conf : foo bar thisoption=foo.bar.address:location.555 what best method in bash shell script read last line of file , assign right of equal sign? in case, foo.bar.address:location.555 . the last line has want target , there ever single = sign in file happens last line. google , searching here yielded many close non-relative results using sed/awk couldn't come i'm looking for. use sed : variable=$(sed -n 's/^thisoption=//p' /path/to/magic.conf) echo "the option is: $variable") this works finding , removing thisoption= marker @ start of line, , p rinting result.

momentjs - Why the UTC offsets available in moment-timezone are not exactly the same as Wikipedia UTC list -

i converting visitors local times utc using momentjs visitor_utc = moment().utc().valueof() and getting offset visitor_utc_offset = moment().utcoffset().valueof() / 60 i have drop-down list filled offsets (... -01:00, +00:00, +01:00, +02:00 ....) user can change , set actual offset. default selected value visitor_utc_offset is there method list of offsets using momentjs ? with moment-timezone it's possible : for element in moment.tz.names() console.log moment.tz(element).format("z") but gives long list redundant values (because formatting timezones names can have same offset) i found list in wikipedia list_of_utc_time_offsets not sure if it's complete list, , it's reliable future ? update to compare list of offsets used in moment-timezone , 1 wikipedia used code : element in moment.tz.names() if $.inarray( moment.tz(element).format("z"), arr ) <= -1 arr.push moment.tz(element).format("z") which

updating embedded array in MongoDB -

i trying update embedded array document in collection structure { id: 1, fields:[ { "lang" : "eng","embeddedarray" : ["a","b","c"] }, { "lang" : "abcd","embeddedarray" :["a","d","e"] }] } i want update in embeddedarray try update using query updating entire array 'a' instead of ['a','b','c'] db.collectionname.update({"fields.embeddedarray" : 'a'}, {"$set" : {"fields.$.embeddedarray" : "a"}}); is way update without loosing other elements in array ? please check below query : db.collectionname.find({"fields":{$elemmatch: {"lang":"a"}}}).foreach(function(doc){

git - Pull a commit into another branch exactly (without merging) -

i have structure similar below: c1 -- c2 -- c3 \ -- c4 i want pull c3 on on top of c4 . ( nb: c3 & c3a hold save files ) c1 -- c2 -- c3 \ -- c4 -- c3a if try merge or pull told date. how can force 're-merge' can c3 on top? in current branch, don't think can since c3 merged in branch. you can try cherry-picking commits on new branch though, should give desired results: first, create new branch: git checkout -b new_branch <c1> now cherry pick c4 on new_branch: git cherry-pick c4 now cherry pick c# on new_branch: git cherry-pick c3 the above should give desired results in new_branch : c1 -- c2 -- c3 \-- c4 -- c3

iOS Push Notification inside proprietary framework -

i need distribute framework. this frameworks needs silent notifications update configuration in background. for understanding seems not possible because push configuration setup done on application level. (and in case, not manage application push certificate) is there solution push notification framework ?

c# - WPF ClickOnce install silently without "Unknown publisher" dialog in local interanet -

Image
this question has answer here: how install clickonce app without prompting user? 4 answers i've developed simple wpf application has installed on network domain clients computers. added following command affect after user logoff/login: "\\messenger\messenger.application" /install /silent /passive but problem when \\messenger\messenger.application runs on clients computer dialog box appears want bypass it. because not users click on run , don't want that. how can install application without take confirm of user , run install procedure silently? you may need sign application remove "unknown publisher" warning. this, buy code signing certificate , sign application. i'm guessing default windows won't allow silent installs applications haven't been signed.

csv - Looping through names on a list to run through another program in Python -

i've been trying run list of twitter user names through python script downloads tweet history twitter's api. have user names csv file tried import list , pass through script one-by-one using for-loop. however, getting error seems dumping entire list script @ once: <ipython-input-24-d7d2e882d84c> in get_all_tweets(screen_name) 60 61 #write csv ---> 62 open('%s_tweets.csv' % screen_name, 'wb') f: 63 writer = csv.writer(f) 64 writer.writerow(["id","created_at","text"]) ioerror: [errno 36] file name long: '0 tonyabbottmhr\n1 albomp\n2 johnalexandermp\n3 karenandrewsmp\n4 for brevity's sake, including list in code, importing of names csv list commented out. apologies, in order run script, 1 needs twitter api. code below: #!/usr/bin/env python # encoding: utf-8 import tweepy #https://github.com/tweepy/tweepy impo

java - How do I return a String from a Thread or get a string from a Thread? -

i need string value thread, don't it! global variables don't work! can me please? this code. need use datastring : public class deserializable { public void execute() { new thread() { public void run() { string surl = "http://myaddressxxxxx"; httpurlconnection urlconnection = null; url url = null; try { url = new url(surl); urlconnection = (httpurlconnection) url.openconnection(); inputstream in = new bufferedinputstream( urlconnection.getinputstream()); int b = in.read(); list<byte> bytes = new linkedlist<byte>(); while (b != -1) { bytes.add((byte) b); b = in.read(); } byte[] array = new byte[bytes.size()]; (int = 0; < bytes.size(); i++) { array[i] = bytes.g

objective c - Facebook login happening when clicking Logout in iOS? -

i have viewcontroller shows fb button signing , taking user next viewcontroller. i have made changes in info.plist appdelegate.m #import "appdelegate.h" #import <parse/parse.h> #import <fbsdkcorekit/fbsdkcorekit.h> #import <fbsdkloginkit/fbsdkloginkit.h> #import <parsefacebookutilsv4/pffacebookutils.h> - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. // initialize parse. [parse setapplicationid:@"parse_app_id" clientkey:@"parse_client_key"]; [pffacebookutils initializefacebookwithapplicationlaunchoptions:launchoptions]; [fbsdkloginbutton class]; // [optional] track statistics around application opens. [pfanalytics trackappopenedwithlaunchoptions:launchoptions]; // return [[fbsdkapplicationdelegate sharedinstance] application:application didfinishlaunc

Java: Repeat (Understanding the code) -

could please explain how return line works? thank public class javaapplication1 { /** * repeat string <b>str</b> <b>times</b> time. * @param str string repeat * @param times repeat str times time * @return generated string */ public static string repeat(string str, int times) { return new string(new char[times]).replace("\0", str); } public static void main(string[] args) { system.out.println(repeat("*", 5)); } } it easier follow if broken down step step // str = "*" , times = 5 public static string repeat(string str, int times) { //we crete new empty array have values {'\0','\0','\0','\0','\0'} char[] chararray = new char[times](); string newstr = new string(chararray); // newstr.equals("\0\0\0\0\0") newstr = newstr.replace('\0', str

java - Wait notify multithreading producer consumer issue -

i working on basic thread-producer consumer problem. now in code assuming 1) threads go wait state , moment task comes 1 of tasks notified , process task , again wait threads going runnable states abruptly. understanding correct? public static void main(string[] args) { asynctaskexecutorimpl executorimpl = new asynctaskexecutorimpl(10, 5); (int = 0; < 200; i++) { runnable task = new createtask(); system.out.println("added task no" + i); executorimpl.execute(task, 10); } } import java.util.concurrent.arrayblockingqueue; public class myarrayblockingqueue<t> { private volatile arrayblockingqueue<runnable> internaltaskqueue = new arrayblockingqueue<runnable>( 10); public boolean isempty() { synchronized (this) { return internaltaskqueue.isempty(); } } public void add(runnable paramrunnable) throws interruptedexception { synchronized (this.internaltaskqueue) { this.intern

objective c - Calculate Days Between Dates, Ignoring Certain Weekdays -

i developing scheduling application, , part of events repeat, say, daily in given schedule. schedule 'active' on days—think of work week, saturdays , sundays nothing happens. i'd calculate number of consecutive days between 2 dates, excluding weekdays. have method uses nscalendar this, ignoring excluded days, did not see methods on (or related classes) that'd allow me ignore days. + (nsinteger) okdaysbetweendate:(nonnull nsdate *) fromdatetime anddate:(nonnull nsdate *) todatetime { nsdate *fromdate; nsdate *todate; nscalendar *calendar = [nscalendar currentcalendar]; [calendar rangeofunit:nscalendarunitday startdate:&fromdate interval:null fordate:fromdatetime]; [calendar rangeofunit:nscalendarunitday startdate:&todate interval:null fordate:todatetime]; nsdatecomponents *difference = [calendar components:nscalendarunitday

c++ - Eclipse CDT for Linux -

Image
i have written program using c++11 features. /* * test.cpp * * created on: 05-jul-2015 * author: avirup */ #include<vector> #include<iterator> #include<iostream> using namespace std; int main() { vector<int> v; v.push_back(5); v.push_back(7); for(auto i=v.begin();i!=v.end();i++) { cout<<*i<<endl; } for(auto i=v.cbegin();i!=v.cend();++i) { cout<<*i<<endl; } } the program compiling correctly , showing results editor showing red lines below valid functions cbegin() , cend() constant reference iterators. annoying. how rid of this? just completeness since has no answer , give explanation. to achieve compiling c++ 11 (or version) , eclipse supporting need 2 things. first compiler flag needs set -std=c++11 or -std=c++0x appended when calling g++ or whatever used. open properties properties project. select , right click ↦ properties (or alt+enter windows users)

python - problems with the update of a label Tkinter -

i'm stuck on basilary things: have code from tkinter import * import sys import subprocess import tkinter tk def cd(): f=(subprocess.check_output("net view")) e=(f.decode(sys.stdout.encoding)) label1=label(text=e).pack() def mainscreen(): mainscreen=tk() mainscreen.title("terfysgol's kit v 2.0") frame1=frame(mainscreen) frame1.pack() puls1=button(frame1,text="list of device", borderwidth= "2",command= cd).pack() mainscreen() when run time press button create new label want update text of label1. this after: def cd(): f=(subprocess.check_output("net view")) e=(f.decode(sys.stdout.encoding)) label1.config(text = e) and @ top of program after imports need put: label1 = label() label1.pack() please note i'm not suggesting program structure, sort out. answer quick fix provide enough information work out rest of need. also can remove import tkinter tk

mysql - The code is start of sample data for Joomla Radon template. Syntax error appears in line 9. Unfortunately I did not find what is wrong -

database: radon table structure table #__acymailing_config drop table if exists `#__acymailing_config`; create table `#__acymailing_config` ( `namekey` varchar(200) not null, `value` text ) engine=myisam default charset=utf8; dumping data table #__acymailing_config you can't create table name #__acymailing_config . put prefix instead of #__ cheers , have fun!

parallel processing - understanding MPI send differences -

ok let's start, i've bit of confusion in head. send : blocking. sender waits until receiver has posted corresponding recv. ssend : blocking , sender not waits until receiver has posted corresponding recv, wait ack of recv. means recv run fine. bsend : non blocking. process can go ahead execute part of code. data stored in buffer allocated before. isend : non blocking. process can go ahead execute part of code. data not stored in buffer: must not overwrite data you're sending until you're sure isend has run fine (wait/ test). so.. isend , bsend differs buffer? yes--the difference between isend , bsend buffer. isend non-blocking send performed in-place. bsend non-blocking send can buffered in segment of memory specified mpi_buffer_attach . the bsend function created allow programmer specify data being buffered. it important note that, isend , must check status of sends using bsend buffer not overflow buffer or overwrite pending bsend &

ios - RetainCycle with Globals -

let's in ios have: in w2appdelegate.m: globalviewcontroller *globalvc; - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { ... } in someotherviewcontroller.m: - (void)viewdidload { [super viewdidload]; [globalvc dosomething^{ [globalvc.somevariable dosomethingelse]; // there retain cycle here? }]; } is there retain cycle here since have strong reference globalvc inside block. globalvc -> block -> globalvc is there retain cycle here since have strong reference globalvc inside block. no. because blocks capture local variables only. [globalvc dosomething^{ [globalvc.somevariable dosomethingelse]; // there retain cycle here? }]; globalvc wasn't captured block because globalvc global variable. no local variables here, block doesn't capture objects, block doesn't retain objects @ all.

textures - OpenGL Fade in / fade out a texture2D -

i writing application displays .jpg files stored texture2d (rgb) in opengl. want smoothly change 1 texture2d next fading black, fading next texture. after looking explanation wrote this. void rendertexture() { glmatrixmode(gl_modelview); glenable(gl_texture_2d); glbindtexture(gl_texture_2d, mtexture); glusphere(mquad, 1.0f, 50, 50); glbindtexture(gl_texture_2d, 0); } void fadetoblack() { glenable(gl_blend); glblendfunc(gl_one, gl_one_minus_src_alpha); (glfloat alpha = 1.0; alpha > 0.0; alpha -= 0.05) { glcolor4f(0.0, 0.0, 0.0, alpha); rendertexture(); glflush(); glutswapbuffers(); } gldisable(gl_blend); } unfortunately, not fade black instead switches black immediately. must have misunderstanding on how gl_blend working here. can please point out doing wrong? ** edit: did trick. lot j-p , benjamin pointers ** void fadetoblack() { (glfloat alpha = 1.0; alpha > 0.0; alpha -= 0.001) { rendertexture(); glcolor4f(a

ios - Storing CLLocation and keeping annotation -

my app has 3 tabs, tab pinning location, , detailview of pinned location on second tab. trying save location of pin nsuserdefaults. location stay pinned upon reloading app, , therefore detail view still display detail view of pinned location. here have far, func locationmanager(manager: cllocationmanager!, didupdatelocations locations: [anyobject]!) { // find location of user var userlocation:cllocation = locations[0] as! cllocation var latitude = userlocation.coordinate.latitude var longitude = userlocation.coordinate.longitude var latdelta:cllocationdegrees = 0.01 var longdelta: cllocationdegrees = 0.01 var span: mkcoordinatespan = mkcoordinatespanmake(latdelta, longdelta) var location:mkuserlocation = currentlocation; var region: mkcoordinateregion = mkcoordinateregionmake(location.coordinate, span) var coordinate:cllocationcoordinate2d = cllocationcoordinate2dmake(latitude, longitude); carinitiallocation = userlocation; let loca

Convert List from java to a dropdown menu in html -

i have output java code in form of list public class getprojectlist { final string username = "username"; final string password = "password"; final string projectnames = null; public getprojectlist() throws urisyntaxexception, interruptedexception, executionexception { final uri jiraserveruri = new uri("https://jira.xxxx.com"); final jirarestclientfactory restclientfactory = new asynchronousjirarestclientfactory(); final jirarestclient restclient = restclientfactory.createwithbasichttpauthentication(jiraserveruri,username,password); final iterable<basicproject> allproject = restclient.getprojectclient().getallprojects().get(); final string projectnames = allproject.tostring(); system.out.println(projectnames); } } i want use output code dropdown menu item. need this. thank you string projectstohtmloptions(string projectnames,string separator){ stringbui

html - Listview CommandName applied to table -

i'm using following listview markup render table each object retrieved database... <asp:listview id="dayslistview" runat="server" visible="false" onitemcommand="weekslistviewcommand" datakeynames="date, weekid, entryid"> <itemtemplate> <table style="background-color:#2e425f; padding-top:10px; padding-bottom:10px; padding-right:5px; padding-left:5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; border: 1px solid #7795bf"> <tr> <td style="width:120px"><asp:linkbutton id="daynamelinkbutton" style="color:white; font-size:14pt" cssclass="datelinktext" runat="server" commandname="dayclickcommand"><%#eval("dayofweek") %></asp:linkbutton></td> <td align="right" style="width:150px"><asp:linkb

javascript - How do submit dynamically generated form fields to processing page with angularjs? -

i working on lengthy form has section block of form fields dynamically added/removed. far have not been able find way make method work. for example, if add 3 subcontractors , fill in input each, ngmodel holds value should. however, if remove 1 of fields ngmodel still holding input value. additionally, if remove 2nd field in series doesn't remove instance, reduces count instead of having field #1 , field #3 should, have field #1 , field #2. the end result in of submit process page , have loop iterate through total # of added fields , insert them db. i'm new angularjs i'm not sure method attempting best practice seems overly complex, open suggestions on how improve process well. html <div ng-repeat="subcontractor in subcontractors"> <div class="well well-sm">subcontractor #{{subcontractor.id}}<span id="subcounter"></span> <button type="button" ng-click="removesub()" class="

php - after migrating magento site to aws ec2 I got 'Undefined index' error -

i have migrated magento site shared hosting aws ec2 ubuntu server. have done database import successfully. when hit public ip of ec2 server. got undefined index: items in /var/www/html/app/code/core/mage/page/block/html/head.php on line 166 notice: undefined index: items in /var/www/html/app/code/core/mage/page/block/html/head.php on line 166 please give suggestion fix these issue in php, notices errors things may have done wrong, or have potential causing bugs. its previous environment had error level disabled, why didn't see before. you have 2 options: fix cause of error. disable notice level error_reporting directive in php.ini. (make sure restart webserver/php after change)

c# - Get TableName of Entity while using Fluent API -

i'm using fluent api change names of tables entities like: public class testmap : entitytypeconfiguration<domain.test> { public testmap() { totable("test"); } } now later on in dbcontext want find table name type when inside metadataworkspace can't find type domain.test . able find table "tests" can't match unless hard code. question how can find typename inside metadataworkspace . the code i'm using try , find type domain.test : objectcontext octx = (context iobjectcontextadapter).objectcontext; ; var es = octx.metadataworkspace .getitems<entitycontainer>(dataspace.sspace) .selectmany(c => c.baseentitysets); edit, simplefied example of code people test: using system; using system.collections.generic; using system.data.entity; using system.data.entity.core.mapping; using system.data.entity.

How to add symlinks to git repository on Windows? -

i compile binaries os x using github' s electron environment , want add output git repository. i tried git add . error: readlink("sulu.app/contents/frameworks/electron framework.framework/electron framework"): function not implemented error: unable index file sulu.app/contents/frameworks/electron framework.framework/electron framework fatal: adding files failed any idea work around this? windows command mklink /h "link_file_path" "target_file_path" use above command create hard link output files. work. did similar stuff git hooks. refer link more info mklink http://ss64.com/nt/mklink.html

swift - Using a Closure as a While Loop's Condition -

i want use closure condition while loop. have: var x: int = 0 var closure = {() -> bool in return x > 10} while closure { x += 1 println(x) // never prints } it never prints anything. if change closure() , doesn't work either. any appreciated. two issues: your logic backwards. want print while x less 10 , so: when call closure directly function, i.e. parenthesis. updated code, tested swift 2.0: var x: int = 0 var closure = {() -> bool in return x < 10} while closure() { x += 1 print(x) }

javascript - Authenticating Parse.com User and Session Server-side -

i'm exploring parse platform building sample client-side apps parse javascript sdk. i've decided abstract majority of parse-related logic away app , restful api running on vps. purpose make app back-end agnostic possible. the restful api i've built express.js app uses node.js parse package. my question is: when want make request rest api, best way validate user making request? example: consider app users can have friends: user logs in on client-side using parse.user.login() method. client hits endpoint /users/me/friends on rest api, checks if user has valid session , returns list of user's friends. so require server-side parse code determine: who user making request is, and if current user has valid session i've considered using following approach: when user logs in client-side, s/he receives session token. attach session token header when making api requests. on server, use session token in combination parse.user.become() method set cur

postgresql - SQL Using multiple joins to fill in null values -

i have 2 tables - 1 jobs data , 1 address data. the address_data (d) follows: | lotnumber | plannumber | streetnumber | (other info not relevant) | the jobs_data (j): *for many of these entries, lot + plan number given | lotnumber | plannumber | streetnumber | (other info) | i want fill in j.streetnumber d.streetnumber field when null joining j.lotnumber = d.lotnumber , j.plannumber = d.plannumber my first attempt: insert jobs_data (streetnumber) select d.streetnumber address_data d join jobs_data j on j.lotnumber::varchar = d.lotnumber::varchar join address_data da on j.plannumber::varchar = da.plannumber::varchar j.streetnumber null ; within jobs_data (j) table, first attempt added blank row every row of address data (d) , filled in street number columns. further table, jobs data remained unchanged same missing street numbers. also feeling null may not same empty streetnumber columns blank (with no spaces)? i'm hoping sql gurus may able solve me!

javascript - Click a link in Safari that is inside a table -

essentially have link inside of huge table in safari. want click row 2 column 1. name of link changes inside cell. here html http://pastebin.com/uuwffcyg i put visual marker in code want click. in example search "1222" , pull right up. basically once link clicked opens window can hack around , use system events tab , select stuff , reload page , again. bonus if can tell me how check text in next column. row 2 column 2. if says "open" click on link in cell left. full disclosure have written applescript program this, using python clicks governed screen coordinates, if resolution changes or add monitor breaks program. it's hacky works. looking more native. any appreciated! brandon so automatically want see if there link in row 2, column 1 of table , click on it? <script language="javascript"> function clicklinksintable(i) { // check if link exists in row if (!document.getelementsbytagname("tr")[i+1].getel

javascript - MongoDB: forEach vs fetch + each -

when want iterate on set of documents stored in mongodb meteor app, can use either db.collection.find( ... ).foreach( function f( doc ){ ... }) or var docs = db.collection.find( ... ).fetch(); _.each( docs, function f( doc ){ ... }); // using underscore.js which way preferable performance point of view? cons , pros exist both choices? the 2 statements same thing @ core api level, cursor , tranform results. there 1 "core" difference performance: .foreach() tranform cursor results "one @ time" , process iterator function provided. .fetch() on other hand gets "array" cursor "all @ once" means "in memory" in 1 hit. so no matter what, neither "faster" @ doing "core" operation of fetching cursor of query. however, not evaluating "expression" on each cursor iteration "may be" faster, .fetch() might win "little" here. the great big catch of course "everythin

python - Django- Exception Type: KeyError -

i'm working on application i'm using twitter account url of user logs in application using twitter login scrap total tweet count , number of followers using beautifulsoup , urllib2 . views.py import urllib2 bs4 import beautifulsoup def fillform(request): if request.method == 'post': profile = ['tweets', 'followers'] followers = '' tweets = '' form = evangelizedform(request.post) if form.is_valid(): obj = form.save(commit=true) link = obj.twitter_url dic = {} r = urllib2.urlopen(link) src = r.read() res = beautifulsoup(src) p, d in zip(profile, res.find_all('span', { 'data-is-compact': "true"})): dic[p] = d followers = dic['followers'] tweets = dic['tweets'] obj.twitter_followers = followers obj.to

installation - Ruby command not working after installing Ruby 2.0 through RVM on Linux mint 17.2 -

i tried install ruby 2.0 through rvm. seems installed ruby without problem. however, when type ruby -v nothing comes out. think command ruby not yet set up. i want know how use "ruby -v". <blink> kyu@kyu-latitude-d430 ~ $ rvm install ruby 2.0.0 searching binary rubies, might take time. no binary rubies available for: mint/17.2/x86_64/ruby-2.0.0-p643. continuing compilation. please read 'rvm mount' more information on binary rubies. checking requirements mint. installing requirements mint. updating system............ installing required packages: g++, libreadline6-dev, zlib1g-dev, libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, libffi-dev.............. requirements installation successful. installing ruby source to: /home/kyu/.rvm/rubies/ruby-2.0.0-p643, may take while depending on cpu(s)... ruby-2.0.0-p643 - #downloading ruby-2.0.0-p643, may t

php - Zend Framework / Skeleton-Application / Composer install issue -

i trying create zend framework application using skeleton in netbeans. when run composer install, following error message: "c:\php\php.exe" "c:\composer\composer.phar" "--ansi" "--no-interaction" "update" "--dev" using deprecated option "dev". dev packages installed default now. loading composer repositories package information updating dependencies (including require-dev) requirements not resolved installable set of packages. problem 1 - package requires php >=5.5 php version (5.4.42) not satisfy requirement. problem 2 - installation request zendframework/zendframework 2.5.1 -> satisfiable zendframework/zendframework[2.5.1]. - zendframework/zendframework 2.5.1 requires php >=5.5 -> php version (5.4.42) not satisfy requirement. done. apparently, zend framework only needs php 5.3+ contradicts above. need use php 5.4. my composer.json following: { "name": "

javascript - How to take html script from text form and execute it in a new window? -

i trying make html , javascript executor don't know how take text text form , execute in new window. in w3schools. they way w3schools post data text frame , in second frame, runs page document. on clicking submit, change contentwindow.document value equal html user entered

linux - Access docker.sock from inside a container -

i'm running jenkins docker container need build , run dockers. container started using -v /var/run/docker.sock:/var/run/docker.sock . problem i'm getting access denied when jenkins (from inside container) tries use it. this i've tried far no luck: create jenkins user in host , add docker group. start docker daemon -g jenkins parameter socket owned jenkins group instead of docker one. jenkins being executed jenkins user belongs jenkins group inside container. the thing worked "hack" don't @ all: i've modified id of jenkins group inside container match group id of docker.sock . any suggestion on how solve in more elegant way appreciated. this sounds basic unix permissions problem. access file (or socket), need either (a) root or (b) have numeric uid or gid permits access based on file mode. if running inside container , want have access on host, you're going have either run things inside container root or you're going have

linux - Would integration with DPDK be beneficial in terms of performance for a DNS/DHCP/DNSSEC server? -

dpdk seems provide impressive performance boost applications don't think servers benefit as things routers/switches. i haven't seen mention of being done or worked on wondering if might worth working on. dpdk on own provides layer 2 (i.e. ethernet) access device. first need build layer 3 (i.e. ip) , layer 4 (i.e. tcp/udp) stack on top of it. can use kni around this, don't think (somewhat small) performance benefits in case. even after getting layers still wouldn't because odds packets getting application (the big thing dpdk optimizes) isn't bottleneck in dns or dhcp (unless perhaps simple, bare-bones implementations). some other caveats include needing dedicate @ least entire core dpdk and, in cases, dpdk take on entire interface, meaning can't use else.

python - How to read first line of a file twice? -

i have big files many lines , want read first line first , loop through lines starting first line again. i first thought it: file = open("filename", 'r') first_line = file.readline() dostuff_1(first_line) line in file: dostuff_2(line) file.close() but issue script first line passed dostuff_2 second line , not first one. don't have intuition of kind of object file is. think iterator , don't know how deal it. bad solution found file = open("filename", 'r') first_line = file.readline() count = 0 line in file: if count == 0: count = 1 dostuff_1(first_line) dostuff_2(line) file.close() but pretty dumb , computationally bit costly runs if statement @ each iteration. you this: with open('filename', 'r') file: first_line = file.readline() dostuff_1(first_line) dostuff_2(first_line) # remaining lines line in file: dostuff_2(line) note changed code use w

html - Div loses height in angular app - background cover stops working -

i had simple html app used background cover image. following code worked fine. body{ width: 100%; height: 100%; margin: 0 0; padding: 0 0; } .mainbody{ width:100%; height: 100%; background: url("/images/background.jpg") no-repeat fixed center; background-size: cover; margin: 0 0; padding: 0 0; } however, when created simple angular app w/bootstrap , used same code, mainbody div lost height component , image fails show. the html simple , straightforward: index.html <body ng-app="testapp"> <div ui-view=""></div> root.html <div class="mainbody"> <div class="navtitle"> <span class="title">recordings</span> </div> <div class="navmenu"> <!-- <span class="fa fa-twitter menu twitter"></span> --> <span class="menu">about</span> <span cl