Posts

Showing posts from April, 2014

node.js - Nodejitsu Design Decisions -

why nodejitsu tend prefer doing things in node.js, e.g., forever & node-http-proxy , instead of using nginx or apache? we prefer things in c. don't use forever in production, use aeternum : https://github.com/opsmezzo/aeternum

android - Trouble implementing Material Theme -

i using this tutorial implement material theme existing app on pre android 5.0 devices. problem getting null pointer exception every-time call getactionbar().something or getsupportactionbar().something . here have done implement material theme. in values/styles.xml <resources xmlns:android="http://schemas.android.com/apk/res/android"> <!-- base application theme, dependent on api level. theme replaced appbasetheme res/values-vxx/styles.xml on newer devices. --> <style name="apptheme" parent="apptheme.base"/> <style name="apptheme.base" parent="theme.appcompat.light"> <item name="colorprimary">#1a7e99</item> <item name="colorprimarydark">#16657a</item> <item name="android:windownotitle">true</item> <item name="windowactionbar">false</item> </style> <style name="draw...

colors - how to create a coloring system with drag and drop -

i want create application children, coloring system drag , drop can not find tutorial, link tutorial please you can find usefull using link below. http://jqueryui.com/draggable/

jpa - Unable to Load Entities in Jboss Fuse ESB -

my meta-inf/persistence xml follows <persistence-unit name="jpapoc" transaction-type="resource_local"> <class>com.xxx.jpa.personentity</class> <provider>org.hibernate.ejb.hibernatepersistence</provider> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.oracle10gdialect" /> <property name="hibernate.hbm2ddl.auto" value="create" /> </properties> </persistence-unit> my meta-inf/spring/beans.xml follows <cxf:cxfendpoint address="/services/sm" id="sm" serviceclass="com.xxx.jpa.mywebservice"> <cxf:properties> <entry key="dataformat" value="pojo" /> <entry key="setdefaultbus" value="true" /> </cxf:properties> </cxf:cxfendpoint> <bean id="myprocessor" clas...

visual studio 2013 - How to change background of windows phone designer? -

Image
i'm developing windows phone app in visual studio 2013. by default phone designer's background black. hard design on if of resources (images, font colors, backgrounds) dark. is there way change background light color? in device window (design -> device window menu), can change theme dark light. affect designer , not change xaml. can change designer accent color , other properties too.

php - Looping through a csv with fgetcsv -

i have csv file 3 columns: email address , first name , last name . have got stage can print out array using following code: <?php $file = fopen("testemails.csv","r"); while(! feof($file)) { print_r(fgetcsv($file)); } fclose($file); ?> this prints array, every field in row. want print purely values in first column of row. how done, documentation on fgetcsv seems sketchy me (a relative beginner). thanks. the first example in fgetcsv documentation contains nuggets of need. http://php.net/manual/en/function.fgetcsv.php while (($data = fgetcsv($file)) !== false) { echo "email address " . $data[0]; } fgetcsv returns numerically indexed array of representing columns, want print first column.

windows - Manual entries missing in MinGW-MSYS -

i installed mingw msys on windows 8.1 computer can work in same conditions @ school (we work on debian) , @ home compiling c programs gcc, using makefile , manual. i installed manual command : mingw-get install msys-man but when type : man 2 read , message : no entry read in section 2 of manual is missing installation ? edit : seems there not single entry in man, when type man chmod , still "no manual entry chmod" message.

Celery + RabbitMQ stuck at mingle: searching for neighbors -

i encountered strange issue while trying system running on new machines. os: ubuntu 14.04.1 lts (gnu/linux 3.13.0-39-generic x86_64) packages: celery==3.1.13 django-celery==3.0.23 librabbitmq==1.5.2 broker: rabbitmq "3.2.4" after restart celery process gets stuck: [2014-11-10 18:32:55,792: info/mainprocess] connected amqp://user:**@172.16.10.6:5672/vhost [2014-11-10 18:32:55,804: info/mainprocess] mingle: searching neighbors tried find solution elsewhere. here found advice increase disk space available rabbitmq. checked docs , changed in rabbitmq.config file: {disk_free_limit, {mem_relative, 1.0}} now rabbitmq should have 6gb available, doesn't push celery ready state. tried configuring (as suggested) limit of open file descriptors in /etc/default/rabbitmq-server without effect. current rabbitmq status: [{pid,4131}, {running_applications, [{rabbitmq_management,"rabbitmq management console","3.2.4"}, ...

Can't add RelativeLayout programmatically in android -

i have xml layout file.this xml layout source code <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" > <relativelayout android:id="@+id/rot" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:background="#ff0000" > <imageview android:id="@+id/btn_categorry" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:layout_marginright="12dp" android:background="@drawable/ic_laun...

