Posts

Showing posts from September, 2013

javascript - Word cloud unable to use onClick -

i'm building wordcloud using jason davies d3.layout.cloud() https://github.com/jasondavies/d3-cloud.git decided add transition , duration attributes make wordcloud better when arrives on screen . however, can't use on("click") attribute anymore since sends me error : uncaught typeerror: undefined not function refers line .on("click", function (d) {alert('ok');}) when remove transition , duration, on click works correctly . here js code : var fill = d3.scale.category20(); var layout = d3.layout.cloud().size([1500, 800]) .words(frequency_list) .padding(5) .rotate(function() {return ~~(math.random() -0.5) * 120;}) .font("impact") .fontsize(function(d) { return d.size; }) .on("end", draw); layout.start(); function draw(words) { d3.select("svg").remove(); d3.select("body").append("svg") .attr("width", layout.size()[0]) .attr(&quo

python - multiprocessing.Pool.map() not working as expected -

i understand simple examples pool.map supposed behave identically 'normal' python code below except in parallel: def f(x): # complicated processing return x+1 y_serial = [] x = range(100) in x: y_serial += [f(x)] y_parallel = pool.map(f, x) # y_serial == y_parallel! however have 2 bits of code believe should follow example: #linear version price_datas = [] csv_file in loop_through_zips(data_directory): price_datas += [process_bf_data_csv(csv_file)] #parallel version p = pool() price_data_parallel = p.map(process_bf_data_csv, loop_through_zips(data_directory)) however parallel code doesn't work whereas linear code does. can observe, parallel version appears looping through generator (it's printing out log lines generator function) not performing "process_bf_data_csv" function. doing wrong here? .map tries pull values generator form iterable before starting work. try waiting longer (till generator runs out) or use multi threading , q

asp.net mvc - Entity Framework - stange behaviour -

Image
i have 3 simplest tables: http://magicscreenshot.blob.core.windows.net/screenshots/udywngovqem.jpg and relationships among them: http://magicscreenshot.blob.core.windows.net/screenshots/ztk28gbgkec.jpg if create new project 0 , create entity model (from db) receive correct ef model: http://magicscreenshot.blob.core.windows.net/screenshots/zzg8gpzxfke.jpg but when try same real project - created ef model strange http://magicscreenshot.blob.core.windows.net/screenshots/wfkgc8vbdu8.jpg as can see, created new entity "sectionsite" relationship site , no relationship section. why happened , how fix it? i able replicate if added in section , sectionsite table independently of adding site table. creates link following link. to resolve missmatch of identity can either. remove , re-add site, section, , sectionsite @ same time. or right click "add new association" between site , sectionsite , un-check "add foreign key properties

android - SQL Query issue -

struggling sql query work since morning. trying check if particular field has 0 value first 500 (record 1 records 500) records. i tried following: select * unmapptext updatetime = '0' desc limit 0, 500; this gives me below error: process: com.ylg.dbaccess, pid: 18738 android.database.sqlite.sqliteexception: near "desc": syntax error (code 1): , while compiling: select * unmapptext updatetime = '0' desc limit 0, 500 @ android.database.sqlite.sqliteconnection.nativepreparestatement(native method) @ android.database.sqlite.sqliteconnection.acquirepreparedstatement(sqliteconnection.java:889) @ android.database.sqlite.sqliteconnection.prepare(sqliteconnection.java:500) @ android.database.sqlite.sqlitesession.prepare(sqlitesession.java:588) @ android.database.sqlite.sqliteprogram.<init>(sqliteprogram.java:58) @ android.database.sqlite.sqlitequery.<init>(sqlitequery.j

android - Stop or cancel the VideoView prepared -

in example having list of video links , next previous buttons. when click on next next video list played. problem when click on next hvideoview.setvideouri(uri.parse(videopath)); called , takes time prepare. in duration if again click on next next video link called. mean while if previous video ready onpreparedlistener() executed , start older video. want when click on next previous operation should stopped. , here code public void initializevideo(final string videopath) { baseactivity.showloading(this, "buffering..."); hvideoview.setvisibility(view.visible); lin_webview.setvisibility(view.gone); new handler(looper.mylooper()).post(new runnable(){ @override public void run(){ hvideoview.setvideouri(uri.parse(videopath)); } }); hvideoview.setonpreparedlistener(new onpreparedlistener() { public void onprepared(mediaplayer mp) { mp.setonbufferingupdatelistener(highlightsactivi

linux - manageprofiles.sh can't create DEPLOYMENT MANAGER -

my goal create deployment manager profile in websphere on linux. reading tons of documentation pages gives 2 methods: 1) using x gui application was_root/bin/profilemanagement/pmt.sh in case, according manuals, should choose management option, click "next" , choose deployment manager server type. when run pmt.sh in installation there no option choose deployment manager in management section , 1 profile type i'm able create adminagent. 2) using manageprofiles.sh script under was_root/bin directory. manuals can use -servertype deployment_manager option in order create deployment manager profile. when run script: ./manageprofiles.sh -create -templatepath ../profiletemplates/management/ -servertype deployment_manager -isdefault -profilename dmgr -adminusername websphere -adminpassword websphere1 i following message: the following validation errors present command line arguments: servertype: value parameter must within set of values [admin_agen

docker and image size limit -

i've been reading lot issue in here , other websites, haven't manage find proper solution on how increase images size limit set 10gb default. a bit of background informations. i'm building docker container : https://bitbucket.org/efestolab/docker-buildgaffer which download , builds consistent set of libraries on top of centos image. (takes horrible amount of time , space build) the problem every single time try build hit error : no space left on device docker version: docker version 1.7.1, build 786b29d docker info : containers: 1 images: 76 storage driver: devicemapper pool name: docker-8:7-12845059-pool pool blocksize: 65.54 kb backing filesystem: extfs data file: /dev/loop0 metadata file: /dev/loop1 data space used: 11.28 gb data space total: 107.4 gb data space available: 96.1 gb metadata space used: 10.51 mb metadata space total: 2.147 gb metadata space available: 2.137 gb udev sync supported: false deferred removal enabled: false data loop file

html - Rewrite rule break css on third level links -

i have trying make pretty url's .htaccess . structure of pages this- http://example.com/category_id=1/item_id=1 : index index->category index->category->single_item_from_category i've trying make like- http://example.com/category-1/item-1.html css on third level /item-1.html isn't there. page doesn't have css @ all. must site in sub folder of main sait: http://example/site-is-here/ .htaccess code rewriterule ^vcat-([^/]*)/video-([^/]*)\.html$ /second/video_category.php?video_cat_id=$1&video_id=$2 [l] and link in php/html part <a href="/vcat-'.$video_cat_id.'/video-'.$row['video_id'].'.html">'.$row['video_title'].'</a> on other pages 'pretty url's' working. problem whit pages index.php/category/item when go on page seems miss css fail , check in source of page link css is: http://example.com/sait/vcat/css/main.css should http://example.com/sait/css/main.css

HTML Form - PHP Email with custom messages and tickbox -

i have html form radio buttons, option boxes (drop down boxes), checkboxes, text fields , on. have form pointed file called send.php email form on how tickboxes , radio buttons , input text in between each answer? kind of format this: welcome: {name} age group between: {radio button age groups} and on. can't give actual code private can give instead uses kind of code , format: <form action="send.php"> <input type="radio" name="agegroup" value="agegroup1"> 0-18<br> <input type="radio" name="agegroup" value="agegroup2"> 19-29<br> <input type="radio" name="period" value="agegroup3"> 30-39<br> <input type="radio" name="period" value="agegroup4"> 40-49<br> <input type="radio" name="period" value="agegroup5"> 50+<br> <br><br><b

c# - The tag 'Employee' does not exist in XML namespace 'clr-namespace:XYZ;assembly=XYZ' -

i trying out simple wpf application. xaml code is: <window x:class="wpfapplication1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:system;assembly=mscorlib" xmlns:local="clr-namespace:wpfapplication1;assembly=wpfapplication1" title="my first wpf demo" height="350" width="525"> <window.resources> <sys:int32 x:key="i">10</sys:int32> <local:employee x:key="emp2"></local:employee> --> line </window.resources> <stackpanel> <textbox x:name="txtname" fontsize="18" margin="20"></textbox> <button x:name="btnclickme" fontsize="18" margin="20" click="btncl

c# - BootStrap not formatting view in MVC 4 -

Image
i have mvc 5 application created bootstrap. had create mvc 4 application , copied _layout.cshtml file on , made modifications needed. i, further, added bootstrap project. however, menu bar not showing up. pic: this kind of expecting. (this pic of app copied code from): here _layout file: <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@viewbag.title</title> @styles.render("~/content/css") @scripts.render("~/bundles/modernizr") </head> <body> <div id="wrapper"> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> @*<button type="button" class="navbar-toggle" data-toggle="collapse

xcode - Could not cast value of type - Objective C NSManagedObject in Swift -

i've found numerous posts error being able resolve adding prefix of project name class in entity viewer e.g projectname.journey suggestion of adding @objc(classname) above class declaration. these solutions don't work me. problem have nsmanagedobject class generated in objective c try access in swift. following error: unable load class named 'projectname.journey' entity 'journey'. class not found, using default nsmanagedobject instead. not cast value of type 'nsmanagedobject_journey_' (0x1700541f0) 'journey' (0x100096f38). my class: h: #import <foundation/foundation.h> #import <coredata/coredata.h> @interface journey : nsmanagedobject @property (nonatomic, retain) nsstring * travelmode; @property (nonatomic, retain) nsdate * starttime; @property (nonatomic, retain) nsdate * endtime; @property (nonatomic, retain) nsnumber * averagespeed; @property (nonatomic, retain) nsnumber * distance; @end m: #import "journe

c - Use name of #define parameter without stringification -

is there way exact words passed #define without stringifying? example use case: #define num 1 #define create_fun(x) \ void prefix_x() { \ // used exact words passed in int x = x; \ // use value later on } create_fun(num) and output like: void prefix_num() { int x = 1; } use token concatenation ( ## ): #define num 1 #define create_fun(x) \ void prefix_##x() { \ int x = x; \ } create_fun(num)

amazon web services - Is there a way to publish web content and simply make a profit? -

i envision s3 (amazon simple storage solution), content creator gets set price per download, , assign amazon accounts receive percentage of revenue. it'd great if content creator set cut @ zero, , whoever downloading asset paying , s3 download bandwidth. or if content creator estimate how many downloads in month, schedule cost amortization s3 storage cost well, , build right in download cost. if actual download rate different, perhaps amortized cost configured adjust rapidly, slowly, etc. or if content creator set asset pay own storage , bandwidth, initial allowance. asset has negative balance, asset deleted, not incur more costs creator. or creator pre-empt death, , withdraw revenue @ time. and if put together, content creator say, "amortize storage cost (1k downloads per month expected, adjust @ medium pace), die when runs out of money, want make $0.10 off every download, $0.01 of stay asset pay own storage during lean months, $0.01 of should go editor's a

Is it possible to edit an Azure Automation Schedule? -

i have created schedule azure automation runbook, , linked schedule runbook. notice 1 cannot edit schedule, or delete schedule. may missing something. seems 1 can create automation schedules. please note not talking azure scheduler here "job collections " etc. would appreciate advice. thanks. you can delete , unlink schedule in both old portal , preview one. cannot edit time or frequency of schedule though. please vote on uservoice product team can prioritize this. to unlink in old portal, select runbook > click schedule > highlight schedule remove > click unlink button @ bottom right. to delete schedule in old portal, go assets > highlight schedule delete > click delete button on bottom of screen.

sql - Combine results to count totals for individuals -

Image
i have table in database keeps track of pages sent individual users , groups. users part of groups. individual users can answer pages. here ddl table: --pagestatus 1 = expired --pagestatus 2 = answered --pagestatus 3 = canceled create table [pagings] ( [id] int not null identity(1,1) , [userprofileid] int null , [groupid] int null , [message] nvarchar(max) collate sql_latin1_general_cp1_ci_as null , [pagestatus] int not null , [datecreated] datetime null , [datemodified] datetime null , [isrecurring] bit not null default ((0)) , [answeredbyid] int null , [answereddatetime] datetime null , constraint [pk_ft.pagings] primary key ([id]) ) on [primary] textimage_on [primary] go anytime pagestatus expired (1) or canceled (3) not have data answeredbyid or answereddatetime columns. if answered set value of userprofileid coming application in answeredbyid column of person answered it. if group paged

java - Breaking out of a do while loop in an async task after parsing all data in a URLConnection -

how end while loop if there 1 line of data or if next line empty? bufferedreader in = new bufferedreader(new inputstreamreader(is)); string inputline = ""; try { { jsondata += inputline; } } while ((inputline = in.readline()) != null); } you can use, while ((inputline = in.readline()) != null && !inputline.isempty());

sql - Joining a query from a separate database -

i have 2 access 2007 databases, db1 , db2 convention, , trying outer join results of query (q1) in db1 query (q2) in db2. my code looks this select q2.a, q2.b, q2.c, q1.d [full name of q1] in 'c:\users\...\db1.accdb' q1 right join [full name of q2] q2 on q2.a = q1.a ; but returns error "syntax error in clause." i have tried method left join , trying far many brackets around things in fruitless attempts work. doing wrong? that [source name] in 'file path' syntax tricky. if want alias [source name] , need include alias between [source name] , 'file path' pieces (instead of after 'file path' ). but works query includes single data source. once join anything, [source name] in 'file path' syntax breaks ... , not fixable. need different approach ... select q2.a, q2.b, q2.c, q1.d [c:\users\...\db1.accdb].[full name of q1] q1 right join [full name of q2

wpf - INotifyPropertyChanged with derive class -

i have class: public class myfileinfo : inotifypropertychanged { private string _file; private int _bytessent; public myfileinfo(string file) { } public string file { { return _file; } set { _file = value; } } public int bytessent { { return _bytessent; } set { _bytessent= value; } } } and derive class: public class myfile : myfileinfo { } so every time _bytessent has changed want notify: public event propertychangedeventhandler propertychanged; public virtual void notifypropertychange(string propertyname) { var handler = propertychanged; if (handler != null) handler(this, new propertychangedeventargs(propertyname)); } using this: public static int propertyname { { return _propertyname; } set { _totalpacketssent = value; notifypropertychange("..."); } } so question is: should declare event ? in base class on 1 derive b

XML to powershell array -

i want load xml content array within powershell script. why dows not work? :( my xml: <settings> <services> <sv>service1</sv> <sv>service2</sv> </services> </settings> my powershell script. seems work, i'm not sure [xml]$xml = get-content "d:\config.xml" [array]$service_arr = $xml.settings.services.sv but want display it, "cannot index null array." $service_arr[0] i don't want have variable different generic name each service. want able address services array[0]...array[1] etc. you don't have cast $xml.settings.services.sv explicit [array] , can iterate on using example foreach loop: foreach ($service in $xml.settings.services.sv) { write-host $service }

spring - Token based authentication for user and separate module -

i have 2 scenarios want implement token based authentication: i want implement token based authentication when user logs in. i.e.. based on username , password , user should token , token should used every request. i have separate independent module has id , secret key. has communicate server in specific interval. want implement token based authentication module also. in both cases token should have these properties: it should in payload. it should have timeout period when token expires server should provide new token,if session not expired else should logout. is oauth 2.0 right choice? if other approach better, please tell me. should solve problem? best place put token in request -payload or header? , why? oauth 2.0 choice requirements mentioned: timeout period , refresh-ability. stormpath has excellent oauth2.0 implementation gives looking out of box. stormpath has both remote , local oauth2 implementations , both freely available. remote case can rely

amazon ec2 - How to tell ansible to use different user for different environment? -

i'm building machine on ec2 using ansible. have vagrant test script locally. here's playbook - name: provision ec2 hosts: user: vagrant sudo: yes gather_facts: true vars: gsutil_user_home: "vagrant" if want use playbook ec2 have change user , gsutil_user_home ubuntu work. there anyway can make variable , tell ansible user needs run based on argument? if these values consistent duration of playbooks, you'd set them group/host vars in inventory, , have different inventories or groups different environments. if want vars , pass them in -e , that's fine too: - name: provision ec2 hosts: user: {{ my_ec2_user }} sudo: yes gather_facts: true vars: gsutil_user_home: {{ gsutil_user_home }}

android - What does "Refresh all Gradle projects" do? -

Image
i'm trying create gradle plugin generates sources when "refresh gradle projects" button on gradle panel. assume intellij executing gradle target, can't find documentation figure out target or targets executed. this android project, , i've heard suggested use project.prebuild.dependson task , have not been able work every time refresh (it works first time). if @ documentation intellij idea @ https://www.jetbrains.com/idea/help/synchronizing-changes-in-gradle-project-and-intellij-idea-project.html clicking refresh button in gradle tool window following: on pressing button, intellij idea parses project structure, , displays detected differences (if any) in gradle tool window. it refreshes project structure changes in gradle. might difficult find specific task calling because under hood it's using gradle tooling api ( https://docs.gradle.org/current/userguide/embedding.html ) execute tasks , info each project.

html - Is it acceptable to omit container elements when using Bootstrap's grid? -

i have used bootstrap framework create responsive site, have not used bootstrap .container class. for project, content sits withing div class of .wrapper. wrapper fluid , has width of 80%, max 1200px , min width 360px. within wrapper have used standard .row , .col boostrap classes. i have tested site , works expected. site validates , (even works on ie-9) , mobile devices. is ok use above method without .container class? many thanks, p there's no reason must use container elements. however, .container-fluid class describe. i'd consider switching custom wrapper standardization , ease of maintenance. regarding row margins--that's not great idea. may find wanting modern "flat" design you'll want of rows stacked tightly. it's better leave grid elements alone, , apply margins , padding inner elements. put class on row so: .row.padded > div div { /* > div should column */ margin: 1em 0; } <div class="container-fluid&

wpf - C# Wait for another opened window to close before executing the rest of the function -

i had created 2 wpf window. for window 1: //get ic detail first coakeyinaccounticcanvas coakeyinaccountcanvas = new coakeyinaccounticcanvas(this, _printerison); coakeyinaccountcanvas.topmost = true; coakeyinaccountcanvas.show(); if(checkcoakeyinicstatus.checkcoakeyinaccounticstatus == true) { //check user ownership checkcoaowner.visibility = visibility.visible; // let user choose whether owner or representer } else { accountnumber = ""; checkcoaowner.visibility = visibility.hidden; getaccountcanvas.visibility = visibility.visible; } initially, coakeyinaccountcanvas window checking , update checkcoakeyinicstatus.checkcoakeyinaccounticstatus either " false " or " true ". how can unhold if-else statement function executed before coakeyinaccountcanvas window had finished function? use: coakeyinaccountcanvas.showdialog(); instead: coakeyinaccountcanvas.show();

oracle - SQL Duplication -

context, - have big invoice database. i'm looking duplicates. current situation brings me looking duplication in invoice numbers. i'm using count(*) duplicates , show me ones duplicates whilst ignoring others. problem - count(*) isn't working, show dummy duplicates i've put in test data, still shows records aren't duplicates. here's part of code can gist of it: sql dbselect s2.apar_id, s2.ext_inv_ref john3, s2.ext_inv_ref invno, s2.cur_amount, abs(s2.cur_amount) absamt, s2.trans_date, s2.period, s2.voucher_no, s2.voucher_type,s3.apar_name, s3.apar_gr_id sql asuhistr s2, asuheader s3 sql ( s2.ext_inv_ref in sql (select s2.ext_inv_ref sql asuhistr s1 sql , s1.apar_id = '######' sql group s2.ext_inv_ref sql having (count(*)> 1)) sadly doesn't remove non-duplicate invoice numbers. any appreciated. here's full code: sql dbselect s2.apar_id, s2.ext_inv_ref john3, s2.ext_inv_ref invno, s2.cur_amount, abs(s2.cur_am

How to set PATH environment variable in batch file only once on Windows? -

i have batch file sets user path , run part of visual studio ide build step. @echo off @echo %path% set comspec = "%vcinstalldir%\vcvarsall.bat" amd64 setx path "..\..\lib\libsndfile;..\..\lib\simulink" @echo %path% when build project, close vs, , reopen it, , rebuild, see appended path part of path variable. however, see in windows setting of environment variable path variable created under user environment variables as ..\..\lib\libsndfile;..\..\lib\simulink question 1: why path appear appended path part of system environment variable? on executing echo %path% through visual studio console (when run project second times) prints system variable path , new path created appended it. question 2: i want modify batch file sets once path environment variable in user settings during first run of visual studio build. if user variable path exists on subsequent runs, should not execute set command again avoid appending new path again , again in sys

What is the difference when calling subroutine with and without & in Perl? -

for homework, told make subroutine within perl, , when called arguments in it, print arguments. did , second part of homework call first subroutine within second one. did this, question was: try running second subroutine "&" while calling first one, , without , write difference in these 2 different calls. subroutine seems works in both cases, , without, don't know changed, therefore don't know write. off topic, code fine? kinda first time coding in perl. this code: #!/usr/bin/perl use 5.010; use strict; use warnings; show_args('fred','barney','betty'); show_args_again(); sub show_args{ ($broj1, $broj2, $broj3) = @_; print "the arguments are: " . "$broj1, " . "$broj2, " . "$broj3.\n"; } sub show_args_again{ &show_args('fred','barney','betty'); } does assignment whether show_args_again should called parameters? the thing can think of meant

javascript - generating multidimentional object with array -

Image
i generating object this: as can see education array inside object, want degree_1 , major_1 , values in same object. this how want education array: one other thing: when var_dump in php fine arrays , everything. javascript gets second image above- object of object when array.. public function show($id) { $tmp = array(); $post = array(); $postinfo = post::find($id); $params = db::select( db::raw("select param.*, sys_param_values.*,param_value.*,type_post.*, param.name paramname, doc_param.name docparamname param left join doc_param on param.doc_param_id = doc_param.id left join sys_param_values on param.id = sys_param_values.param_id left join param_value on sys_param_values.value_ref = param_value.id

SharedPreference doesn't save on Android -

i working sharedpreference cannot save info. these code: import android.app.activity; import android.content.context; import android.content.sharedpreferences; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast; public class sharedprefapp extends activity implements view.onclicklistener { button buton1 , buton2 ; edittext etv1 , etv2 ; textview tv1; private static sharedpreferences sharedpref; protected void oncreate(bundle bambam){ super.oncreate(bambam); setcontentview(r.layout.sharedpref_xml); buton1 = ( button) findviewbyid(r.id.button12); buton2 = ( button) findviewbyid(r.id.button13); etv1= (edittext) findviewbyid(r.id.edittext4); etv2= (edittext) findviewbyid(r.id.edittext5); tv1 = (textview) findviewbyid(r.id.textview12); buton1.setonclicklistener(this); buton2.setonclicklistener(this); } public void onclick(v

php - Managing uploaded files in Laravel - linking public and storage directories -

in laravel 5.1 app, i'm storing images in storage/app/uploads folder. my local disk: <?php 'disks' => [ 'local' => [ 'driver' => 'local', 'root' => storage_path('app/uploads'), ], // other configuration... ?> thing is, can't figure out way use image files after they're uploaded, e.g. source of <img> tag. basically, need retrieve valid path image, can used on page. for deployment i'm using envoyer provides solution. according envoyer docs : when storing user uploaded files, you should store them in storage directory of application if using laravel. then, may use "manage linked folders" feature of envoyer create symbolic link public directory storage directory. "manage linked folders" button can found on "deployment hooks" tab of project. ..and clear. but how "link" storage , public folders in local d

version control - How do I split a file in Git? -

i have source file a , getting long , contains 2 large classes. want split files a , b , preserving history , "blame" data. in subversion, easy: svn copy b , delete lines a should in b , vice versa, commit. project's owner sadly wants switch git, , 1 of workflows don't know how do. when svn log b , b 's history after split, plus a 's history before split. additionally, svn blame b attribute pre-split changes correct authors in history of a , rather attribute them whomever did split. git not explicitly track renames. instead needed calculates if rename has occurred. example, commands git blame , git diff , git merge can make use of git's rename detection machinery. for reason should make change need , commit normal. so correct steps case be: <make needed changes files> git add b git commit given renaming not explicitly tracked means rename detection algorithm needs little bit of tuning achieve need. example, when doin

java - Polygon on Map doesn't show semi transparent color -

Image
i working on google map application in plotting polygon on map not displaying polygon semi transparent color fill color. following code int strokecolor = 0xffff0000; int fillcolor = 0x44ff0000; polygon polygon = map.addpolygon(new polygonoptions() .add(new latlng(fences.get(northwestpoint).lat, fences.get(northwestpoint).lng), new latlng(fences.get(northeastpoint).lat, fences.get(northeastpoint).lng), new latlng(fences.get(southeastpoint).lat, fences.get(southeastpoint).lng), new latlng(fences.get(southwestpoint).lat, fences.get(southwestpoint).lng), new latlng(fences.get(northwestpoint).lat, fences.get(northwestpoint).lng)) .strokecolor(strokecolor) .strokewidth(2) .fillcolor(fillcolor)); this output when renders map: the code seems co

Does a RegEx Pattern need to be modified to be used with SQL in MySql? -

i'am trying write select-statement retrieve list of usernames database. pattern is: /placeholder\d+/ig , tested , can confirm working properly. i'am trying retrieve every placeholder in table. i tried escape \ after placeholder. my sql-statement is: select * table (name regex '/placeholder\d+/ig') ... tried different variations backticks, etc or like instead of regex but like only has % , _ wildcard. does regex pattern needs modified in order work mysql? unlike scripting languages, mysql not using preg library regular expression matching. so yes, need modify regex make work in mysql: select * table name regexp 'placeholder[0-9]+' or select * table name regexp 'placeholder[[:digit:]]+' there no short-hand character classes \d in mysql. also, not use regex-delimeter ( "/../si" ".." in mysql) read documentation on regular expressions in mysql more information.

php - Edit value to database through custom admin, Opencart 2.0 -

i trying make easy form in opencart 2.0.1.1 stores values in database. i have done custom admin page have extensions make of own. easy part. i have made form , column in database, working fine, values , showing in textarea inside admin. issue when trying edit texts. when change value of textarea , hit save dissapears! , column in database gone. my controller file: admin/controller/ekomet/design.php <?phpclass controllerekometdesign extends controller { private $error = array(); public function index() { $this->load->language('ekomet/design'); $this->document->settitle($this->language->get('heading_title')); $this->load->model('setting/setting'); if (($this->request->server['request_method'] == 'post') && $this->validate()) { $this->model_setting_setting->editsetting('design_name', $this->request->post); } $data['button_save&#

php - Is there a way to ignore isset and display result -

may easy can't understand this. i have 2 pages both lead third page. in third page have if(isset($_get['something']) && isset($_get['somethingelse'])) { $something = $_get['something']; $somethingelse = $_get['somethingelse']; //more stuff here } from page1.php page3.php 1 url <a href="page3.php?something='.$something.'&somethingelse='.$somethingelse.'">click</a> and page3.php show expected. problem page2.php page3.php . there link like <a href="page3.php?something='.$something.'">click</a> so page3.php doesn't load since there check somethingelse .. how can ignore isset without delete because need value of $somethingelse when comes page1.php . can't think solution here. you can't ignore if statement, whole point of flow control. want something, if it's passed if statement. if want define $somethingelse if it&

javascript - In IE11, XML DOM node is broken down into multiple children based on white-space -

the existing code mades ajax call server. on success this: var result = transport.responsexml.getelementsbytagname('contents')[0].firstchild.nodevalue; ...process result previously working fine in chrome , ff (and thought versions of ie well), realized in ie11 there strange behavior happening firstchild.nodevalue contains expected content line break/white space characters. so result of firstchild.nodevalue <!doctype html ><! . , instead of 1 child node, there many of them, , seems happen in ie. in chrome developer tools, when put breakpoint on success call, result of transport.responsexml.getelementsbytagname('contents')[0] looks like: <contents> <![cdata[ <!doctype html ><!-- comment --> ...actual expected content here. ]]> </contents> however in ie11 developer tools looks like: <contents> <!doctype html ><! -- comment -- > ...actual expected content here. <contents>

javascript - dropDownDefaultValue in dijit DateTextBox broken? -

as documentation of dijit datetextbox says want set date user sees when opens dropdown. don't want put date in value property of datetextbox. in application date optional when it's used other fields need filled, too. the value want show in dropdowndefaultvalue depends on other dates. if other date in 2006 set range 2006 user unable select date after 2006. without selected default date realy annoying cause it's today. so here's fiddle tried set dropdowndefaultvalue fiddle <div data-dojo-type="dijit.form.datetextbox" data-dojo-props="dropdowndefaultvalue:'2010-10-12'"></div> i'm using dijit/datetextbox documented here documentation datetextbox any ideas why it's not working? dropdowndefaultvalue supposed object, not string. you have that: <div data-dojo-type="dijit.form.datetextbox" data-dojo-props="dropdowndefaultvalue: new date(2012,10,12)"></div> see https://j

api - how to meter power(watt) of PC components(cpu,memory,disk,etc) in real time? -

as question says ,i want monitor value of power(watts) components consumption .especially value of cpu , memory , disk . when use aida64 ,i found in computer/sensor ,there data power consumption . want know how did can these data ? i have idea ,but not sure best way solve question : there sensors on motherboard ,we can use values of sensors calculate real-time power. according different os, have apis can utilization of cpu,memory throughout rate , disk i/o rate . using data ,we can build mode of power consumption pc.if there apis, where can find them ? maybe hardware manufacturer intel has record value of power in real-time ,they put value special register in hardware .we can value through mapping special memory location . in opinion ,the second way maybe solution monitor software using .but don't know can api. whats more ,our aim design os-independent real-time power monitor software. so, if there better solutions question ,i appreciate . hmmm. wasn&

excel - Labeling the last point of series -

i have code changes last point in every series on chart legend name. however, not want last point of first 4 series change legend name. have suggestions altering code skip first 4 series , label last point of every series? for each mysrs in activechart.seriescollection 'change function every series after series 4 changes ast point mysrs npts = .points.count mysrs.points(npts).applydatalabels _ type:=xldatalabelsshowvalue, _ autotext:=true, legendkey:=false mysrs.points(npts).datalabel.text = mysrs.name mysrs.points(npts).datalabel.orientation = 90 mysrs.points(npts).datalabel.font.bold = true end next a chart series in excel has property called plotorder tells order in each series plotted on chart. check property in loop , continue if it's > 4 . example: for each mysrs in activechart.seriescollection mysrs if .plotorder > 4 npts = .points.count

c# - How do I update rows when clicking "update" button in web application gridview? -

in web application asp.net, far have gridview configured can delete rows (i have primary identity(1,1) key set) , click "edit" button row editable, have no idea how rows update. basically, after user edits textbox in web application's gridview, i'm not sure how fetch data, , write code in vb.net attach database. here's html code gridview: <asp:gridview id="gridview1" runat="server" autogeneratecolumns="false" datakeynames="id" datasourceid="sqldatasource1" width="861px" cellpadding="4" forecolor="#333333" gridlines="none" allowpaging="true" allowsorting="true"> <alternatingrowstyle backcolor="white" /> <columns> <asp:commandfield showeditbutton="true" /> <asp:boundfield datafield="id" headertext=&

end of life - How do you decommission a GitHub project? -

an organization work has project on github no 1 outside organization has used , end-of-lifeing it. i see there great big delete button, wonder if there way freeze project can never pushed again, , write "decommissioned" on in way universally recognized other programmers. first off, add explanatory note @ beginning of readme.md file in repo (and if file doesn't exist yet, add it). "this project has reached end of life, , preserved here posterity." the non-enterprise flavor of github doesn't let disable push, unfortunately.

Where is the visual studio HTML Designer? -

Image
where visual studio html designer? see there options html designer can't open it. so want ask why can't find designer , how open it. when create html file goes html code. the default html editor (for static html) doesn't have design view. set default editor web forms editor have design view, right click html file in solution explorer in visual studio , click on open with select html (web forms) editor click on set default click on ok button once have done that, need click on design or split view shown below:

Matlab Remove empty cell array content -

i have 5*14 matrix (m*n) m={'a','b',.....' ',' ' ; 'aa','bb',...' ',' ' ; ... } whats best option remove empty cells (5*n) after removing empty cells: m={'a','b','c'; 'aa','bb' ; 'e'; 'aa','xx'; ...} when this: emptycells = cellfun('isempty', m); cols = size(m,2); m(emptycells) = []; m = reshape(m, [], cols); i error : error using reshape product of known dimensions, 14, not divisible total number of elements, 52. here solution creating nested cell: m={'a','b','c';'d','e','';'','','';'','f',''}; %convert cell nested cell m=mat2cell(m,ones(size(m,1),1)); %now apply code every subcell ix=1:numel(m) emptycells = cellfun('isempty', m{ix}); m{ix}(emptycells)=[]; end

javascript - How to retrive data with angularjs from node emit? -

if try retrive data without angularjs node this: var socket = io.connect('127.0.0.1:3000'); socket.on("foo", function(message){ console.log(message); }); node.js file: var app = require('express')(); var http = require('http').server(app); var io = require('socket.io')(http); var redis = require('ioredis'); var redis = new redis(); redis.subscribe('update.group', function(err, count) { }); redis.on('message', function(channel, message) { message = json.parse(message); console.log(message); io.emit('foo', message); }); http.listen(3000, function(){ console.log('listening on port 3000'); }); it work fine... but how can retrive data angular app? your problem how use socket.io angular, take @ this module

jquery - Alternating Background Color of Menu Items Generated from query -

i'm working on putting finishing touches on jquery menu dynamically generated. menu holds reports assigned employees based on login. employees have menu 2 items while other employees can have list 20 reports long. i've seen how posts implement css3 based on list fixed number of items. question how can same thing menu given no 2 employees have same number of items in menu? below current code of menu. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script> <!---<link rel="stylesheet" href="/resources/demos/style.css" />---> <script> $(function() { $("#menu" ).menu(); }); $(function() { $(document ).tooltip(); }); function refresh() { child.location.reload(true); } </script> <style> a{ font-family:arial; } #mainme

embedded - IAR change default project settings -

i got iar , creating bunch of new projects different tutorials following making me change project settings each project make , see way set default project settings. is there way change can set default target msp430f5529, default compiler optimizations none, default driver in debugger fet debugger, , add path default include locations?

java - JsonPath from a Field name -

i working on orchestration service. service platform call multiple downstream services , pass error returned them. problem error field returned downstream service according json schema of service. e.g. - "details": [ { "field": "downstream_service.request.path.field_name" } ] my component needs return error in "details": [ { "field": "my_component/users/index/field_name" } ] i have java pojo object my_component , need json path field name field_name . how json path of field pojo or json object? looking existing libraries or frameworks. user pojo public class user extends hateoasentity implements resourcemodel { /** * credentials allowed user. * */ @jsonproperty("credentials") @valid private list<credential> credentials = new arraylist<credential>(); /** * business information collecte

javascript cookies, create and delete -

i'm working on page refreshes every 5 minutes <meta http-equiv="refresh" content="1200;url=?meta_refresh=true" /> on page js script should run first 2 times page reloads. when page reload's third time, script should not execute. so far, i've created cookie , given initial value of 0, every refresh increment it's value (rewrite cookie) , if value smaller 3 execute part of script. things if close tab , reopen page in tab, cookie has incremented value, , want start 0. here's i've done far: var value = 0; $(document).ready(function() { function getcookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i<ca.length; i++) { var c = ca[i]; while (c.charat(0)==' ') c = c.substring(1); if (c.indexof(name) == 0) return c.substring(name.length,c.length); } return ""; } function checkcookie() {

mediator - KnockoutJS: components binding, working with objects as data type -

i'm new knockout js , find library powerful, quite hard understand sometimes. documentation hudge, it's (too) small code snippets, it's difficult have big picture, unless coding style & philosophy paradigm same ko developers. i come angular world, , i'm used have array each item object properties (id, name, etc). when click button, "send" object new component render in form. i'm sure i'm missing obvious, don't understand how make things work, plugins ko.mapping , ko.postbox. does can me find solution? in working code above, i've posted 3 specific questions in javascript area. edit: answered them, don't know if it's best practice or not . var // user class give each property observable capacity user = function (rawdata) { var self = this, data = rawdata || {}; self.id = ko.observable(data.id); self.name = ko.observable(data.name); }, // list component.