Posts

Showing posts from February, 2015

angular - Ionic 3 deep-linking and lazy-loading at the same time -

Image
according i've read in documentation , forums , enable deep-linking via : forroot(approot, config, deeplinkconfig) @ngmodule({ .. ionicmodule.forroot(myapp, {}, { links:[{ component: contactpage, name: "contact", segment: "contact"}, { component: hellopage, name: "hello", segment: "hello" } ] }) ... }) ... this leads adding contactpage , hellopage declarations , entrycomponents arrays within @ngmodule , not lazy-loaded. so, leads question, can substitute strings, doing away imports , double array declaration, , have this? @ngmodule({ .. ionicmodule.forroot(myapp, {}, { links:[{ component: 'contactpage', name: "contact", segment: "contact"}, { component: 'hellopage', name: "hello", segment: "hello" } ] }) ... }) ... and achieve lazy-loading @ same time? update : tried single tabs page. i'm guessing it...

r - 'x' must be an array of at least two dimensions | SoFUN & Overflow -

i using sofun & overflow package try , calculate median class. this 2 lines have been using. medianmen <- structure(list(age = c("15-19", "20-24", "25-34", "35-44", "45-54", "55-64", "65-74", "75-84", "84-over"), frequancy = c(130292, 117683, 216706, 278284, 302612, 244425, 202556, 83825, 14486)), .names = c("age", "frequancy"), class = "data.frame", row.names = c(na, -9l)) this line above gives no errors, groupedmedian(medianmen$age, medianmen$frequancy, sep = "-") error in rowmeans(intervals) : 'x' must array of @ least 2 dimensions however line above gives error. confused, supposed identifying x , y axis or something? all appreciated. i assume referring function documented here: https://rdrr.io/github/mrdwab/sofun/man/groupedmedian.html try switching order, or alternatively labelling frequencies & intervals i...

Template Haskell Show instance not working -

does know why code: module language.p4.utiltest import language.p4.util (mkshow) data dummy = bogus char | nonsense int $(mkshow ''dummy) is producing error: davids-air-2:p4 dbanas$ stack ghc -- utiltest.hs -ddump-splices [1 of 1] compiling language.p4.utiltest ( utiltest.hs, utiltest.o ) utiltest.hs:24:3-16: splicing declarations mkshow ''dummy ======> instance show dummy show (bogus x) = show x show (nonsense x) = show x utiltest.hs:24:3: error: conflicting definitions ‘show’ bound at: utiltest.hs:24:3-16 utiltest.hs:24:3-16 | 24 | $(mkshow ''dummy) | ^^^^^^^^^^^^^^ ? the th splice expansion looks correct me. if comment out second constructor ( nonsense int ), code compiles without error. also, if enter th splice expansion shown, manually, code (commenting out $(mkshow ''dummy) line, of course), compiles without error. mkshow :: name -> q [dec] mkshow typname =...

