Posts

Showing posts from June, 2015

php - How to set "class = active" for second tab? -

i have tabs. in first tab "introduction" , "outline" first tab. have set introduction class=active when comes first. when outline comes first not getting how set class active. code below <ul class="nav-tabs" role="tablist"> <?php $tabs = array(); if(!$sessid == "" && !$checkcourse){ $tabs = array("introduction"=>true, "outline"=>true,"announcement"=>false,"discussion"=>false,"review"=>true, "student"=>true, "comment"=>true); } else if($sessid == "") { $tabs = array("introduction"=>true, "outline"=>true,"announcement"=>false,"discussion"=>false,"review"=>true, "student"=>false, "comment"=>true); } else { $tabs = array("introduction"=>false, "outline"=>t

jquery - javascript change event works in bootply not in local -

this question has answer here: why jquery or dom method such getelementbyid not find element? 6 answers i change picture on site when selector/combobox changed. works in bootply, looks change event not caught neither in local env, nor in appspot... the html code: <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="/static/js/nbafantasy.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" ></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <link rel

angular - HTML input type number doesn't work in edge -

i developing angular1 application , have input type number. <input type="number" name="min" ng-model="vm.item.min" ng-max="vm.item.max" required > but not work: i can enter string i don't have arrows increase/decrease value. how can fix without polyfills? so it's bug both angularjs , edge, seen in discussion below: https://github.com/angular/angular.js/issues/15366 a snippet proposed fix problem oneself: .directive('input', () => { if(currentbrowser!="edge") return {}; return { link: (scope, elem) => { if (elem[0].type === 'number') { elem.on('keydown', evt => { switch (evt.which) { case 38: // up_arrow case 40: // down_arrow scope.$evalasync(() => elem.triggerhandler('change')); break; } }); } } }; });

if statement - How to use OR condition for Keywords in Robot Framework? -

i in need check condition going passed if 1 of conditions being true. the keywords want use below: page should contains element //some xpath or page should contains element //some xpath or page should contains element //some xpath or page should contains element //some xpath used run keyword if not working you can join xpath result sets | equivalent or. ${count} matching xpath count //div[@prop='value'|//table[@id='bar']|//p run keyword if ${count} > 0 keyword if want fail if none of xpaths found: page should contain element xpath=//div[@prop='value'|//table[@id='bar']|//p

time - Java, easiest way to identify if one week away or one month etc using dates -

after 20 minutes of coding attempt was, if given dd/mm/year , have current dd/mm/year, if difference in years = 0. difference in months = 0 , difference in days = 7, youre 1 week away. then realized, doesn't take account date wrapping. instance, i'm im given date of 07/01/2017 , current date 06/29/2017. algorithm return false, youre in fact less 1 week away. (depending on month aswell i.e 30 or 31 days). therefore question is, easiest way check if youre either. 1 month, 2 weeks or 1 week away date when 1) given date , 2) doing time given localdatetime.now() here example 7 days localdate old = localdate.of(2017, 6, 29); localdate current = localdate.of(2017, 7, 1); system.out.println(old.plusdays(7).isbefore(current)); old = localdate.of(2017, 6, 23); system.out.println(old.plusdays(7).isbefore(current)); the output be false true

axapta - Query metadata for EntitySet in Dynamics 365 for Operations -

when querying https://orgurl/data/customers . receive list customers. how can find out properties/attributes of customer, without querying metadata -> /data/$metadata

javascript - Fabric js How to set percentage object's position -

i'm using fabric.js , changing canvas size dynamically, need scale canvas objects appropriate objects indents (in percent depending on canvas size) top , left. how can set top , left objects position in percent? like in css: top: 32% left: 10% // set canvas size dynamically resize event this.canvas.setwidth(size.width); this.canvas.setheight(size.height); in opinion should have 2 values in order calculate resize ratio. initialcanvaswidth , finalcanvaswidth. by assuming have initialcanvaswidth value in page load. can calculate resize ratio on every resize function this: window.onresize = utility.debounce(() => { const finalcanvaswidth = canvaswrapper.clientwidth const resizeratio = (finalcanvaswidth / initialcanvaswidth).tofixed(3) setcanvassizeandposition() scaleobjectsoncanvas(resizeratio) }, 250) by wrapping canvas div , using new width after resize, can set new canvas wid

Get Google Sheets Last Edit date using Sheets API v4 (Java) -

