Posts

Showing posts from May, 2012

html - Center link in an unordered list element (flexbox) -

i've been playing around flex box , center "logo" test in upper left corner vertically in blue container. you can see here: http://codepen.io/timros/pen/mwkngw * { margin: 0; padding: 0; } .box { color: white; font-size: 80px; text-align: center; text-shadow: 4px 4px 3px black; } /* colors & style ===================================== */ .main-header { background: #e3e3e3; } .main-footer { background: #e3e3e3; } .main-content { background: #e3e3e3; } .main-wrapper { box-shadow: 2px 2px 10px #333; } .main-wrapper { width: 80%; margin: 0 auto; } /* head ===================================== */ .main-header { width: 100%; height: 100px; border-bottom: 1px solid black; } .main-nav { list-style: none; display: flex; flex-flow: row wrap; justify-content: flex-end; align-items: flex-end; height: 100%; } .main-nav li { margin-left: 8px; margin-right: 8px;

javascript exceptions, not caught by debugger after installing typescript 1.4 with VS 2013 -

javascript exceptions, syntax errors not caught debugger after installing typescript 1.4 vs 2013. an example of code ("whaever" doesn't exist - it's fake object , function): whatever.show("something"); debugging in .ts files works fine, code sits in .js file unrelated typescript. should caught vs debugger when trying execute it. instead, stops executing js code current file , skips after code above without throwing exceptions. i've tried uninstalling, repairing, reinstalling typescript - , uninstalled/reinstalled vs2013. anyone else encountered issue? you may need update version of typescript project using. set 1.0, should set 1.4 or whatever version of compiler have installed. might confusing tooling or failing build entirely. in project file: <typescripttoolsversion>1.0</typescripttoolsversion> another potential issue if map files not set output during compilation: <typescriptsourcemap>true</typesc

Displaying list in Android fragment -