apache spark - Lost task 1.0 in stage 4.3 (cs-xx02): FetchFailed(BlockManagerId(2, cs-xx01, 9080), shuffleId=2, mapId=0, reduceId=1 -

when run spark , error appears: lost task 1.0 in stage 4.3 (tid 2003, cs-xx02): fetchfailed(blockmanagerid(2, cs-xx01, portxx), shuffleid=2, mapid=0, reduceid=1, message=org.apache.spark.shuffle.fetchfailedexception: failed connect cs-xx01 caused by: java.io.ioexception: failed connect cs-xx01 @ org.apache.spark.network.client.transportclientfactory.createclient(transportclientfactory.java:228) @ org.apache.spark.network.client.transportclientfactory.createclient(transportclientfactory.java:179) @ org.apache.spark.network.netty.nettyblocktransferservice$$anon$1.createandstart(nettyblocktransferservice.scala:96) @ org.apache.spark.network.shuffle.retryingblockfetcher.fetchalloutstanding(retryingblockfetcher.java:140) @ org.apache.spark.network.shuffle.retryingblockfetcher.access$200(retryingblockfetcher.java:43) @ org.apache.spark.network.shuffle.retryingblockfetcher$1.run(retryingblockfetcher.java:170) @ java.util.concu...

Turning on assertions while compiling with Haskell's stack build system -

i using stack 9.0 haskell build system project. i've noticed when compile haskell project stack, assertions switched off. contrast while doing "normal" ghc builds @ command-line, assertions turned on default unless explicitly switched off -fignore-asserts flag ( link ). for instance simple main function fails throw assertion error import control.exception.base main :: io () main = assert (1==2) $ print "hello world!" how edit .cabal file of project turn on assertions? inside .cabal file see following ghc options ghc-options: -threaded -rtsopts -with-rtsopts=-n which strange because assertions have not been explicitly turned off within list. edit: i have version 1.1.2 x86_64 hpack-0.14.0 after running stack --version . in particular, using stack lts 9.0 ghc 8.0.2 try passing in --fast flag, disable optimizations (via --ghc-options -o0 ) , allow assertions run.

vb.net - How to loop a file check until conditions are met in Visual studio 2017 with vb code? -

so i'm trying loop file check until 1 file there , file creates file gone. keep trying rewrite , have been trying find working setup can't find code have currently dim dir = my.application.info.directorypath if progressbar1.value = 25 if checkbox1.checked if fileexists(dir + "\download\downloaded.mp3") if fileexists(dir + "\download\downloaded.mkv") else progressbar1.value = 45 exit end if end if end if if fileexists(dir + "\download\dvid.mp4") if fileexists(dir + "\download\dvid.mp4.part") else progressbar1.value = 45 exit end if end if loop when ever application run code app stops responding doing wrong or there missing? using wa...

javascript - how to fix object "undefined" -

please tell me how fix, answer comes "object undefined". var dog = { name : "fido", weight : 20.2, age : 4, breed : "mixed", activity : "fetch balls" }; var bark; if (dog.weight > 20) { bark = "woof woof"; } else { bark = "woof woof"; } var speak = dog.name + " says " + dog.bark + " when wants " + dog.activity; console.log(speak); instead of setting bark = "..." , if want set property of dog object, set as: dog.bark = "woof woof"; var dog = { name: "fido", weight: 20.2, age: 4, breed: "mixed", activity: "fetch balls" }; if (dog.weight > 20) { dog.bark = "woof woof"; } else { dog.bark = "woof woof"; } var speak = dog.name + " says " + dog.bark + " when wants " + dog.activity; console.log(speak);

javascript - window.open() opens a blank screen in chrome -

i checked same code in firefox , works perfectly. in fact, worked in chrome few weeks back, i'm getting blank screen. the code below: the function triggers on button click. function saving() { var saveurl = canvas.todataurl(); window.open(saveurl, "_blank", "location=0, menubar=0"); } var win=window.open(); win.document.write("<img src='"+canvas.todataurl()+"'/>");

node.js - Better way to create a web application with Java and Vue -

i'm starting web development little more. use spark framework along vue few apps i've made. while works it's not ideal. the project built maven (and npm vue) , build process looks this. maven packages spark framework java application maven (with frontend-maven-plugin) downloads node/npm , builds vue frontend maven copies compiled resources jar static assets so filesystem looks this /src/main/java (spark framework) /src/main/resources (vue) this leads couple of annoyances. everything in 1 repository. ideally i'd able have separate repo each layer of project (one java, 1 vue) development workflow isn't ideal. if want test java part of app, still spend time compiling frontend (vue) a minor issue, while working in ide, i'm dealing nested folders. anytime want edit frontend, folder structure looks /src/main/resources/project-vue/ here's 1 of projects uses model so question is: what's better way structure application?

python - Django URLs error: view must be a callable or a list/tuple in the case of include() -

after upgrading django 1.10, error: typeerror: view must callable or list/tuple in case of include(). my urls.py follows: urlpatterns = [ url(r'^$', 'myapp.views.home'), url(r'^contact/$', 'myapp.views.contact'), url(r'^login/$', 'django.contrib.auth.views.login'), ] the full traceback is: traceback (most recent call last): file "/users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) file "/users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run self.check(display_num_errors=true) file "/users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/management/base.py", line 385, in check include_deployment_checks=include_deployment_checks, file "/users/alasdair/.virtualenvs/django110/...

java - How can I make my CheckBox allign in Left side and what should I use layout to make it every checkbox print in another line? -

how can make checkbox allign in left side , should use layout make every checkbox print in line? private void preparegui(){ mainframe = new jframe("aime's store"); mainframe.setsize(400,400); mainframe.setlayout(new gridlayout(2,1)); mainframe.addwindowlistener(new windowadapter() { public void windowclosing(windowevent windowevent){ system.exit(0); } }); headerlabel = new jlabel("", jlabel.left); statuslabel = new jlabel("",jlabel.left); statuslabel.setsize(350,100); controlpanel = new jpanel(); controlpanel.setlayout(new flowlayout()); mainframe.add(headerlabel); mainframe.add(controlpanel); mainframe.add(statuslabel); mainframe.setvisible(true); } how can make checkbox allign on left? final jcheckbox chkcolgate = new jcheckbox("colgate"); final jcheckbox chkhappy = new jcheckbox("happy"); final jcheckbox chkbeam = new jcheckbox("beam...

c - The Output screen freezes after taking the first input and the graphics VDU is not displayed -

Image
my code compiles without warnings , errors when run it, output screen freezes after accepting first input , stops responding abruptly after can't apparently spot bug(s) in code. //conway's game of life #include<stdio.h> #include<stdlib.h> #include<graphics.h> #include<conio.h> void setup() { int x,y,gd=detect,gm,i=0,j,n,a[181][181]; unsigned long turns; printf("enter number of pixels = "); scanf("%d",&n); printf("enter number of turns = "); scanf("%lu",&turns); srand(time(0)); initgraph(&gd,&gm,"c://turboc3//bgi"); setbkcolor(11); for(i=0;i<181;i++) { for(j=0;j<181;j++) a[i][j]=0; } for(i=1;i<=n;i++) { x=rand()%181; y=rand()%181; a[y][x]=1; putpixel(x,y,4); } } void main() { clrscr(); setup(); getch(); closegraph(); }

c - Enabling kernel logs, related ipsec pf_key -

i trying set ipsec sa(security association), while doing wanted set authentication , null encryption. using "socket(pf_key, sock_raw, pf_key_v2)" pf_key socket type. for reason kernel throwing error , wanted see kernel debug logs. can please enable kernel logs ipsec using pf_key. debugging narrow down. regards, ashwin.

variables - How to correctly use setq in elisp? -

in emacs config try configure project root jedi using following code: (setq jedi:server-args '("--sys-path" (projectile-project-root))) which throws a: deferred error : (wrong-type-argument stringp (projectile-project-root)) (i have (setq debug-on-error t) backtrace shows nothing) if hardcode path works expected: (setq jedi:server-args '("--sys-path" "/some/path")) to give line context, here's surrounding code: (add-hook 'python-mode-hook 'jedi:setup) (setq debug-on-error t) (defun jedi-config:setup-server-args () (message (format "configuring current project dir: %s" (projectile-project-root))) (setq jedi:server-args '("--sys-path" (projectile-project-root)))) (add-hook 'python-mode-hook 'jedi-config:setup-server-args) how can set server-args jedi using projectile variable? i figured out - rather simple really: (setq jedi:server-args (list "--s...

c++ - Installed Cuda 8 and it seems to be missing npp.lib -

i have old code inherited , trying upgrade latest cuda, installed cuda 8 when compiling complains not being able find npp.lib, checked c:\program files\nvidia gpu computing toolkit\cuda\v8.0\lib\x64 , cant find it, see bunch of npp{xxx}.lib xxx more text, nothing npp.lib. has been removed in latest cuda? thanks in advance. yes, npp.lib replaced nppi.lib , npps.lib , nppc.lib somewhere around cuda 6.5 or before. referred in cuda 8 npp documentation , chapter 1: note: starting release 6.5, npp provided static library (libnppc_static.a, libnppi_static.a, , libnpps_static.a) on linux, android, , mac oses in addition being provided shared library. static npp libraries depend on common thread abstraction layer library called culibos (libculibos.a) distributed part of toolkit. consequently, culibos must provided linker when static library being linked against. libnppi library becoming quite large minimize library loading , cuda runtime startup times recommen...

python 2.7 - Different colors for scatter plots based on origin of data -

i have list called 'samples', loading several images list 2 different folders, let's folder1 , folder2. convert list dataframe , plot them in 2d scatter plot. want scatter plot show contents folder1 red color , contents folder2 in blue color. how can accomplish this. code below: samples = [] folder1 = glob.iglob('/home/..../folder1/*.png') folder2 = glob.iglob('/home/..../folder2/*.png') fname in folder1: img = misc.imread(fname) samples.append((img[::2, ::2] / 255.0).reshape(-1)) fname in folder2: img = misc.imread(fname) samples.append((img[::2, ::2] / 255.0).reshape(-1)) samples = pd.dataframe(samples) def do_iso(df): sklearn import manifold iso = manifold.isomap(n_neighbors=6, n_components=3) iso.fit(df) = iso.transform(df) return def plot2d(t, title, x, y): fig = plt.figure() ax = fig.add_subplot(111) ax.set_title(ti...

Reactjs listen for state changes in app component -

i'm relatively new react. i'm wanting listen state changes menu component have. need have state changes bubble the highest level in app, being app.jsx itself. have tried various methods in app listen events none of them have worked far. i'm not using redux in app it's menu i'm opening , closing. how can listen change throughout app? an assistance appreciated. !-- component function export default class comp extends react.component { constructor(props){ super(props); this.toggledropdown = this.toggledropdown.bind(this); this.state = { isopen: false } } toggledropdown = () => { const toggledisopen = this.state.isopen ? false : true; this.setstate({ isopen: toggledisopen }); } render = () => <button onclick={this.toggledropdown}>menu</button> } !--- app export default class app extends react.component { constructor(props) { super(props); } componentdidupdate(prevprops, prevstat...

Console opens then immediately closes, but code checkst out (Python, Sublime) -

hi i'm relatively new coding , don't know why code isn't working gender = input("what gender(m/f)?") if gender.upper() == m: throw = paper elif gender.upper() == f: throw = rock else: print("issue") print throw which editor/runtime using? should able configure keeping console open when program exits can see errors. in specific case looks you're using python 3, , need surround print argument parentheses here too: print(throw) as using quotes around "m" , "f" signify they're strings.

c# - Error 403.14 forbidden -

i having error 403.14 after deploying website worked fine @ locaalhost. error msg says either have not set default page in iis(but have default page because working @ localhost) or there other problem iis. know not case because when using web.config file of project of mine, first page working(not other because dynamic pages , need connection string ich giving error of own in case). so trying figure out problem web.config unable so. hoping community might me. posting both web.config, 1 of project , giving error 403.14 , 1 project working..i not posting connectionstrings due security reasons. also thought worth mentioning error getting iis , not yellow screen of error. <?xml version="1.0" encoding="utf-8"?> <!-- more information on how configure asp.net application, please visit http://go.microsoft.com/fwlink/?linkid=301880 --> <configuration> <configsections> <!-- more information on entity framework configuration, visit ...

inheritance - C# access children's static member in parent -

i have class foo, base class lot other classes such bar , baz, , want calculation within foo using static members in bar , baz, shown below: public class foo{ public result1 { get{ return field1; } } } public class bar : foo{ public const int field1 = 5; } public class baz : foo{ public const int field1 = 10; } the solution can think of wrap fields in container, add identifier each object, , use function return fields, so bar : foo{ public readonly int id = 0; public static wrapper wrapper; } public wrapper getwrapper(int id){ switch(id){ case 0: return bar.wrapper; } } however, can see, need maintain 1 additional class , function, , i'd rather not fragment code. there alternative? edit what asking for, i.e. accessing static or const value in subclass base class technically possible, doing violate principals of solid oo design. also, since need instance of specific subcl...

ios - UICollectionview cells change when scrolling -

Image
my uicollectionview looks this: my uicollectionviewcell contains image, , setting corner radius property trying make round, result. same goes image in headerview. moreover uicollectionviewcells change when scroll , randomly change appearance, being round, diamond shaped , icons being black. here code i'm using collectionviewcell: func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) -> uicollectionviewcell { //1 let cell = collectionview.dequeuereusablecell(withreuseidentifier: "collectionviewcell", for: indexpath) as! collectionviewcell cell.imageview.layoutifneeded() cell.imageview.layer.maskstobounds = true cell.backgroundcolor = uicolor.clear cell.imageview.tintcolor = uicolor.white cell.imageview.layer.borderwidth = 2 cell.imageview.layer.bordercolor = uicolor.white.cgcolor cell.imageview.layer.cor...

normalization - VB.NET Normalizing Data [1, -1] -

i using following code normalize data: public function normalizedata(values double()) double() dim min = values.min dim max = values.max dim outlist(values.count - 1) double = 0 values.count - 1 outlist(i) = (values(i) - min) / (max - min) next return outlist end function this returns values 0 1 accordingly. confused on how make normalize between [1, -1] instead of [1, 0]. you know how normalise range of 0 1. if want range -1 1, need multiply normalised data 2 , subtract 1. as said in comment, modify statement inside loop adjust data: outlist(i) = 2 * (values(i) - min) / (max - min) - 1 the equivalent statement denormalise data be: outlist(i)= (values(i) + 1) * (max - min) / 2 + min if need normalise , denormalise several arrays of data, suggest creating normaldata class can store normalised data maximum , minimum values , has properties return either normalised or denormalised values. here example of such class. can create us...

google app engine - BigQuery api Java NoClassDefFoundError -

i’m developing java application google app engine. therefore, wanted show data stored in google bigquery. how can use provided apis run app locally in eclipse? i have downloaded “gcloud-java-bigquery-0.2.8.jar” , copied file in web-inf/lib. clicked on build path in eclipse , selected file. code, still simple, had no errors in eclipse: import com.google.cloud.bigquery.bigquery; import com.google.cloud.bigquery.bigqueryoptions; public class quickstartsample { public static void runbq(){ bigquery bigquery = bigqueryoptions.defaultinstance().getservice(); } } but when compile run on google app engine localy get: "java.lang.noclassdeffounderror: com/google/cloud/bigquery/bigqueryoptions" java.lang.noclassdeffounderror: com/google/cloud/bigquery/bigqueryoptions @ testpackage.dto.quickstartsample.runbq(quickstartsample.java:38) @ testpackage.getbigquery.dopost(getbigquery.java:27) @ javax.servlet.http.httpservlet.service(httpservlet.java:637) ...

HTML justify content and span -

Image
.d1 { background-color: red; display: flex; justify-content: center; } .s1 { color: blue; } <div class="d1"> <u>list:</u> <br>item1 <br>item2 <br><span class="s1">item3</span> </div> i trying make div contents aligned in center. use above code display text list: item1 item2 item3 1 below other, list: underlined , item3 have blue color gives strange results: item1 , item2 item3 is... on top , next list: ... what's matter , how can fix this? ty you can fix not using flex inline-block , wrapper <div> instead. .d1 { background-color: red; text-align: center; } .d2 { display: inline-block; text-align: left; } .s1 { color: blue; } <div class="d1"> <div class="d2"> <u>list:</u> <br>item1 <br>item2 ...

Nginx Configuration to Apache -

i'm trying port conf file nginx apache. right collegue running nginx, use apache instead of nginx. the nginx configuration looks this: server { listen 80; server_name my_server_name; root /dir_project/web; //angular location / { root /dir_project/web/front; try_files $uri /index.html; } location ~ ^/(uploads)(/.*)$ { root /dir_project/app/data; } //symfony location ~ ^/(assets|bundles)(/.*)$ { #try serve file directly, fallback app.php try_files $uri /app.php$is_args$args; } location ~ ^/(app_dev|config)\.php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param script_filename$document_root$fastcgi_script_name; fastcgi_buffer_size 32k; fastcgi_buffers 256 32k; fastcgi_max_temp_file_size 0; include fastcgi_params; } error_log /dir_p...

php - Simplest way to draw graphical elements based on information from a MySQL database -

i trying figure out simplest way draw graphical elements based on information mysql database. the information in database looks this: x(1),0.1,0.7,0.2 z(0.5),0.2,0.3,0.5 etc... i want draw grid of boxes. fill in boxes based on information mysql database. i understand can use php retrieve information. how go retrieving info drawing box? guess asking how bridge gap server side client side when trying draw things. found bunch of code on how display text not how draw boxes different fills change on various data.

aerospike - Unable to use stream UDFs on MAPKEYS index -

Image
i have bin map datatype , created secondary on mapkeys. want run udf filter on mapkeys index. gives error aerospike_err_index_not_found. this aql query: aql> aggregate test.check_password('hii') on test.user in mapkeys pids = 'test2' error: (201) aerospike_err_index_not_found whereas normal query works aql> select * test.user in mapkeys pids = 'test2' returns data sample data inserted testing, in ideal case map of string object aql> insert test.user (pk, pids, test2, test1) values ('k1', map('{"test1": "t1", "test2": "t2", "test3":"t3", "test4":"t4", "test5":"t5"}'), "t2bin", "t1bin") aql> insert test.user (pk, pids, test2, test1) values ('k2', map('{"test1": "t1", "test3":"t3", "test4":"t4", "test5":"t...

ajax - Javascript Button OnClick not working, method runs normally -

i trying create button in javascript, when clicked send ajax request php code. i have setup 3 buttons same thing , working fine. the bizarre thing if call method directly runs fine. the code button: <button id="toggle-button">toggle</button> the javascript: var togglebutton = document.getelementbyid('toggle-button'); ... function init() { ... togglebutton.onclick = handletoggleclick; ... } function handletoggleclick(event) { alert("sending request"); var admin_url = "http://localhost/wp-admin/admin-ajax.php"; var data = { action : 'toggle', } $.post(admin_url, data, function(resp) { alert(resp); }); } i have called following in chrome developer tools console: handletoggleclick(null); // request sent autoschedulebutton.onclick(); // request sent autoschedulebutton.onclick; //it prints out function autoschedulebutton; //it displays html of button. as mentio...

c# - [TemplateContainer(typeof(MasterPage.Site1))] -

Image
i have error. how can solve it? cs0426: type name 'site1' not exist in type 'masterpage' here masterpage code: you need set inherits attribute on markup of master page qualified class name . saying open " site1.master.cs " , see class name inherits masterpage .if class part of namespace should set youtr inherits attribute [namespace].[classname] for example in sample project. master page has following directive on top <%@ master language="c#" autoeventwireup="true" codefile="site.master.cs" inherits="sitemaster" %> and codebehind class (site.master.cs) : see sitemaster class master page inherits from. asp.net form engine compiles markup class derives base class behind scenes public partial class sitemaster : masterpage { private const string antixsrftokenkey = "__antixsrftoken"; private const string antixsrfusernamekey = "__antixsrfusername"; priva...

c++ - Efficient Value type -

i want create efficient , easy use value type. base of value boost::variant (and std::variant in future), i'm new in it. , have questions: in code below, necessary use recursive variant? is possible not inherit boost::variant ? maybe more efficient way exists? do have comments or suggestions on code below (it's not completed code, draft)? class value; typedef std::string string; typedef std::vector<char> bindata; typedef string url; typedef unsigned long long uid; tsw_strong_typedef(std::time_t, time) typedef std::vector<value> valuearray; typedef std::vector<string> stringarray; //typedef std::pair<string, value> namevalue; typedef std::list<value> valuelist; typedef std::list<string> stringlist; typedef std::map<string, string> stringstringmap; typedef std::map<s...

sas - pick every first occurrence of the column value over a period of time -

i have data shown below. msisdn date net_type 11111 01/01/2017 1 11111 02/01/2017 1 11111 03/01/2017 1 11111 04/01/2017 2 11111 05/01/2017 2 11111 06/01/2017 2 11111 07/01/2017 2 11111 08/01/2017 2 11111 09/01/2017 1 11111 10/01/2017 1 11111 11/01/2017 1 11111 12/01/2017 1 11111 13/01/2017 1 11111 14/01/2017 2 11111 15/01/2017 2 11111 16/01/2017 2 i looking solution create new variable helps pick every first , last occurrence of net_type on period of time (date values not fixed, net_type can 1 or 2 days or months or years). solution looking below. msisdn date net_type indicator 11111 01/01/2017 1 1 11111 02/01/2017 1 0 11111 03/01/2017 1 1 11111 04/01/2017 2 1 11111 05/01/2017 2 0 11111 06/01/2017 2 0 11111 07/01/2017 2 0 11111 08/01/2017 2 1 11111 09/01/2017 1 1 11111 10/01/2017 1 0 11111 11/01/2017 1 0 11111 12/01/2017 1 0 11111 13/01/2017 1 1 11111 ...

wordpress - Jetpack Tiled Gallery not appearing -

Image
i´m trying create new tiled gallery using jetpack, without success... have activated 'photon' option in jetpack panel: but when try create on post on page option not appear: clue?

c# - UWP get data usage -

i love programming uwp , start new program c# , uwp. want network usage each connection in target system. read document in msdn , write code app: public async static task<list<connectionreport>> getnetworkusageasync(string connectionname, datetimeoffset starttime, datetimeoffset endtime, datausagegranularity granularity) { var granularitytimespan = granularitytotimespan(granularity); try { var connectionprofile = getconnectionprofile(connectionname); var networkusages = await connectionprofile.getnetworkusageasync(starttime, endtime, granularity, new networkusagestates()); list<connectionreport> listnetworkusage = new list<connectionreport>(); foreach (var networkusage in networkusages) { var connectionreport = new connectionreport() { date = starttime.date.tostring(dateformat), download = convertbytestomb(networkusage.bytesreceived), ...

hadoop - How to bulk load data to hbase in python -

i wrote mr job in python running streaming jar package. want know how use bulk load put data hbase. i konw there 2 ways data hbase bulk loading. generate hfiles in mr job, , use completebulkload load data hbase. use importtsv option , use completebulkload load data. i don't know how use python generate hfile fits in hbase. , try use importtsv utility. got failure. followed instructions in [example]( http://hbase.apache.org/book.html#importtsv ).but got exception: exception in thread "main" java.lang.noclassdeffounderror: org/apache/hadoop/hbase/filter/filter... now want ask 3 questions: whether python used generate hfile streaming jar or not. how use importtsv. could bulkload used update table in hbase. big file bigger 10gb every day. bulkload used push file hbase. the hadoop version is: hadoop 2.8.0 the hbase version is: hbase 1.2.6 both running in standalone mode. thanks answer. --- update --- importtsv works correctly. but stil...

python - Setting the time of datetime.now() -

i trying current datetime , set time 00:00:00 . to this, call: current_date = dt.datetime.now() current_date.replace(hour=0, minute=0, second=0) print(current_date) the output is: 2017-08-20 10:43:56.3243245 that not expect. however, if do: current_date = dt.datetime(dt.datetime.now().date().year,dt.datetime.now().date().month,dt.datetime.now().date().day,0,0,0) everything expect , result: 2017-08-20 00:00:00 why this? going on?? why replace not work? replace returns new datetime instance, should do: >>> current_date = dt.datetime.now() >>> current_date = current_date.replace(hour=0, minute=0, second=0, microsecond=0) >>> print(current_date) 2017-08-20 00:00:00 you should replace microsecond=0 in order make 00:00:00 .

c - Using Graphviz with Clion in Windows -

i'm new using external libraries in c silly mistake. reference errors when try run below program using provided cmakelists.txt. can see issue is? cmakelists.txt cmake_minimum_required(version 3.6) project(learning) set(cmake_cxx_flags "${cmake_c_flags}") set(graphviz_include_dir "c:\\program files (x86)\\graphviz2.38\\include\\graphviz") set(source_files main.c) include_directories("${graphviz_include_dir}") add_executable(learning ${source_files}) main.c #include <gvc.h> #include <cgraph.h> int main() { agraph_t *graph; agnode_t *nodea, *nodeb; agedge_t *edge1; agsym_t *symbol1; gvc_t *gvc; gvc = gvcontext(); graph = agopen( "graph", agdirected, null); nodea = agnode(graph, "nodea", 1); nodeb = agnode(graph, "nodeb", 1); edge1 = agedge(graph, nodea, nodeb, 0, 1); agsafeset(nodea, "color", "red", ""); gvlayoutjobs(gvc...

javascript - Can't load scripts because of node.js -

i can't use <script src="node_modules/jquery/dist/jquery.min.js"></script> in index.html file because of: failed load resource: server responded status of 404 (not found) http://localhost:8080/node_modules/jquery/dist/jquery.min.js this happens because of else statement in server file code: var http = require('http') var url = require('url') var fs = require('fs') var server = http.createserver((req, res) => { let parsedurl = url.parse(req.url, true) if (parsedurl.pathname === '/') { console.log('home page') fs.readfile('./index.html', (err, data) => { res.writehead(200, { 'content-type': 'text/html' }) res.end(data) }) } else if (parsedurl.pathname === '/readjson') { console.log('read json') fs.readfile('./data.json', (err, data) => { res.writehead(200, { 'content-type': 'application/json...

mariadb - Is it possible for another user to insert in the middle of a multi-value insert? -

is possible user insert in middle of multi-value insert? multi-value insert mean: https://mariadb.com/kb/en/mariadb/how-to-quickly-insert-data-into-mariadb/#multi-value-inserts reason asking make sure auto-increment values multi-value insert serial , insert cannot insert value in middle them. and insert cannot insert value in middle them there's no table locking involved cannot assume this. the reason asking make sure auto-increment values multi-value insert serial what for? need unique taken care database. if rely on order of values looks architecture/design wrong @ point.

dns - If I set four different Nameservers on one Domain -

1st server: ns1.example.com on 123.123.123.123 ns2.example.com on 123.123.123.123 2nd server: ns1.example.com on 321.321.321.321 ns2.example.com on 321.321.321.321 if set these nameserver 1 domain , if server gets corrupted domain work on both server if server b in working. thanks...

pandas - Python - take rows of data and place into single column -

i have following dataframe numerous rows. take multiple columns , condense 1 column. player | 0 | 1 | 2 | 3 | 4 edgerrin james | 1st tm all-conf. | ap 1st tm | fw 1st tm | sn 1st tm | pro bowl tony gonzalez | 1st tm all-conf. | ap 1st tm | none | none | none ... | ... | ... | ... | ... | ... i'm trying figure out how restructure awards in 1 column. dataframe follows: player | awardid edgerrin james | 1st tm all-conf. edgerrin james | ap 1st tm edgerrin james | fw 1st tm edgerrin james | sn 1st tm edgerrin james | pro bowl tony gonzalez | 1st tm all-conf. tony gonzalez | ap 1st tm if 'none' cells included, i'd fine because know how filter out after, can't figure out first part. use set_index on player , stack in [750]: df.set_index('player').stack().reset_index(name='awardid').drop('level_1', 1) out[750]: ...

Javafx refresh src folder -

i wrote program each user has account, , can change head portrait. when sign in, directory "src/username/password" created, , image "src/username/password/headportrait.jpg" created. default headportrait expected show on label, problem occurs: image added "src/username/password" directory, src folder in eclipse not refreshed, program can't find added image , throws exception. so, must exit program ,refresh src folder , run program again. that's absolutely not expect. should that? here important part of code: string username=name.gettext(); //"name" textfield string password=word.gettext(); //"word" textfield file namefile=new file("src/"+username); file passwordfile=new file("src/"+username+"/"+password); if(namefile.mkdirs()){ if(passwordfile.mkdirs()){ file default=new file("src/images/headportrait.jpg");//the default fead portrait put under directory. try{ ...

haskell - Clean way to do rewrite rules -

i have following toy language: module lang data op = move int -- move pointer n steps | add int -- add n value under pointer | skip -- skip next op if value under pointer 0 | halt -- end execution deriving (show, eq) type program = [op] the language has finite tape of memory cells wraps around, , pointer points @ cell. cells zero. program executed repeatedly until halt instruction read. now write function optimizes given program. here optimizations perform: | original code | optimization | |---------------------|----------------| | move : move b : x | move (a+b) : x | | add : add b : x | add (a+b) : x | | move 0 : x | x | | add 0 : x | x | | skip : skip : x : y | x : y | | halt : _ | halt | additionally, can optimization on code not directly after skip, because doing change meaning of program. is repeatedly pattern matching on list until no mo...