Image
i'm using google sheets api v4 in android. https://developers.google.com/sheets/api/quickstart/android i need know when last modification sheet made (including user); need guy: i'd this: spreadsheet spreadsheet = sheetsservice.spreadsheets().get(spreadsheetid).setincludegriddata(true).execute(); date date = spreadsheet.getproperties().getlasteditdate(); but, of course, no such getlasteditdate() property method exists. there parameter or api method call data? even better modified date each cell... i'd settle date of entire spreadsheet or sheet. this not available in sheets api, may able use drive api's files.get method, includes 'modifiedtime' in response. (note default not include modified time, have explicitly ask in 'fields' parameter.)

php-cs-fixer from symfony command -

i want create command runs php-cs-fixer fix src/appbundle --rules=@symfony i need command able pass parameters --path or --rules . i know how build command, don't know how run php cs fixer it. can provide guidance? le: not needed anymore since choose other solution resolve problem will parameters change on every call, or often? if not, or there small number of variations, put 1 or more shell scripts, or makefile. even if path change, extracting relevant path variable makes easier find, , change - setting constant in php code. #!/bin/sh # file: fixphpstyles.sh srcpath=src/appbundle /usr/local/bin/php-cs-fixer fix $srcpath --rules=@symfony

How to add for loops in python, in order to not to write the same thing all over? -

name = raw_input("please enter name, know how address you!" " ") semester = int(raw_input("nice meet you" + " " + name + ", " + "please tell me, how many semesters have completed?" " ")) if semester == 1 : num1 = float(input("ok" + " " + name + ", " + "please enter 1-st semester gpa: ")) = float(num1)/1 if >= 3.5 : print "good job " + name + ", " + "your gpa great!" if > 3 , <3.5 : print "nice, sure can better," + " " + name + "." if <= 3 , > 2 : print name + " " + "don't give up! should try harder!" if <= 2 : print name + " " + "you better work harder, or on probation!" print name + "'s" + " overall gpa is" + " " + str(a) elif semester == 2

Scrollview not working with viewpager android -

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" tools:context="com.app.trainingapp.home.activity.productinfodetail"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/apptheme.appbaroverlay" android:visibility="visible"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="@dimen/toolbar_height&quo

angular - Wakanda How to access and display the data in mobile side? -

in getting started on wakanda explain how can bind data in web app via angularjs. http://wakanda.github.io/get-started/bind-data-in-webapp.html the mobile app work ionic 2, , want know, how can bind data web app ? my goal have same result getting started on mobile side. can me ? you can achieve same result in ionic 2 project using wakanda.service . have : in home.ts example import { wakanda } '../../app/wakanda.service'; add wakanda providers array @component({ selector: 'page-home', providers: [wakanda], templateurl: 'home.html' }) add wakanda constructor constructor(public navctrl: navcontroller, public wakanda: wakanda) {} you can use service : getheros() { this.wakanda.getcatalog().then(ds => { ds['superhero'].query({orderby:"id desc",pagesize:3}).then(collection => { this.favoritesuperheroes = collection.entities; }); }); } disp

Applying business rules using xslt -

i have requirement choose value xml based on business rules. below source xml <?xml version="1.0" encoding="utf-8" ?> <ns2:getplotownersbyplotidresponse xmlns="urn:tst:tst:aad:aaeett:data:profile:messages" xmlns:ns2="urn:tst:tst:aad:aaeett:data:profile" xmlns:ns3="http://schemas.microsoft.com/2003/10/serialization/arrays" xmlns:ns4="urn:tst:tst:aad:aaeett:data:profile:data" xmlns:ns5="urn:tst:tst:aad:aaeett:data:profile:fault" xmlns:ns6="http://schemas.microsoft.com/2003/10/serialization/"> <ns2:getplotownersbyplotidresult> <ownerslist> <ns4:ownerwithshares> <ns4:ownerinfo xsi:type="ns4:persondetails" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <ns4:ownertype>person</ns4:ownertype> <ns4:personinfo>

java - Force FileSystem of Path -

i want generate clean unix path style java program. i'm using java.nio.file.paths in order manipulate paths in clear way, uses file.separatorchar , other system dependant separators different machine other. i'm looking way sure have unix path style, regardless of program launched. ex: system.out.println(new paths.get("/home/user/test.txt").getparent()); expected output on unix env: $> /home/user expected output on windows env: $> /home/user path implements iterable , it's quite easy it: public string tounixpath(path path) { stringbuilder sb = new stringbuilder(path.isabsolute() ? "/" : ""); (path element : path) sb.append(element).append('/'); return sb.tostring(); }