Python 2.7: reading from .txt to matrix -

this first post :) my question how can read binary array .txt file matrix? example have such file: 0000010101010 1101010101000 0010010010000 0000000000000 . . . and copy data matrix this: [[0,0,0,0,0,1,0,1,0,1,0,1,0], [1,1,0,1,0,1,0,1,0,1,0,0,0], [0,0,1,0,0,1,0,0,1,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0]] my problem i'm not using separator bits (a part of \n each line). do this:- open('new.txt') f: l = [map(int, line.strip()) line in f] print l output:- >>> [[0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0], [1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

c# - Odd Behavior with Ajax call to MVC Controller Method -

i experiencing odd behavior mvc, ajax , saved credentials. although have work around, wondering if me understand issue might be. i using datatables jquery plug-in display results of call controller's action method. here sample of call: $('#grdtournamentlist').on('init.dt', function () { $("input[name='tournamentselect']").on("change", function () { $('#btnmovenextstep1').removeattr("disabled"); }); }).datatable({ "ajax": { "type": "post", "contenttype": "application/json; charset=utf-8", "url": "quickstart/toptenmostrelevanttournaments", "data": {}, "datatype": "json", "datasrc": "" } }); }); if use code during user's firs...

c# - Is there an event handler called after ComboBox.Items.Clear()? -

i'm trying fire event when combo box has items cleared , cannot seem find appropriate handler. the code simply: combobox.items.clear() // fire event here. i have tried selectedindexchanged , selectedvaluechanged no luck. is there event handler called after clear() ? unfortunately, there no event can catch can see in the source . you handle cb_resetcontent win32 message: protected override void wndproc(ref message m) { if (m.msg == 0x014b /* cb_resetcontent */) { // } base.wndproc(ref m); }

uitableview - Autolayout a view to take up all space available -

Image
i trying setup tableview (or view) inside view controller using auto layout. want view take entire space available, configurations. i have tried sorts of things, tried searching solutions, haven't found straight forward way achieve this. is possible? if yes, can me giving pointers? adding more details: attached screenshot tableview embedded within tabbar controller item. have 4 pins sides, distance 0, , priority 1000. but, can see orange lines, looks missing constraints. missing? also, when run on iphone simulator, table view doesn't render had wished. here's screenshot. the table view doesn't extend sides, , margins different. in storyboard, select tableview , add 4 pin constraints. 1 edge parent view. follow picture below , ensure constrain margins unchecked then, if seeing same orange constraints, click on third constraints button on bottom right , select update frames next picture try adding datasource see real results on simula...

jquery - Javascript Parameters Function on Many Events -