i got fragment should display list every time try display list previous activity displayed in background. so question is, how display list on empty page? can put instead of getactivity() in arrayadapter. my xml looks this: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <listview android:id="@+id/fundraiser" android:layout_width="match_parent" android:layout_height="wrap_content" > </listview> and code looks this import android.os.bundle; import android.support.v4.app.listfragment; import android.view.view; import android.widget.arrayadapter; import android.widget.listview; import android.widget.toast; public class fundraiserfragment extends listfragment{ string[] values =

Force C++ source file to implement header file in Visual Studio -

is there plugin or option force *.cpp file "implement" *.h file? way *.cpp file not compile unless declared methods implemented. compiles when implementation missing , if project static library builds successfully. i know have problems templates fine force implementation of non-template methods.

java - Palette (Android Support v22) doesn't generate Swatches -

first of all, never used palette, when wanted start it, see tutorials , blogs talk v21 , not v22. my problem have swatch (in position 0 of swatch's array [palette.getswatches().get(0)]) returns black (title , body), here example i'm using this, maybe it's wrong i'm copying https://developer.android.com/reference/android/support/v7/graphics/palette.html palette.from(bitmapfactory.decoderesource(getresources(),r.drawable.prueba2)).generate(new palette.paletteasynclistener() { @override public void ongenerated(palette palette) { text.settextcolor(palette.getvibrantswatch().getbodytextcolor()); text.setbackgroundcolor(palette.getvibrantswatch().gettitletextcolor()); } }); when start app (i have activity textview , imageview) closes saying this caused by: java.lang.nullpointerexception: attempt invoke virtual method 'int android.support.v7.graphics.palette$swatch.getbodytextcolor()' on null obj

Android Change Font Menu Items -

Image
im trying change font of menu items custom font. in action bar dropdown menu couple of options. when pick 1 these options, title of item in actionbar changes optiontext , apply font. because applied te font in overrided 'onoptionitemselected(menuitem item)'. want font applied when menu gets created (it uses default font right now). attempted in 'oncreateoptionsmenu(menu menu)', keeps giving me error (null pointer exception). tried multiple overrided methods, nothing seems work. how can custom font applied menu item when it's been created? here code: @override public boolean oncreateoptionsmenu(menu menu){ log.d("graphactivity", "oncreateoptionsmenu"); menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.menu_graph, menu); optionmenu = menu; boolean daymatch = user.getinstance().getdownloadedday() == user.getinstance().getcurrentday(); boole

php - CakePHP 2 Internal Server Error -

before moving on want mention have tried answers in web in vain. i tasked investigating why our cakephp-based website no longer working on our staging server. when loading site @ times loads completely, when logging user in takes forever authenticate such produces internal server error . step 1: have checked cache directory both persistent , models , clean. step 2: configure::write value debug set 2. nothing gets written on error.log file. could have session data? trying figure out what's going on , have tried looking lib folder cake see if can edit files in there see website outputs instead of internal server error message. file should edit in there? followed this link seems core different version. it turned out there issue sap server connection kept pages on loop until timeout resulting internal server error. evident of fact live website working fine. i think best solution tweak sap server connection component such doesn't timeout requests. as lack kn

id3 - Searching for a song with Zenity in Bash -

i've got problem bash project. it's simple songs id3 search app. there bug when find song, $song doesn't concatenate $found . works until print them below separator line. going wrong? title="" found="" while [ 1 -eq 1 ]; output=$(zenity --forms --title="search" --text="search id3" --separator="," --add-entry="song title") if [ $? -eq 0 ]; title=`echo $output | cut -d "," -f 1` find . -name "*.mp3" -print0 | while read -d $'\0' song echo "$song" if [ "$title" ]; if id3info "$song" | grep "=== tit2" | grep -q "$title"; found="${found}${song}" echo "found song: $song" echo "all: $found" fi fi done echo "=======================

jQuery - Allow only two decimal values -

code: <input onkeypress="return isnumberkey(event)" type="number" value="" /> function isnumberkey(evt){ var charcode = (evt.which) ? evt.which : event.keycode if (charcode > 31 && (charcode < 48 || charcode > 57) && charcode != 46){ return false; } return true; } the above function allows user enter value more 2 decimal i.e. 10.5678 . how can modify function , restrict user enter values upto 2 decimal i.e. 10.56 try below code give class number element $('.number').on('keypress',function (event) { if ((event.which != 46 || $(this).val().indexof('.') != -1) && (event.which < 48 || event.which > 57)) { event.preventdefault(); } var input = $(this).val(); if ((input.indexof('.') != -1) && (input.substring(input.indexof('.')).length > 2)) { event.preventdefault(); } }); and java

java - Maven Cobertura plugin generating incomplete coverage report -

i'm using: mvn cobertura:cobertura to generate coverage report project. isn't configured in pom.xml file, it's using latest version of plugin (currently 2.6). for part works ok, reason 1 class has odd report. seems reporting lines have been covered, other lines (which right next it) not. i've been running: mvn clean of course, doesn't seem help. overall it's reporting 1% coverage, quite key class know getting used lot. know reports used work ok. i'm not sure when stopped working, i've not inspected class's coverage while. as example of i'm seeing: 2053 private final list<entityproperty<t>> properties = new arraylist<entityproperty<t>>(); private final propertydescriptor idproperty; 0 private final set<string> fieldorder = new linkedhashset<string>(); 0 private final map<string, string> additionalfieldlabels = new hashmap<string, string>(); this initialiser

eclipse - BIRT Mathematics on data set -

i pretty new birt reporting, can make simple charts , tables, bet when comes calculation of values data sets - have no clue in direction should watch. for example have simple data set: count1 count2 max type lenght 616 3858 21 steel 20 723 4432 14 steel 40 854 5869 21 20 838 5225 14 40 and have birt calculate approximately this: sum(count2)/sum(count1) type=all so this ((5869+5225)/(854+838)) my question how there. @ point think need right direction how these kind of operations made. thanks in advance. i presume want display value somewhere on report, @ bottom of table data presented. if case add aggregation data element footer of table data displayed. in aggregation data element have opportunity specify expression sum(count2) , filter condition [type=all]. can division in data element. if want compute value described you sql, i.e. select sum(count2)/sum(count1) mytable type='

css - Possibility CSS3 Border similar to image -

Image
i'm interest know if it's possible create border css3 similar following image? use box-shadow body { background: grey } div { position: absolute; width: 70%; height: 30%; top: 0; right: 0; bottom: 0; left: 0; margin: auto; background: #666; /* box shadow applies effect you're after */ box-shadow: inset 0 -18px 16px -16px #444, 0 6px 6px -7px #fff, 0 14px 8px -7px #444; } <div></div>

python - auth views not rendering templates in django -

this entire urls.py file have designed custom templates reset password functionality from django.conf.urls import include, url django.contrib import admin django.conf import settings urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^articles/', include('article.urls')), url(r'^', include('django.contrib.auth.urls')), url(r'^password_reset/$', 'django.contrib.auth.views.password_reset',{'template_name': 'reset_password.html'}), url(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done',{'template_name': 'password_reset_done.html'}), url(r'^reset/(?p<uidb64>[0-9a-za-z_\-]+)/(?p<token>[0-9a-za-z]{1,13}-[0-9a-za-z]{1,20})/$', 'django.contrib.auth.views.password_reset',{'template_name': 'password_confirm.html'}), url(r'^reset/done/$', 'django.contrib.auth.views.pas

sockets - Manage serial port from two processes simultaneosly -

i have following scenario: rasperry pi connected device via serial port 3g dongle connected raspberry (with ability make/recieve calls) one process reading data serial port , redirecting server (using 3g) another process waiting incoming call, , when calls program takes data serial port , redirect via 3g dongle using @ commands ( fax-call). when calls, call made using @ commands , caller should able "speak" final device connected serial port. the problem 2 processes can not live since using same serial port, , when 1 process started, other can not read data serial (port busy). is there way achieve ? can make "fake" serial port, or redirects data? thank much you may write single service communicates real serial port offers 2 virtual serial ports described here virtual serial port linux

php - Replace string dynamically -

how can remove string: class="size-full wp-image-1561 " from string: class="size-full wp-image-1561 " alt="class-a warehouse facility developed panattoni europe in germany rudolph logistik gruppe." src="http://europe-re.com/wp-content/uploads/2012/12/class-a-warehouse-facility-developed-by-panattoni-europe-in-germany-for-rudolph-logistik-gruppe.jpg" consider class changes every record. how can dynamically? "remove class="(whatever inside here)" full string. thank in advance! if regex means have @ hand, can match \bclass="[^"]*"\s* the, replace empty string. \b makes sure matching class , not subclass . with [^"]* , can match 0 or more characters other " . with \s* , can trim string automatically. see demo however, if deal php, you'd better using domdocument . similar to $html = <<<html <div id="res">some text inside div <img class="

javascript Countdown timer with weeks and months -

i need countdown script calculate difference between 2 dates, in months, weeks, , days. i know timespan.js , countdown.js, scripts work days. script use months , weeks? preferable dates in yyyy-mm-dd format how moment.js? there 'months' feature? https://www.google.com/search?client=safari&rls=en&q=moment.js+difference+between+two+dates+in+months&ie=utf-8&oe=utf-8

ruby on rails - How to set multiple pidfile in sidekiq.yml file? -

from official wiki page of sidekiq found: https://github.com/mperham/sidekiq/wiki/advanced-options --- :concurrency: 5 :pidfile: tmp/pids/sidekiq.pid staging: :concurrency: 10 production: :concurrency: 20 :queues: - default - [myqueue, 2] now want create multiple tasks using same sidekiq.yml file. use different pid name, such as: /tmp/pids/task1.pid /tmp/pids/task2.pid how write in sidekiq.yml ? you cannot that. pidfile designed command line arg only.

Opening a link in a new tab is working for Firefox but not working for Chrome browser using Selenium -

i have test need open link in new tab. must work in firefox , chrome. first tried gmail link on google page. on firefox works perfectly, gmail opened in new tab. on chrome gmail page opened in same window , menu remains open after right click. has come across problem? beneath sample code. firefox code: firefoxprofile myprofile; profilesini profile = new profilesini(); myprofile = profile.getprofile("seleniumauto"); webdriver driver = new firefoxdriver(myprofile); driver.get("http://www.google.com"); driver.manage().window().maximize(); actions = new actions(driver); webelement e = driver.findelement(by.xpath("/html/body/div/div[3]/div[1]/div/div/div/div[1]/div[2]/a")); a.movetoelement(e); a.contextclick(e).sendkeys(keys.arrow_down) .sendkeys(keys.enter).build().perform(); chrome code: chromeoptions options = new chromeoptions(); options.addarguments("--test-type"); webdriver driver = new

c# - What's the difference between the two processes? -

the first 1 using ienumerable single method , has invalidoperationexception. rowobjecttype = rowobjectassemblytypes.single(type => type.name == rowobjecttypename); i think second 1 same thing first 1 , works fine. foreach (var type in rowobjectassemblytypes) { if (type.name == rowobjecttypename) { rowobjecttype = type; } } i'm using .net3.5. can tell me difference between them? the first 1 crashes because there 0 items or more 1 item. bug , single alerted that! the loop doesn't care. might never assign rowobjecttype or multiple times. that's semantically not want. if expect 0 items use singleordefault .

parsing - How do you parse and process HTML/XML in PHP? -

how can 1 parse html/xml , extract information it? native xml extensions i prefer using 1 of native xml extensions since come bundled php, faster 3rd party libs , give me control need on markup. dom the dom extension allows operate on xml documents through dom api php 5. implementation of w3c's document object model core level 3, platform- , language-neutral interface allows programs , scripts dynamically access , update content, structure , style of documents. dom capable of parsing , modifying real world (broken) html , can xpath queries . based on libxml . it takes time productive dom, time worth imo. since dom language-agnostic interface, you'll find implementations in many languages, if need change programming language, chances know how use language's dom api then. a basic usage example can found in grabbing href attribute of element , general conceptual overview can found @ domdocument in php how use dom extension has been covered exte

scala - In Slick 3.0, how to simplify nested `db.run`? -

i'm using slick 3.0, , following codes: def registermember(newmember: teammember): future[long] = { db.run( teamprofiletable.filter(u => u.id === newmember.id).result.headoption ).flatmap { case none => future(-1) case _ => db.run( (teamprofiletable returning teamprofiletable.map(_.staffid)) += newmember.toteamrecord ) } } this may ok. when there more layers of callback, codes may become hard read. tried simplify codes using for-expression or andthen .. due pattern matching part, can use flatmap implement this.. does have ideas how refactor this? i think comprehension should okay here, need conditional handling of option in result of first future . should work (note did not compile check this): def registermember(newmember: teammember): future[long] = { for{ r1opt <- db.run(teamprofiletable.filter(u => u.id === newmember.id).result.headoption r2 <- r1opt.fold(future.successful(-1l))(r1 => db.run((

c# - Keep focus on main window while doing lengthy operations -

i have wpf application calls dll when user clicks on button. dll lengthy operations , while that, cannot interact mainwindow, e.g scroll down datagrid logging update messages, switch tabs etc. how can keep mainwindow activated while dll running ? thought backgroundworker calls .activate() method whenever window.deactivated occurs, wouldn't terribly resource-consuming , slow down other dll takes lot of time ? i'm waiting suggestions :) thank you it seems running lengthy operation in ui thread. try running in separate thread. private void button_click(object sender, routedeventargs e) { task.factory.startnew(calllengthydllmethod); } private void calllengthydllmethod() { thread.sleep(10000); // simulating lengthy operations messagebox.show("done!"); }

java - MySql syntaxErrorException when manually building SQL query with AND or OR conditions -

i developing simple web appilcation using jsp,servlets , mysql. have table called annotations in mysql database. fetch records based on 'or' , 'and' mysql. unfortunately getting jdbc-mysql synatax exception. i'm composing sql query below: dbconnection=new dbconnection(); connection=dbconnection.setconnection(); transcript_id=request.getparameter("transcript_id"); condition_1=request.getparameter("condition_1"); // can "or" or "and". gene_symbol=request.getparameter("gene_symbol"); condition_2=request.getparameter("condition_2"); // can "or" or "and". molecular_function=request.getparameter("molecular_function"); condition_3=request.getparameter("condition_3"); // can "or" or "and". biological_process=request.getparameter("biological_process&q

r - Converting string to numeric -

this question has answer here: how convert factor integer\numeric without loss of information? 5 answers i've imported test file , tried make histogram pichman <- read.csv(file="picman.txt", header=true, sep="/t") hist <- as.numeric(pichman$ws) however, different numbers values in dataset. thought because had text, deleted text: table(pichman$ws) ws <- pichman$ws[pichman$ws!="down" & pichman$ws!="nodata"] however, still getting high numbers have idea? i suspect having problem factors. example, > x = factor(4:8) > x [1] 4 5 6 7 8 levels: 4 5 6 7 8 > as.numeric(x) [1] 1 2 3 4 5 > as.numeric(as.character(x)) [1] 4 5 6 7 8 some comments: you mention vector contains characters "down" , "nodata". expect/want as.numeric these values? in read.csv

screeps - Is there any way to change the spawn location? -

currently new creep spawn 1 square above spawn or in next available clockwise position. is there way choose newly created creeps go? you can't can make moving after created flag. if(game.flags.flag1 !== undefined){ creep.moveto(game.flags.flag1); }

c# - standard textbox doesn't get default DateTime value -

i'm building mvc c# application , can't seem find solution this. i'm guessing it's silly. it's bit of simplified example i'm telling right now, it's accurate. have modelled view, @model xxx.store , in there show table of items, fruit models . each table entry has expire date. use jquery's datepicker ui friendly datepicking, have trouble setting default value in textbox existing value. know data gets saved, see in database, doesn't show on web page. @foreach(var item in ...) ... <input type="text" onchange="updateexpiredate(this.value, @item.loginid);" class="datepick" value="@item.expiredate.tostring()" /> ... so value part, doesn't work. i've thought using html.textboxfor(...) points central modal, store class, i'm not using in table. also might important note, expiredate value nullable. no exceptions thrown in visual studio or chrome's d

Vagrant fails to provision docker container -

my vagrantfile: vagrant.require_version ">= 1.6.0" vagrantfile_api_version = "2" env['vagrant_default_provider'] = 'docker' vagrant.configure(2) |config| config.vm.provision :chef_solo |chef| chef.add_recipe "tomcat" end config.vm.provider "docker" |docker| docker.create_args = ["-d"] docker.has_ssh = true end config.ssh.port = 22 config.ssh.username = "root" config.ssh.password = "password" end and dockerfile: from precise-prepared ##add scripts in docker image add ssh.sh /ssh.sh run chmod +x /ssh.sh run echo "root:password" | chpasswd expose 22 ##start ssh services during startup cmd ["/ssh.sh"] precise-prepared modified ubuntu:12.04 docker image. when i'm running vagrant command fails following error: vagrant attempted execute capability 'chef_install' on detect guest os 'linux', guest doesn't support capability. capabil

php - Prevent bots from scraping our content / overloading our server -

we planning offer job platform-service firms. have few thousand jobs offer our guest/visitors. since yesterday noticed our server-load crazy , when checked logs saw had multiple site-request per second different ip addresses. order in pages called indicate same user / bot we want available public if bots slowing our server massively down or forcing new hardware in trouble. we displaying our job-content in iframes, encoder like: http://www.tareeinternet.com/scripts/iframe-encoder/ help solve our problem? or options have? annoying since don't have user-sessions or recurring ip-addreses (i think using proxys switch regulary) have checked headers recurring data? if they, example, have recurring user-agent can can block those: apache : setenvifnocase user-agent "^wget" bad_bot setenvifnocase user-agent "^emailsiphon" bad_bot setenvifnocase user-agent "^emailwolf" bad_bot <directory "/var/www"> ord

can't access env['api.endpoint'] in grape middleware -

here use grape write api function. , want throttling api (api rate limit). lib/grape/extensions/grape_extension.rb module grape module extension module throttleextension def throttle(options={}) route_setting :throttle, options options end grape::api.extend self end end end lib/grape/middleware/throttle_middleware.rb module grape module middleware class throttlemiddleware < grape::middleware::base def before binding.pry end end end end lib/grape_throttle.rb require 'grape' require 'grape/extensions/throttle_extension' module grape module middleware autoload :throttlemiddleware, 'grape/middleware/grape_middleware' end end last, in config/application.rb require file.expand_path('../../lib/grape_throttle', __file__) config.middleware.use grape::middleware::throttlemiddleware and, when run rails s ,and call api, binding.pry has called. [1] pry(#&l

ios - How to find a correct path in Swift -

i got code documentation, can't find path file, need copy "contacts.db" file supporting files folder app in device not in simulator offline use. func copyitematpath(_ srcpath: string, topath dstpath: string, error error: nserrorpointer) -> bool srcpath = path file or directory want move. parameter must not nil. dstpath = path @ place copy of srcpath. path must include name of file or directory in new location. parameter must not nil. error = on input, pointer error object. if error occurs, pointer set actual error object containing error information. may specify nil parameter if not want error information. any highly appreciated. :) you can drag , drop "contacts.db" project navigator , after can find path of file way: let sourcepath = nsbundle.mainbundle().pathforresource("contacts", oftype: "db") after can copy file document folder of app , need document folder path: let doumentdirectorypath =

Angularjs, ng-view scope -

i have plunker here - http://plnkr.co/edit/pzsvkd9m4l1mkjlyluym?p=preview i'm using demo json here - https://api.myjson.com/bins/1hdr5 i'm using ng-view , ngroute display 2 pages. the first list of stories/posts pulled json file. displays part of content in json file - have limited amount of text. i'd able click on these , open new view displays full content of story/post clicked. i have added story.html opens when story/post clicked on first view. my problem comnecting scope story.html view. need know correct part of josn load match story/post clicked. var app = angular.module('myapp', ['ngroute']); app.service('myservice', function ($http, $q) { var deferred = $q.defer(); $http.get('https://api.myjson.com/bins/1hdr5').then(function (data) { deferred.resolve(data); }) this.getstory = function () { return deferred.promise; } }) .controller('myctrl', function ($scope, myserv

rest - RESTful WCF call is blocked until previous call is complete -

i've got simple wcf restful service being hosted in iis. call wcf using browser. call service simultaneously using different tabs in browser. below code service [servicecontract] public interface iwcfservice { [operationcontract] [webget(uritemplate = "dowork", responseformat = webmessageformat.json)] string dowork(); } public class wcfservice : iwcfservice { public string dowork() { string ret = "enter time " + system.datetime.now + " " + system.datetime.now.millisecond; system.threading.thread.sleep(10000); ret += ". exiting time " + system.datetime.now + " " + system.datetime.now.millisecond; return ret; } } and below web.config file <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.servicemodel> <behaviors> <servicebehaviors> <behavior name="wcfservice.wcfservicebehavior&q

javascript - i want to remove double quotes from a string without replace function -

i want remove double quote string "hello" word. i have array var ary = ['a', 'b' , 'c'] when take value array it's return string if use ary[0] = "a" want in value a . because have 1 json file contains { "a":{ "name" : "emma" }, "b":{ "name" : "harry" }, "c":{ "name" : "jonny" } } i want value here using array ary[0].name = emma note : used str.replace(/\"/gi,""); && str.replace(/"/gi,""); if other idea how can please replay asap. if understood requirement correctly, can use bracket notation obj['a'].name var obj = { a: { "name": "emma" }, b: { "name": "harry" }, c: { "name": "jonny" } }; var ary = ['a', 'b

amazon web services - Vagrant AWS ELB's registering -

hello trying create instances in aws using vagrant. works fine. but, if add availability zones elb has no instances , if create instance in aws using vagrant. vagrant creates instance , @ time of registering elb register's , de-registers , terminates instance? how resolve it? can register instance 2 elb's using vagrant? editor's note: so's role is, link not trusted. pasted vagrantfile here directly. vagrant.configure("2") |config| config.vm.box = "ubuntu_aws" config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box" config.vm.synced_folder "../.", "/vagrant", id: "vagrant-root" config.vm.provider :aws |aws, override| aws.keypair_name = "development" override.ssh.private_key_path = "~/.ssh/development.pem" aws.instance_type = "t1.micro" aws.security_groups = "development" aws.ami = "ami-c5afc2ac"

R : Fuzzy name match for variable size -

i have been working on matching source set master set of customer names while can achieved using -adist in r have been using 2 million of source set 500k of master set, here cant use adist not support long vectors, have chunked data small set have 70 k of source set , 20k of master set while here data sets size varies , hence can not use adist doesn't support variable size of sets , have tried various other ways achieve same amatch , pmatch , agrep not help, have referred these sites found couldn't find solution. super fuzzy name checking? faster r code fuzzy name matching using agrep() multiple patterns...? record linking , fuzzy name matching in big datasets in r r: string fuzzy matching using jarowinkler fuzzy string matching in r i have tried levenshteindist , levenshteinsim , jarowinkler have problem implementing huge dataframe , can find solution data frame similar this solution using jarowinkler different size of sets

Cannot install pysftp paramiko python -

if try install above packages using setup.py install . download error on https://pypi.python.org/simple/ecdsa : timed out -- packages may not found! error:could not find suitable distribution requirement.parse('ecdsa>=0.11') the timeout error getting because of network error. try setup.py directory sudo env http_proxy=proxyserveraddress:port setup.py install

android - Getting 'InternalServiceFault' exception when trying to invoke a svc webservice(hosted in IIS server) -

getting 'internalservicefault' exception when trying invoke svc webservice(hosted in iis server) using ksoap2 in android. exception happening : w/system.err﹕ soapfault - faultcode: 'a:internalservicefault' faultstring: 'operationformatter encountered invalid message body. expected find node type 'element' name 'getunits' , namespace ' http://tempuri.org/ '. found node type 'element' name 'getunits' , namespace ' http://tempuri.org/irestaurant/ '' faultactor: 'null' detail: org.kxml2.kdom.node@40c821a8 05-11 22:26:30.068 913-921/com.org.ansal.placemaorder w/system.err﹕ @ org.ksoap2.serialization.soapserializationenvelope.parsebody(soapserializationenvelope.java:137) request : <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:header/> <soapenv:body> <t

windows - Bamboo remote build agent cannot find powershell.exe after installing nodejs -

i installed nodejs on 1 of build servers (win server 2008 r2) hosts bamboo remote agent. after completing installation , doing reboot got stuck in following situation: the remote bamboo build agent running windows service user mydomain\myuser. when build inline powershell task executing fails error (from build agent log): com.atlassian.utils.process.processnotstartedexception: powershell not started ... java.io.ioexception: cannot run program "powershell" ... java.io.ioexception: createprocess error=2, system cannot find file specified loggin on server mydomain\myuser, have checked powershell in path: where powershell c:\windows\system32\windowspowershell\v1.0\powershell.exe i have tried restart service , reboot machine multiple times. no luck. thing works if execute scripts bat file absolute path powershell - not want that. i have searched solutions on this, though 1 seems related: hudson cannot find powershell after update powershell 3 - proposed solutions

statistics - Principal component analysis alternative for categorical and continuous variables in matlab -

in matlab, principal component analysis data mixture of categorical variables few continuous variables. my data consists of columns represent different variables, or example: name gender hair_color eye_color age height country i have never done type of analysis before, searching see this package possibly work? any suggestions and/or links simple tutorial examples sort of data appreciated!

jquery - disable bootstrap popover on a specific day click in fullcalendar js -

i using fullcalendar js. on dayclick function have binded bootstrap popover. working fine. want disable popover on specific dates on click. $('#calendar').fullcalendar({ header: { left: 'prev', center: 'title', right: 'next' }, defaultdate: '2015-02-12', editable: true, eventlimit: true, // allow "more" link when many events businesshours: true, selectable: true, selecthelper: true, dayclick: function(event,element,start, end, allday, jsevent, view) { $(this).popover({ html: true, placement: 'right', title: function() { return $("#popover-head").html(); }, content: function() { return $("#popover-content").html(); }, html: true, container: '#calendar' }); $(this).popover('toggle'); var eventdata; eventdata = { title: title, start: start, end: end }; $('#calendar').fullcalendar('renderevent', eventdata, true); // stick? = true //$('#calendar').fullcalendar(

go - Why can not I copy a slice with copy in golang? -

i need make copy of slice in go , reading docs there copy function @ disposal. the copy built-in function copies elements source slice destination slice. (as special case, copy bytes string slice of bytes.) source , destination may overlap. copy returns number of elements copied, minimum of len(src) , len(dst). but when do arr := []int{1, 2, 3} tmp := []int{} copy(tmp, arr) fmt.println(tmp) fmt.println(arr) my tmp empty before (i tried use arr, tmp): [] [1 2 3] you can check on go playground . why can not copy slice? the builtin copy(dst, src) copies min(len(dst), len(src)) elements. so if dst empty ( len(dst) == 0 ), nothing copied. try tmp := make([]int, len(arr)) ( go playground ): arr := []int{1, 2, 3} tmp := make([]int, len(arr)) copy(tmp, arr) fmt.println(tmp) fmt.println(arr) output (as expected): [1 2 3] [1 2 3] unfortunately not documented in builtin package, documented in go language specification: appending , copying sl

objective c - Performance/memory analyzing tool for production OSX application on customer site -

i need able analyzing performance/memory issues occurs on customer site osx production application written objective-c. as found: osxpmem – it’s main drawback need dump memory space in single file(it’s not possible me transfer ~4gb or more customer site - can zip bigger problem not support 10.10 yosemite. valgrind – not support 10.10 yosemite. is there tool out there ? (such windbg windows) btw @ development use instruments in case not help. thanks help apparently valgrind build, install, , work on osx 10.10 head of development branch in source repository, e.g. per yosemite-and-valgrind , http://kalapun.com/posts/checking-c-code-with-valgrind-on-yosemite/ however depending on how application works may have more luck leaks command-line tool or full-fledged instruments tool, xcode. haven't upgraded 10.10 yet try there, should still work in latest xcode 10.10. leaks attaches running process, better long-running processes can't shut down (cleanly), or c

c++ - VS2013 Auto Format can't handle braceless indents -

c++ auto format in vs2013 seems work well. however, stumbles when omit braces. if type: if (a) if( on entering left paren, auto complete kicks in , get: if (a) if () does know how disable particular auto-format? or better, there fix?

java - What is difference between Hibernate EAGER fetch and cascade-type all -

please explain difference between hibernate eager fetching , cascade-type all. in both configuration can load child object associated parent, difference between in. its simple :consider 2 entities 1. department , 2. employee , have one-to-many mappings.that 1 department can have many employee cascade=cascadetype.all , means change happened on departmententity must cascade employeeentity well. if save department , associated employee saved database. if delete department employee associated department deleted. cascade-type combination of persist, remove ,merge , refresh cascade types. example cascade type fetch type eager opposite of lazy.lazy default fetch type hibernate annotation relationships. when use lazy fetch type, hibernate won’t load relationships particular object instance. eager default load of relationships related particular object loaded hibernate. click here example.

javascript - Beaglebone Local jQuery Files not Loading -

i'm working on wireless robotics project utilizing node.js , jquery create webpage "controller". currently, code below, functionality limited working internet connection due downloading of scripts through internet addresses. goal allow function without internet connectivity <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <!-- jquery , jquery mobile --> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1

java - How can I execute a runable .jar file by double clicking on it? -

i have .jar file generated 3 sources: netbeans eclipse (using export) from cmd (jar cvmf manifest.mf output.jar input1.class input2.class ...) in last process created blank manifest.mf , command. when file got archived in .jar, opened winzip , edited manifest.mf. added main-class:input1. all 3 sources run fine on cmd through java -jar output.jar. nothing happens on double clicking them . i have tried this solution well. have set default .jar javaw.exe still not run. how fix this?

MySQL UUID_SHORT data type -

i have user table. primary key user_id has datatype bigint(20) . i generate user_id using uuid_short() via trigger below. issue warning when try insert record follows: warning: #1366 incorrect integer value: '' column 'user_id' @ row 1 my phpmyadmin trigger follows: begin set new.user_id=uuid_short(); end any reason why getting warning? have set datatype correctly? int four-byte signed integer, while uuid_short() returns 64-bit (i.e. 8 byte) unsigned integer. trying store 64-bit data type 4-byte int , mysql appears storing empty string '' field user_id . from mysql manual : uuid_short() returns “short” universal identifier 64-bit unsigned integer (rather string-form 128-bit identifier returned uuid() function). you should use bigint unsigned type instead.

elasticsearch - What is the best index.store.fs for timestamp based indices ( ELK stack) -

just stumbled upon page on es documentation index-modules-store . using timestamp based indices using elk stack. curious know index.store.fs best case. our on average index size 15gb , using 3 linux nodes running on vmware 64bit. in advance.

Java PDFBox setting custom font for a few fields in PDF Form -

Image
i using apache pdfbox read fillable pdf form , fill fields based on data. using below code (as per suggestions other answers) default appearance string , changing (as can see below, changing font size 10 12 if field name "field1". how bold field? documentation on order /helv 10 tf 0 g arranged? need set bold field? if understand right, there 14 basic fonts can use in pdfbox out of box (pun unintended). use 1 or more fonts signatures (cursive). out of box fonts that? if not, if have own font, how set in method written pdf? please note, below code works fine filling specific 'value' passed in method parameter in specific 'name' field of method parameter. thank ! public static void setfield(string name, string value ) throws ioexception { pddocumentcatalog doccatalog = _pdfdocument.getdocumentcatalog(); pdacroform acroform = doccatalog.getacroform(); pdfield field = acroform.getfield( name ); cosdictionary dict = ((pdfield)fiel