eclipse - Rewrite a file in use in java -

i play @ minecraft (famous java games), want rewrite jar file minecraft using (replace 1.7.10-optifine_hd_u_d6.jar other 1.7.10-optifine_hd_u_d6.jar) when minecraft running , whitout closing minecraft test code, file not delete because minecraft using it. https://hastebin.com/iwuxiyokuy.cpp (i put code in code of minecraft, thought if minecraft sleeping, not considered file in use) but, tried ideas , found this: in eclipse can rewrite 1.7.10-optifine_hd_u_d6.jar without closing minecraft (like http://hpics.li/4971e5f ) so, how can rewrite, in java, 1.7.10-optifine_hd_u_d6.jar eclipse when minecraft running , without closing minecraft ? have nice day ! (sorry bad english i'm young , i'm french :/) the problem operating system (windows in case) locks file because being used minecraft (java). there nothing can in java work around limitation. the dialog says file exists warning eclipse don't overwrite existing/the wrong file accident; has nothing operatin

sql - Inserting Timestamp value into database(Oracle) using php -

Image
i have simple table follow : create table worker ( office_start_time timestamp, office_end_time timestamp ); i have html form follow : <form method="post" action=""> <input type="datetime-local" name="office_start"> <input type="datetime-local" name="office_end"> <input type="submit" name="submit" value="submit"> </form> i want datetime value html form , insert table. have tried following code : $c1 = oci_connect("system", "faisal4590", 'localhost/faisal'); $start_time = htmlspecialchars(date('m.d.y h:i:s', strtotime($_post['office_start']))); $end_time = htmlspecialchars(date('m.d.y h:i:s', strtotime($_post['office_end']))); $stmt = "insert worker (office_start_time,office_en

time - MATLAB: Sum rows into events per minute -