i'm trying implement hammer.js swipe pages (like book) , did it. problem works var idhammer1 = document.getelementbyid("pagehoja1") //var hammertime = new hammer(myelement, hammeroptionspan); var objhammer1 = new hammer(idhammer1); objhammer1.on('panleft panright', function(ev) { //dblog("obj1 - gsceneactual antes: " + gsceneactual + " // x: " + ev.center.x + " y: " + ev.center.y); if (ev.type==='panleft') { if (!(gsceneactual===2)) { gsceneactual = 2; $(":mobile-pagecontainer").pagecontainer("change", "#pagehoja2", { transition: "slide", reverse: false}); } } else if (ev.type==='panright') { } }); but doesn't: var fswipe1 = function(ev) { //dblog("obj1 - gsceneactual antes: " + gsceneactual + " // x: " + ev.center.x + " y: " + ev.center.y); if (ev.type=...

perl - LWP::UserAgent getting 204 No Content response when POST in loop with multiple file contents -

i need post content multiple files, have read data multiple files , posting in loop. first file content post getting 200 ok response, second file content parsing second file content showing response 204 no content. below code. please me resolve this. #! usr/bin/perl require lwp::useragent; use http::request::common; $ex_ok = 0; $ex_tempfail = -1; $url = 'http://jeffbeck.corp.apple.com:6080/parser/post'; $dir = $argv[0]; $i = 1; opendir dir, $dir or die "cannot open dir $dir: $!"; @filename = map{s/\.[^.]+$//;$_}grep {/\.eml$/} readdir dir; foreach $file (@filename){ print "$file \t $dir \n"; $filepath = "$dir/$file.eml"; print "$filepath \n"; #open file input , process that. open (myfile, $filepath) or die "couldn't open file $filepath : $!"; while(<myfile>) { #$mailcontent = $mailcontent . $_ ; @content = <myfile>; } print ...

scala - How to extract an element from an HList with a specific (parameterized) type -

i'm chaining transformations, , i'd accumulate result of each transformation can potentially used in subsequent step, , results available @ end (mostly debugging purposes). there several steps , time time need add new step or change inputs step. hlist seems offer convenient way collect results in flexible still type-safe way. i'd rather not complicate actual steps making them deal hlist , accompanying business. here's simplified version of combinator i'd write, isn't working. idea given hlist containing a, , index of a, , function -> b, mapnth extract a, run function, , cons result onto list. resulting extended list captures type of new result, several of these mapnth-ified steps can composed produce list containing result each step: def mapnth[l <: hlist, a, b] (l: l, index: nat, f: => b) (implicit at: shapeless.ops.hlist.at[l, index.n]): b :: l = f(l(index)) :: l incidentally, i'll need map2nth taking 2 indices , f: (a...

ios - With Storyboards only, how do I create a UITableViewCell that can scroll left and right using UIScrollView? -

similar mail.app can scroll cells side side, want able in app using storyboards , uiscrollview uitableviewcell . i add buttons contentview of cell, , uiscrollview embedded uiview on top of contain main portion of cell. add label that. i understand scroll views in storyboard work specifying constraints show contentsize of scroll view should be. so position uiview in uiscrollview same width , height of scroll view, give trailing constraint of 50pt allow scroll view scroll. when run can move cell left reveal buttons. but work in other direction have no idea. if add leading constraint moves cell begin away left, offsetting cell begin when should left user scroll it. works fine other being pushed over. i created sample project showing here: http://cl.ly/2i3m1w2t0i3c like said can't seem figure out how scroll in both directions. try setting contentview of scrollview width higher scrollview itself. like: assuming scrollview.frame (0,0,100,100) [scrollvi...

asp.net - How to set REQUEST HEADER in spring Integration -

we have asp page reading information form request this: varlogon = request.servervariables("http_logon") if want post asp page using spring integration, unable pass http_logon page, this not working any idea, , how can set request header information? <int:header-enricher input-channel="pdfgenheaderchannel" output-channel="pdfgenchannel"> <int:header name="http_ordernumber" method="getordernumber" ref="reportbean"/> <int:header name="reportid" method="getreportid" ref="reportbean"/> <int:header name="content-type" value="text/html"/> <int:header name="logon" value="orderadcb"/> <int:header name="http_logon" value="orderadcb"/> </int:header-enricher> <int-http:outbound-gateway id="pdfgenerationoutboundgateway" request-channe...

Can any compilers recognize the optimization for this scenario? -

suppose have method (java chosen arbitrarily, similar language): public set<string> createset() {...} this method creates set adding strings it, 1 @ time. then suppose call here in loop many times: boolean contained = createset().contains(somestring); in ideal world, compiler recognize code improved creating separate method, increatedset(string) , run createset() , except instead of putting strings set, compare them against somestring directly, eliminate set creation , end method somestring found, no need continue (assuming no side effects). i know java compilers don't optimization @ compile time , wouldn't recognize in jit either, there optimizers out there able sort of advanced analysis of code?

helper - Rails Routing and link_to -

it's little late here maybe trivial question i'm missing simple. when click button (with link_to) created following gets appended url: %23<actionview::helpers::formbuilder:0x3ef1fd8> why this, , how can prevent this? again, apologize if shallow question. can post more information regarding routes , whatnot if needed. thanks! edit: more information requested. view: <%= link_to "index", welcome_path(f), :class => 'button' %> with f being part of form_for loop. think i'm passing wrong parameter i'm unsure. relevant route: get "index" => 'welcome#show', :as => 'index' update: thanks everyone. ended getting working pluralizing controller (i don't know why didn't have before) , utilizing welcome_url instead. seemed trick. check out first example , paragraph in rails api docs actionview::helpers::formbuilder : <%= form_for @person |f| %> name: <%= f.text_field...

ios - How to trigger UIButton action programmatically -

i have several buttons in 1 class , actions separate. created instance of class in class. , have uibutton array in 2nd class. want call each buttons action programmatically. there way in ios. uibutton has method invoke targets/selectors linked control event: [button sendactionsforcontrolevents:uicontroleventtouchupinside];

Android Studio "Find usages" found results in generated sources. How to disable it? -

Image
it's annoying android studio try find name/expression in generated sources. look @ screenshot below: does know how disable "find usages" specific directory eg. "build", "genarated" etc?

sql - Best way to handle multiple table query linked to "main" table -

i tracking visitor sessions , have "master" table contains session start, end , visitor info. create table "sessions" ( session_id bigserial primary key, session_start timestamp not null, session_end timestamp not null user_ip text not null, user_agent text not null ) for each session have 3 metrics - pageviews, downloads , video plays. each table follows formula create table "sessions_<x>" ( session_id bigint references sessions (session_id), data_1 text not null, data_2 text not null, ... ) the 3 tables not identical, data not important - thing share session_id reference sessions table. data inserted so, in single transaction, relevant pageview/download/video play record added , session_start / session_end updated. for code, wish extract each session associated pageviews, downloads , video plays. in effort minimize number of queries figured i'd following: do query on sessions table ide...

dynamic sql query for inserting week and month -

i want create table. create table script create table [dbo].[dimtenure1] ( [tenureweekid] [int] identity(1,1) not null, [tenureweek] [smallint] not null, [tenureweekband] , [tenuremonth] [smallint] not null, [tenuremonthband] , ) i have create tenureweekband , tenuremonthband dynamic. for eg when user enter 1 in tenureweek automatically calculated in tenureweekband showing below. what can define in create table script tenureweekband , tenuremonthband columns? table tenureweek tenureweek tenuremonth [tenuremonthband] 1 week of 1 enrollment 1 month of 1 enrollment 2 week of 2 enrollment 1 month of 1 enrollment 3 week of 3 enrollment 1 month of 1 enrollment 4 week of 4 enrollment 1 month of 1 enrollment 5 week of 5 enrollment ...

sql server - Stored procedure in T-SQL transform to PostgreSQL -

i have stored procedure writen in t-sql , want make postgresql i'm not familiar postgresql. my stored procedure this: create procedure usp_insert_allocated_time @fld_project_id int, @fld_allocated_time int declare @project int; set @project = @fld_project_id; declare @allocated int; declare @time int; begin set @time = (select sum(fld_allocated_time) dbo.tbl_project_timesheet fld_project_id =@project) set @allocated = (select fld_allocated_days dbo.tbl_project fld_id = @project); if @allocated > @time begin insert dbo.tbl_project_timesheet(fld_project_id,fld_allocated_time) values(@fld_project_id,@fld_allocated_time); end else print 'not ok'; end and have this, on line 10 error: error: invalid input syntax integer: "293.00" sql state: 22p02 context: pl/pgsql function "sa_prj".usp_add_timesheet_record_new(integer,integer,numeric,numeric,character varying,character varying) line 10 @ assignment...

javascript - How to reference a module variable in an expression? -

i have module , it's variable defined this var app = angular.module('app',[]); app.value( 'image', { id: null, url: null, } ); in module controller set variable value later on after ajax call. actual value of variable set correctly check controller after call. i try reference variable html code this <html ng-app="app"> ... <img ng-src="{{app.image.url}}"> for reason expression evaluated empty string. doing wrong? this happens because app not defined in $scope , have set it: angular.module('app').controller('somecontroller', function(image) { $scope.image = image; }); then in view: <html ng-app="app" ng-controller="somecontroller"> ... <img ng-src="{{image.url}}">

visual studio 2013 - Library/Static Method not Updating in Azure -

i wrote static method in mvc (webapi) website. static method had bug in it, changed logic in static method. method works on local machine , returns correct data. however, azure still running old method , returning incorrect results. thing compile library locally , ftp azure. why old static method being retained - after build , deployment? note: i'm doing manual build/deployments visual studio online/tfs (i'm not deploying visual studio). have rebuild , clean flags set on msbuild. update: after looking @ file sizes, apparently azure deploying older version of dll dll that's deployed larger 1 i'm compiling locally. is new dll included in file list can see in preview before publish website? publish options dll? i assume using azure websites? correct?