in matlab (r2015b) have cell data large time-series: '01-jan-2017 09:01:48' [ 5] '01-jan-2017 09:01:50' [ 2] '01-jan-2017 09:01:51' [12] '01-jan-2017 09:01:53' [ 2] '01-jan-2017 09:01:56' [ 1] '01-jan-2017 09:02:00' [ 1] '01-jan-2017 09:02:01' [ 2] '01-jan-2017 09:02:12' [ 1] '01-jan-2017 09:02:17' [ 2] '01-jan-2017 09:02:19' [ 1] '01-jan-2017 09:02:21' [ 4] '01-jan-2017 09:02:52' [ 1] '01-jan-2017 09:03:00' [ 1] '01-jan-2017 09:03:05' [ 3] '01-jan-2017 09:03:23' [ 2] '01-jan-2017 09:03:26' [ 3] '01-jan-2017 09:03:36' [ 3] '01-jan-2017 09:03:37' [ 2] '01-jan-2017 09:03:38' [ 1] '01-jan-2017 09:03:43' [ 2] '01-jan-2017 09:03:49' [ 2] '01-jan-2017 09:03:51' [ 1] '01-jan-2017 09:03:55' [ 1] however, sum rows events per minute (i

C++ 'if' statement displays every option. Outputs show one Above the other and not one followed by the other. -

first , foremost, newbie when comes c++ try understand struggle. so, problem. have assignment have input 4-digit number , each of digits has represented in form of stars. thing can use have learned till can't use arrays etc while,if,else , basic statements/loop. wondering wrong code because when input 4-digit number doesn't show 4 digits shows every single number in star form 1 above other. can tell me doing wrong because cannot understand anymore. have suggestions how can display numbers chosen not 1 above other, 1 followed other. thank guys in advance! appreciated! #include <iostream> using namespace std; /* run program using console pauser or add own getch, system("pause") or input loop */ int main(int argc, char** argv) { int a,b,c,d; int a1,b1,c1,d1; cout<<"input 4 digit number:"<<endl; cin>>a; a1 = / 1000; b = % 1000; b1 = b / 100; c = b % 100; c1 = c / 10; d = c % 10; d1 = d / 1; if (a1==1) cout<<&q

google cloud platform - Data Proc pricing estimate. -

i had confusion on dataproc billing. used google cloud pricing calculator: https://cloud.google.com/products/calculator/#id=e6effb8e-5a4b-49cc-8422-e6a1b942423a if using dataproc following config: master node: n1-standard-8 (vcpus: 8, ram: 30 gb) worker node vm class: regular worker node instances: n1-highmem-8 (vcpus: 8, ram: 52 gb) # worker nodes: 2 hours cluster runs per month: 8 the estimate $1.92 per month. price pay or there additional charges google add on use dataproc. appreciated.

automatic ref counting - NSOutlineView:child:ofItem throws EXC_BAD_ACCESS / loss of object "Item" -

my outlineview crashes exc_bad_access when expand column width - or scroll up/down. outlineview has controller 4 basic methods: - (nsinteger)outlineview:(nsoutlineview *)outlineview numberofchildrenofitem:(id)item - (bool)outlineview:(nsoutlineview *)outlineview isitemexpandable:(id)item - (id)outlineview:(nsoutlineview *)outlineview child:(nsinteger)index ofitem:(id)item - (id)outlineview:(nsoutlineview *)outlineview objectvaluefortablecolumn:(nstablecolumn *)tablecolumn byitem:(id)item my app starts displaying contents without problem ,but @ point resizing columns or scrolling, crashes @ : - (id)outlineview:(nsoutlineview *)outlineview objectvaluefortablecolumn:(nstablecolumn *)tablecolumn byitem:(id)item then, item nil. problem. looks arc issue, in controller, own object returned outlineview, either using method myobject=[nodeobject new]; or myobject =[node copy]; // node != nil checked before what's important too: return item directly object. assure

Spring Controller and Jquery Ajax are unable to convert Json string to Object -

i have been struggling jquery ajax post data spring controller @requestbody. i able send json string , capture json string in controller. but, unable send json string jquery ajax controller [which unable convert object]. below code snippet: **ajax call:** function postload(){ $.ajax({ type : 'post', url : "ajaxhai.do", contenttype : "application/json", cache : false, data : responseobject, **//json-string** datatype :"html", success : function(data, textstatus) { console.log("post success"); $("#ajaxcontent").html(data); }, error : function(request, status, error) { console.log("failed" + error); }

android - How to fix this Google play store warning: Your app(s) are using an unsafe implementation of the HostnameVerifier interface -

i getting warning when trying push update android application. using retrofit okhttp client https calls. have tried adding okhttp client like: okhttpclient.builder clientbuilder = new okhttpclient.builder(); clientbuilder.hostnameverifier(new hostnameverifier() { @override public boolean verify(string hostname, sslsession session) { if (hostname.equalsignorecase("myhost.com")) { return true; } else { return false; } } }); but still getting same warning. can due library using. if so, how can fix this?

types - Powershell parameter block accepting an array of [PSTypeName("MyType")] -

if create object pstypename can enforce parameters function being of type, so: function new-nugetdependency{ param( [string]$id, [string]$version ) [pscustomobject]@{ pstypename = "nugetdependency" id = $id version = $version } } and function show-nuggetdependency{ param( [pstypename("nugetdependency")]$dependency ) write-host ("dependency " + $dependency.id + " - " + $dependency.version) } however! there doesn't seem way of saying $dependency array of nugetdependency . if wanted function take in multiple dependencies i'm stuck. what missing? got there, think. replacing second function works: function show-nuggetdependency{ param( [pstypename("nugetdependency")][object[]]$dependency ) foreach($dependencyitem in $dependency){ write-host ("dependency " + $dependencyitem.id + " - "

c# - Can Code Style preferences be shared? -

Image
i've read vs2017 supports .editorconfig , can create own .editorconfig files @ solution/project level , share them, however, wondering if machine/user -wide configuration can somehow shared? i mean these settings: or wrong in thinking these settings related new .editorconfig support? yes, can. should go: open solution in visual studio. go "tools" go "import , export settings" choose export follow prompts. if follow export, you'll see exports configuration settings script parse , read when imported instance of visual studio.

visual c++ - How to change the top of the focus rect in C++ -

Image
i using cbutton create checkbox: cbutton foo; foo.create("this foo", ws_child | ws_visible | ws_tabstop | bs_autocheckbox | bs_multiline | bs_top , crect(0,0,0,0), this, foo_id); and using drawtext function set multiline , size of rect checkbox. pdc->drawtext("this foo", -1, rect, dt_left| dt_wordbreak | dt_noprefix | dt_calcrect ); csize csize = (rect.width(), rext.height()) foo.movewindow(left_space, -1, csize.cx + 5, csize.cy); but focus rectangle of checkbox cropped @ top: any idea how fix this?

forms - How to add custom User model to Registrationform in Django? -

i have done lot of research these days dont how done. have basic user model , profile model shown below: class profile(models.model): user = models.onetoonefield(user, null=true) address= models.charfield(max_length=100) posts = models.integerfield(max_length=100) @receiver(post_save, sender=user) def create_user_profile(sender, instance, created, **kwargs): if created: profile.objects.create(user=instance) @receiver(post_save, sender=user) def save_user_profile(sender, instance, **kwargs): instance.profile.save() my forms.py class registrationform(usercreationform): class meta: model = user fields = {'username','email', 'password1', 'password2', 'first_name', 'last_name'} class userprofileform(forms.modelform): class meta: model = profile views.py def register(request): if request.method == 'post': form = registrationform(request.post) if form.is_valid(): user = form.save(

c# - RegEx - Match on XML declarations when the version # is not "1.0" -

i want use regex this. i need find errant xml declarations , not version 1.0 the following valid matches: bad declaration <? xml ver="1.0" encoding="utf-8"?> bad declaration <?xml version="1.0' encoding=utf-8> bad declaration <?xml ?> bad declaration (doesn't start on first line) ..... <? xml ver="1.0" encoding="utf-8"?> version 1.1 (single quotes) <?xml version='1.1' encoding='utf-8'?> version 1.1 (double quotes) <?xml version="1.1" encoding="utf-8"?> erroneous version # <?xml version='999999' encoding='utf-8'?> version 1.1 (multi-line) - not sure if multi-line formatting allowed i've seen done , need check it. <?xml version="1.1" encoding="utf-8" standalone="no" ?> want matches on invalid xml declarations or xml declarations version other 1.0

javascript - Aurelia js add npm package -

i want use following npm package https://www.npmjs.com/package/poker-evaluator can found on github: github.com/chenosaurus/poker-evaluator on project folder ran following command line, npm install poker-evaluator --save and seems installed library -> package json i want able run functions module(poker-evaluator) , can't insert module. tried multiple times , in different ways ... unfortunately, package looking @ relies on nodejs apis, cannot used in browser. if @ source, you'll see: https://github.com/chenosaurus/poker-evaluator/blob/master/lib/pokerevaluator.js#l1 var fs = require("fs"); var path = require("path"); these node apis work files. you'll have use package on server , wrap api aurelia application talk to.

javascript - Is it possible to create a map without hardcoding the class name `Map`? -

i tried write utility function returns object same argument. function works fine classes, except es6 collection types such map: function createinstanceofsameclass(arg) { return object.create(object.getprototypeof(arg)); } const m1 = new map(); const m2 = createinstanceofsameclass(m1); m2.set(1, "x"); // uncaught typeerror: method map.prototype.set called on incompatible receiver #<map> the jsfiddle here . um... can constructor way: function create(obj){ return new obj.constructor(); }

c - sizeof char array inside an union is not printing correctly -

this question has answer here: sizeof union in c/c++ 8 answers union u { int a; float b; char c[10]; }; int main() { union u abc; printf("\n%d",sizeof(abc)); } output: 12 expect output 10.sizeof(char) 1. 10 expect 10. can explain me why 12. this because @ least 1 between float or int data type has 4 bytes alignment requirement. struct gets 2 bytes of padding (so sizeof(struct u) % 4 == 0 ). you can use __attribute__((packed)) or similar features if compiler supports them avoid padding it's not convenient unless have preexisting data conform with. think fact array of packed struct u elements have unaligned float / int members.

javascript - How to draw a line from one element to another element -

this question has answer here: how can connect 2 html elements drawing lines in background canvas? 1 answer i'm creating tree structure. have created numbers in circle using html badges. want draw lines 1 element element. have tried using image left diagonal , right diagonal. not working. this html creating badges: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<span id="0" class="cl w3-badge">0</span><br><br><br><br> <span id="1" class="cl w3-badge">0</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="2" class="cl w3-badge">0</span> this javascript: var data = []; data.push(5); data.push(6); data.push(4); $('.w3-badge').each(function(i, obj) { document.getelementbyid(i).innerhtml = data[

javascript - Custom printing from console.log? -

let's have class. class attribute { constructor(name) { this.name = name; } } and create instance , log console debugging purposes. const test = new attribute('large'); console.log(test); how can output specially formatted string, {attribute} large ? i'm concerned chrome support, node , other browsers nice, too. class attribute { constructor(name) { this.name = name; } tostring(){//simply set string method? return "{attribute} "+this.name; } } as console.log not call string either do: const test = new attribute('large'); console.log(test+""); or create own logging function

Parsing Json in Python Null data -

suppose have following 2 json. a={"id": "tuxnqkfhvunbtta0", "name": "campestre 1a. secc.", "city": { "id": "tuxnq0fhvtk2njy", "name": "aguascalientes" }, "state": { "id": "tuxnuefhvtmwnje", "name": "aguascalientes" }, "country": { "id": "mx", "name": "mexico" }, "geo_information": none, "subneighborhoods": [ ] } b={ "id": "tuxntuxnqkfhvtnosg", "name": "aeropuerto aguascalientes (lic. jesus teran peredo)", "city": { "id": "tuxnq0fhvtk2njy", "name": "aguascalientes" }, "state": { "id": "tuxnuefhvtmwnje", "name": "aguascalientes" }, "country": { "

c++ - Static array overflows stack (seg fault 11) only when inside class definition, but not otherwise...? -

i'd allocate large static array (-- want avoid dynamic allocation, e.g. std::vector, or using 'new', can guarantee physical addresses consecutive , can prefetched effectively). array size determined external factors, they're known ahead of time -- in example, i'll need 3211264 elements. if allocate float array, works fine: #include <iostream> #include <cstdlib> using namespace std; float f[3211264]; int main() { for(int = 0; < 3211264; i++) f[i] = rand(); for(int = 0; < 3211264; i++) cout << f[i]; } however, if wrap array within class, causes seg fault: #include <iostream> #include <cstdlib> using namespace std; class t { public: t(); private: float f[3211264]; }; t::t() { for(int = 0; < 3211264; i++) f[i] = rand(); for(int = 0; < 3211264; i++) c

wordpress - Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /wp-includes/wp-db.php on line 2413 -

i'm getting error when try open 1 of dashboard pages in wordpress script the error message follows: fatal error: allowed memory size of 268435456 bytes exhausted (tried allocate 72 bytes) in /home2/liquifac/public_html/grandviewbiz.com/wp-includes/wp-db.php on line 2413 i asked around , told have increase memory_limit higher 256m, changed 512m , still same problem. so please tell me how fix , should do? ok wordpress saying don't have enough memory available dashboard / admin area. here's few things try: open wp-config.php file in site root , add following define( 'wp_memory_limit', '512m' ); define( 'wp_max-memory_limit', '512m' ); disable plugins , see if issue goes away. if does, start reáctivating plugins 1 1 until issue returns. plugin activated last 1 pushing system limits, although may not single cause of issue. change theme 1 of include wordpress default themes, eliminate theme cause. increase memory av

c - recv()/read() in client never terminates -

i'm trying implement client receives , sends data from/to server. however, while sending works, receive never , program hangs there. this bare bones problem area without error checking. //send data char* message = "list\n"; write(sockfd, message, 5); //receive data int numbytes; char buf[100]; if ((numbytes = recv(sockfd, buf, 99, 0)) == -1) { perror("recv"); exit(1); } buf[numbytes] = '\0'; i tried insanely basic- //send data char* message = "list\n"; write(sockfd, message, 5); //receive data char* buf = calloc(1, 100); read(sockfd, buf, 7); //the message i'm supposed receive 7 bytes, tried 6 , 8 account nulls etc this hangs @ read too. edit: terminates after added shutdown(sockfd, 1); after send data part, while response should ok\n7 try.txt the response ok

neural network - How to shift a sequence (hidden layer) to the left in Keras? -

i have code seems job, behaves differently expect. i want have (non-trainable) layer part of deep learning model, shifts sequence of vectors (hidden layer) 1 step left. framework keras2 theano backend. to provide minimal example, if input layer 3-time-step sequence, 2 hidden components [[0, 1], [2, 3], [4, 5]] then output of layer should shifted left (with 0 padding): [[2, 3], [4, 5], [0, 0]] i figured 1-d convolution job, specify weights appropriately. convolution size of 3, set kernel weights left , middle position 0, , have diagonal weights right position (just copying 1st , 2nd dimension): [[[ 0., 0.], [ 0., 0.]], [[ 0., 0.], [ 0., 0.]], [[ 1., 0.], [ 0., 1.]]] however, if this, vector gets shifted right, not left. working example: import keras import numpy np dim, length = 2,3 input_mat = np.arange(dim*length).reshape(1,length,dim) inp = keras.layers.input(shape=(length,dim)) shift_left_kernel = np.asarray([np.zeros((dim,dim)),np.zeros((di