java - Setting treshhold in grammar-file of PocketSphinx keyword detection -

i`m trying author of thread did/solved: recognizing multiple keywords using pocketsphinx he says grammar-file should avoid detection of words not in grammar-file: up /1e-1/ down /1e-1/ left /1e-1/ right /1e-1/ forwards /1e-1/ backwards /1e-1/ ....but doesnt work if this. can this: #jsgf v1.0; grammar digits; public <digits> = /1e-1/ left | /1e-1/ right; but doesnt change anything, neither /1.0/ change anything. keeps detecting false words left/right. putting threshold on right side of each word (like author) leads app-crashing. can me on this? update: i solved it, using addkeywordsearch in function setuprecognizer(file assetsdir). still in pocketsphinx-demo addgrammarsearch in case. completeness (just setuprecognizer function of author of linked question): private void setuprecognizer(file assetsdir) { file modelsdir = new file(assetsdir, "models"); recognizer = defaultsetup().setacousticmodel(new file(modelsdir,...

sql - How do I determine whether a cell in the first record of a customers history contains a value? -

i have tickets table holds several years of customer data. trying determine whether customer has visited x number of time used coupon on first visit. have (sql below) using can break out group looking for. want know group how many of them used coupon on first visit (earliest saledate). ;with t ( select customerid, saledate, totalcoupons, count(*) on (partition customerid) cnt store.dbo.tickets (creationdate between '2014-1-1' , '2014-11-12') , (isdeleted = 0) , (ticketstatus = 'complete') ) select customerid, saledate, totalcoupons, cnt t cnt = 10 order customerid, saledate as end result need count , don't need see customerid, saledate etc, need (pseudo) select count(customerid) totalcoupons cell has value on , earliest record customerid. i think have add rowid , use rowid = 1 not sure how work have done. you can use row_number() determine first visit , use conditional aggregation. following...

css - duplicate social icon on easy way with reverse color -

Image
im making responsive website , top have navigation social icons , want hover each icons color. during editing in photoshop dont know technique put color easy way. problem icon small when comes putting color takes time.i have 5 icons on website there : google , facebook, twitter , pinterest , rss . you need change icon using css :hover selector. try this: html <a class="icon" href="#"></a> css a{ background-image: 'image.png' width: 32px; } a:hover { background-image: 'hover-image.png' }

Fatal error wordpress xml importer -

i getting error while importing xml file wordpress xml importer fatal error: allowed memory size of 268435456 bytes exhausted (tried allocate 267029717 bytes) in c:\xampp\apps\wordpress\htdocs\wp-content\plugins\wordpress-importer\parsers.php on line 66 note : (size of xml 250m , please not suggest xml splitter) steps tried 1 > php.ini memory_limit=5000m (didnot workout) 2 > .htaccess php_value memory_limit 5000m (didnot workout 500 error) 3 > wp-config.php define('wp_memory_limit', '5000m'); (didnot workout) environment : local server xampp (latest). any idea !

asp.net - Error in converting base64 string to image c# -

Image
i want display image on web page , while clicking link button should download. image file stored stored binary format in db. while converting base64 string image showing error. details given below. me find proper solution. thank you. error: code: protected void page_load(object sender, eventargs e) { if (!ispostback) { pdfdatasettableadapters.tbl_imgtableadapter td; td = new pdfdatasettableadapters.tbl_imgtableadapter(); datatable dt = new datatable(); dt = td.getid(); dropdownlist1.datasource = dt; dropdownlist1.datatextfield = "id"; dropdownlist1.datavaluefield = "id"; dropdownlist1.databind(); dropdownlist1.items.insert(0, new system.web.ui.webcontrols.listitem("--select id--", "")); } } protected void button1_click(object sender, eventargs e) { pdfdatasettableadapters.tbl_imgtableadapter td; td = new pdfdatasettableadapters.tbl_imgtableadapter...

java - CGlib-wired bean is recreated each time its method is invoked -

i'm observing strange behavior prototype-scoped class-proxied spring beans. i'm using spring 4.1.2. i'm creating single bean manually, invoke method 3 times. on each method invocation new class instance gets created - code below prints new id. means cannot reliably store state inside bean. expected : single instance of class. observed : each bean method invocation leads new class instance creation. i've dug cglib - acquires target spring bean bean factory each method invocation. spring bean factory happily creates new bean each time (since prototype bean). is expected behavior or bug? @component @scope(value = configurablebeanfactory.scope_prototype, proxymode = scopedproxymode.target_class) public class beanclass1 extends someabstractclass implements i1, i2 { public void tellme() { system.out.println(this); } } beanclass1 bean = beanfactory.getbean(beanclass1.class); bean.tellme(); bean.tellme(); bean.tellme(); i've switch...

c - Prime numbers using Interface -

how write code prime number generator using specified interface. i think asked. int isprime(int i) { int j; if(i == 1 || == 2) return 1; if(i % 2 == 0) return 0; (j = 3; j < sqrt(n); j += 2) if (i % j == 0) return 0; return 1; } void generator(int start, int end) { int i; if(start > end) { int temp = start; start = end; end = start; } (i = start; i<=end; i++) if(isprime(i)) printf("%d\n", i); } int main() { generator(7900, 7920); return 0; }

function - Understanding singleton object in Javascript -

i'm having trouble understanding happens when instance calls new universe(). doesn't return "undefined"? function universe() { var instance; universe = function universe() { return instance; } universe.prototype = this; instance = new universe(); instance.constructor = universe; instance.start_time = 0; instance.bang = "big"; return instance; } it wont return undefined instead of return object.see in alert box or in console; function universe() { var instance; universe = function universe() { return instance; } universe.prototype = this; instance = new universe(); alert("ins"+instance);//or console.log(instance); instance.constructor = universe; instance.start_time = 0; instance.bang = "big"; return instance; } alert(universe());//or console.log(universe()); ...

ios8 - iOS: Failed to load Asset Catalog JPEG images -

according wwdc 2014, asset catalogs support jpeg images format. added jpeg image asset catalog, , referenced image in storyboard. however, image appears white/blank. i have tried suggestions in " how can add jpegs asset catalog in xcode? ", problem still exists. your appreciated! did try set ' render as.. ' option image ' always original ' in right panel of asset catalog editor?

filesystems - How Cassandra file system interacts with platform file system -

i doing research regarding nosql. have found 2 dbs close require implementation. just wondering how file system of these nosql interacts windows/linux file system? for instance, cassandra uses cassandra file system, case virtual file system of jre/jdk, interacts platform file system? the cassandra file system not required use cassandra. cfs comes datastax enterprise , isn't available in apache cassandra. not required or integrated in way normal cassandra operations. cfs built hdfs compatible filesystem use batch analytics software. implemented set of c* tables represented on disk data. because set of c* tables distributed cluster , act distributed fault tolerant filesystem.

forms - jQuery detect click on disabled submit button -

fiddle: http://jsfiddle.net/ugzux/ as can see, have form disabled (via javascript) submit button. i want able bind click event anyway, can jazzy indication of needs fixed on input before i'll allow form submitted (i.e enable button again). however, disabling submit button apparently disables click events bound button, if bound after disable - idea how around this? practically, 1 solution stop disabling button , instead have event does $('form').submit(function(event){ event.preventdefault(); }); however want know ins , outs of disabled inputs , javascript events, , if there workarounds i've never encountered behaviour before. found in question - firefox, , perhaps other browsers, disable dom events on form fields disabled. event starts @ disabled form field canceled , not propagate dom tree. correct me if i'm wrong, if click on disabled button, source of event disabled button , click event wiped out. browser literally do...

android - WearableListenerService only starting after application is installed - then never again -

i'm developing android applciation android wear support. the main application sends data android wear apps wearablelistenerservice, makes notification , displays it. my problem if restart watch, android wear app can never started again - since listener service on wear device doesnt start mobile app! i have tried force closing app , start again, reboot phone - no matter listenerservice can never started again. it works when install app android studio, , work until watch restarted. (i can reboot phone , close app) have had similar problem or know solution this? so i'm providing more info: when watch boots up, captured message in logs (which apparently root of problem): 11-27 17:22:08.974 803-830/com.google.android.clockwork.packageinstaller i/wearablepkginstaller﹕ sent delete request com.example.distributedmediaplayer 11-27 17:22:09.074 473-509/system_process i/activitymanager﹕ force stopping com.example.distributedmediaplayer appid=10032 user=-1: un...

Set selectedindex for comboboxcell in datagridview vb.net -

i trying set selectedindex datagridviewcomboboxcell through cellvaluechanged event,i.e when change value in datagrid row, column should automatically changed. here's code. private sub datagridview1_cellvaluechanged(sender object, e system.windows.forms.datagridviewcelleventargs) handles datagridview1.cellvaluechanged try if me.datagridview1.rows(e.rowindex).cells(2).value.tostring <> nothing me.datagridview1("unit_code", e.rowindex).value = "1" msgbox(me.datagridview1.rows(e.rowindex).cells(6).value) end if else exit sub end if end if catch ex exception messagebox.show(ex.message, "message", messageboxbuttons.ok, messageboxicon.error) end try datagridview bound dataset. searched many sites , did research, got above solution need set valuemember .value part. after doing gives sy...

Magento "parse error: syntax error" when I try to add or duplicate product -

in magento backend, when try add or duplicate product, error: parse error: syntax error, unexpected '$validatedpath' (t_variable), expecting function (t_function) in /home2/osarri/public_html/olasarri.com/app/code/core/mage/catalog/model/url.php on line 828 i haven't added products couple of weeks, worked fine then. help? so far have truncated log files in phpmyadmin , flushed magento cache. no avail. this around line 828: /** * check 2 variants: $requestpath , $requestpath . '-' . $productid */ $validatedpath = $this->getresource()->checkrequestpaths( array($requestpath.$suffix, $requestpath.'-'.$product->getid().$suffix), $storeid ); if ($validatedpath) { return $validatedpath; } /** * use unique path generator */ return $this->getunusedpath($storeid, $requestpath.$suffix, $idpath); }

css - 'Float' right a column when using display: table? -

Image
im using display table 3 column section of site. im doing need vertically center content of first column. how can move third column right while still keeping text left aligned? <span class="cont"> <span class="one">one</span> <span class="two">one</span> <span class="three"> <div class="a">some text , a</div> <div class="b">some more text , b</div> </span> </span> .cont { display: table; border: 1px solid black; width: 100%; } .one, .two, .three { display: table-cell; } .one { background: grey; vertical-align: middle; } .two { background: green; } http://codepen.io/anon/pen/azbmrp one simple solution use float: right .three class , vertical-align: top .two class: .cont { display: table; border: 1px solid black; width: 100%; } .one, .two, .three { display: table-cell; } .one ...

indexing - Is there ever a scenario in SQL where an index would be detrimental? -

can index ever hurt? that's whole question. i'm curious. query optimizers ignore indexes irrelevant query. still have spend microseconds during query optimization, considering whether each index should used. the more indexes have on table, more complex optimizer's job analyze best 1 use. in rare cases, optimization phase more costly query execution. i worked on case helping client using mysql 5.6, in new sophisticated query optimization features caused query use 100% cpu during optimization. basically, caused optimizer estimate benefit of thousands of permutations of index choices, chess-playing program looking ahead several moves. to solve problem, changes configuration variables make mysql 5.6's optimizer skip new features, , dumber optimal index choice, in mysql 5.5. solved cpu spike issue in case. that case exceptional because query complex, , had many indexes. this case specific 1 version of 1 brand of rdbms. other brands of database may have...

Improve throughput of retriver in google search appliance adaptor -

i developing adaptor gsa using adaptor framework 4.0. the issue having lies in fact gsa not call retriever method getdoccontent() i have set hostload max 10 the adaptor vm has 6 virtual cpus , number of worker threads adaptor has been set 64 server.maxworkerthreads=64 its unclear me why gsa not call getdoccontent() method untill hit save button on host load schedule section of gsa. vinay, it's going depend on how develop connector , basic infrastructure. 1) first, confirm have fed documents. can confirmed under feeds section. 2) second, if there fed documents in index diagnostics method not called, take 1 of urls , test in crawl diagnostics realtime diagnostics via manual fetch. 3) confirm port adaptor running not blocked via firewall.

java - Is it possible to use docker with jrebel or dcevm -

i have been using docker few weeks on development environment, , quite nice, not have worry config neither need run full virtual machine run application server (jboss in case). however seem have gone old days compile, deploy, wait, test. now question is, there way use tools such jrebel or dcevm in order speed up? further more, question make sense @ all? i don't see why isn't possible. infact there docker-jboss-jrebel container publicly available already. have not tested myself can't sure if there issues.have tried running jrebel? did see problems?

javascript - Open a fullsize window in Firefox -

Image
i hv requirement, when i'll click link, new fullsize window open. when going 1st option, working fine in firefox(esr 26.2.0) but, 2nd option isnt working @ all. fullsize window isn't hetting opened. 1st option: window.open(windowurl, "popwindow", "height=1000, width=1500, scrollbars=1, resizeable=1"); 2nd option: window.open(windowurl, "popwindow", "fullscreen=1, scrollbars=1, resizeable=1"); any solution? see https://developer.mozilla.org/en-us/docs/web/api/window.open fullscreen do not use. not implemented in mozilla. there no plans implement feature in mozilla. here screenshot:

php - Symfony2 From Collection has no elements -

i'm trying implement form collections. have members , each member can have multiple memberships. given member object "createform()" has array memberships correctly fetched database. member form gets shown correct, seems form.memberships empty. doesn't render "test". controller public function memberaction($id) { $request = request::createfromglobals(); $user_provider = $this->get('webservice_user_provider'); if ($id === "new") { $member = new webserviceuser(); $name = "neues mitlgied"; } else if (intval($id) != 0) { $member = $user_provider->getuserbyid(intval($id)); $member->getmemberships(); $name = $member->getname() . " " . $member->getlastname(); } else { throw new notfoundhttpexception('no member found!'); } $form = $this->createform(new membertype($this->get('webservice_config_provider')), $me...

oracle - Visual Studio can not resolve tns -

i have problem while became terminal error since got task 'today'. tried suggested. caused problem @ installing oracle found workaround , connect database connectionstring below, works: data source=(description=(address_list=(address=(protocol=tcp)(host=192.168.1.1)(port=1521)))(connect_data=(service_name=mydatabase)));user id=myusername;password=mypassword; and in database have connections table datalayer uses connect other databases. here begins problem. when try connect other databases error: ora-12154: tns:could not resolve connect identifier specified. long story short: can not touch table. tnsping work, toad. plsql developer , visual studio can not. mean there should problem listener, sqlora, tnsnames or such specific oracle file , cant find what. for vs i'd try putting tnsnames.ora in bin folder of app. sqlplus i'd check in c:\orant\

Angularjs ui.bootstrap.rating how to post -

i'm trying build star rating system angularjs after bit of research found http://angular-ui.github.io/bootstrap/ since i'm absolutely new angular can't seem figure out how post user selected rating symfony controller. html: <div ng-controller="ratingdemoctrl"> <rating ng-model="rate" max="max" readonly="isreadonly" on-hover="hoveringover(value)" on-leave="overstar = null"></rating> <span class="label" ng-class="{'label-warning': percent<30, 'label-info': percent>=30 && percent<70, 'label-success': percent>=70}" ng-show="overstar && !isreadonly">{%verbatim%}{{percent}}%{%endverbatim%}</span> </div><!-- rating controller end--> angular controller: tagapp.controller('ratingdemoctrl', function ($scope, $http) { $scope.max = 5; $scope.isreadonly = false; $scope.hoveri...

javascript - Issues selecting all elements in SVG using D3 and Moment.js -

i'm using cal-heatmap , d3 , , moment.js , i've got data sorted out month , year. goal select of "g" svg elements in calendar when specific month selected. code. if (thisdate.classed("m_1 y_2013")){ this.selectall("g").class("higlight"); } i've tried replacing this d3 , thisdate , variable of whatever month clicked in calendar. no matter of 3 use keep getting error aren't functions. appreciated!

postgresql - Python SQLAlchemy Update Postgres Record -

i'm trying update row on database (the asynchronous way) using multiprocessing module. code has simple function create_member insert data on table , create process maybe change data. problem session passed async_create_member closing database connection, , next requisition psycopg's error: (interface error) connection closed here's code: def create_member(self, data): member = self.entity(**data) self.session.add(member) name in data: setattr(member, name, data[name]) self.session.commit() self.session.close() if self.index.is_indexable: process(target=self.async_create_member, args=(data, self.session)).start() return member def async_create_member(self, data, session): ok, data = self.index.create(data) if ok: datacopy = data.copy() data.clear() data['document'] = datacopy['document'] data['dt_idx'] = datacopy['dt_idx'] st...

awk - Lookup and Append -

guys can me awk script, i've been thinking of using nr=fnr method , substring doesn't work here input file 1.txt bscrnc|cellname|cellid bbir1|bir004g+aw_geut|bi3004a bbir1|bir004g+aw_geut|bi3004b bbir1|bir004g+aw_geut|bi3004c bbir1|bir005g+lingong|bi3005a bbir1|bir005g+lingong|bi3005b file2.txt mb2|mbo bp5|bpd jh1|jho tn5|ttn tk3|tknj kt5|ktn lg4|lgs bi3|**bir** bh0|bih the output bscrnc|cellname|cellid|sitename bbir1|bir004g+aw_geut|bi3004a|bir004 bbir1|bir004g+aw_geut|bi3004b|bir004 bbir1|bir004g+aw_geut|bi3004c|bir004 bbir1|bir005g+lingong|bi3005a|bir005 bbir1|bir005g+lingong|bi3005b|bir005 we @ third field first 3 words bi3 in 1st file, see in 2nd file bi3->bir , append in fourth field , last 3 letter/words taken next 3 words 1st file thank much! it looks on right track (though, pointed out here, more people might have helped sooner if had given more details tried , thought problem was). bl.awk begin { fs = "|"; ofs = fs } #...

join - Select MySQL Month() for null column -

got question ask. how list of left table display data when use left join when row got null value in it? heres query: select *, sum(transactions.debit_credit) current_spending (`budget`) left join `categories` on `budget`.`category`=`categories`.`idcategory` left join `user_category` on `budget`.`category`=`user_category`.`idcategory` left join `category_transaction` on `budget`.`category`=`category_transaction`.`idcategory` left join `transactions` on `category_transaction`.`idtransaction`=`transactions`.`idtransaction` `user_category`.`iduser` = '1' , month(transactions.transaction_date) = '11' group `budget`.`idbudget`; when remove and month(transactions.transaction_date) = '11' query works fine accept displays data instead of 1 month of transaction. help?? please?? idea how?? your where clause turns left join inner join because filter data on condition of joined table. instead put condition in on clause of join select *, s...

c# - How to convert a string Date from database into Integer? -

i have string date in database. did below mentioned format shows error input string not in correct format but when referred internet method correct not work me. let me know reason? string str1 = "select todate employee empcode='" + code + "'"; sqldatareader dr1 = conn.query(str1); if (dr1.read()) { string todate1 = dr1[0].tostring(); int todate2 =convert.toint32(todate1); } it sounds should using datetime column in database, @ point there's no need integers or strings: var today = datetime.today; // or maybe use datetime.now // use parameterized sql rather string concatenations string sql = "select todate employee empcode=@empcode"; using (var conn = new sqlconnection(...)) { conn.open(); using (var command = new sqlcommand(sql, conn)) { command.parameters.add("@empcode", sqldbtype.varchar).value = code; using (var reader = command.executereader()) { ...