Posts

Showing posts from March, 2010

woocommerce - Create product with variations in the same request -

i'm using rest api v2 woocommerce 3. i trying insert products variations in same request, can v2 rest api version ? this request: { "create": [ { "name": "9325400137", "type": "variable", "sku": "93254", "status": "pending", "id": "", "attributes": [ { "position": 0, "name": "color", "slug": "color", "options": [ "black", "red" ], "variation": true, "visible": true }, { "position": 0, "name": "size", "slug": "size", ...

python - Automate website validation testing using powershell script? -

i have website in couple of forms needs filled 1 one reach final answer token no. uniquely generated each user. manually testing on regular bases takes following steps: 1) open www.xyz.com 2) fill in first form details i.e. name, age, sex click next 3) fill in second form details i.e. address, zip, employment type click next 4) fill in third form details .... on till form 5 , click finish. 5) after clicking finish redirected final page token no. question: how automate test using powershell script or other scripting language, when run script , completes step 1 one , give me token no. output if test passes ? to give set off, load document in chrome or explorer developers tools activated (press f12) , inspect objects want find. able see dom of document loaded website. here sample login: $ie = new-object -comobject 'internetexplorer.application' $ie.visible= $true $username="username@domain.com" $password="password" $ie.navigate(...

maven - Need two different version JARs in one Java app -

i have java application includes 2 third party jars (amazon kinesis , maxmind geoip2), each using different version of jackson. neither version of jackson works both of third party jars. furthermore, running apache's maven jar pluging - creates uber jar containing dependent classes. given can't change third party jars, don't know how i'm going able accomplish having each third party jar call appropriate version jars of jackson. any ideas? kinesis expecting: com.fasterxml.jackson.dataformat » jackson-dataformat-cbor:2.6.6 com.fasterxml.jackson.core » jackson-databind:2.6.6 and geoip2 expecting: com.fasterxml.jackson.core » jackson-databind:2.8.8.1 use maven shade plugin https://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html to relocate classes.

javascript - Display the corresponding temperature logos with "simpleweatherjs" API -

i relied on exemple : https://codepen.io/fleeting/pen/xklfq , want display logo next days, tried add code display next days temperatures: for(var i=0;i<weather.forecast.length;i++) { html += '<p class="days">'+'<span class="d">'+weather.forecast[i].day+'</span>'+'<span class="val">'+weather.forecast[i].high+'</span>'+'</p>'; } i displayed them don't know ho implemtent logos ? the complete html code: $(document).ready(function() { $.simpleweather({ location: 'austin, tx', woeid: '', unit: 'f', success: function(weather) { html = '<h2><i class="icon-'+weather.code+'"></i> '+weather.temp+'&deg;'+weather.units.temp+'</h2>'; html += '<ul><li>'+weather.city+', '+weather.region+'</li>'; ...

react-navigation, dispatch action to change scene - scene not showing -

i have setup substeps navigator below, first scene, pcdrinkingdays works fine. however, when click dispatch action, component change scene: ondone = () => { this.props.dispatch(navigate(scenes.pc_help_me_calculate)); };` the pchelpmecalculate , doesn't appear, although can see renders in background setting breakpoints. my navigator below. other scenes seem ok, moving first scene seems problem. can help? why isnt component showing? import { substepsnavigator } '../../../navigators'; import pcdrinkingdays '../pcdrinkingdays'; import pchelpmecalculate '../pchelpmecalculate'; import pcunitscalculatorwhat '../pcunitscalculatorwhat'; import pcunitscalculatorsize '../pcunitscalculatorsize'; import pcunitscalculatorstrength '../pcunitscalculatorstrength'; import pcunitscalculatordrinksnumber '../pcunitscalculatordrinksnumber'; import pcunitscalculatortable '../pcunitscalculatortable'; import * scenes ...

php - Mysql / export query result in csv file -

i have mysql script select needed data via left join , save result in csv file. problem column names missed in result file . doing wrong ? select a.*, b.pr_name outfile 'johnoggyresult3.csv' fields terminated ',' enclosed '"' lines terminated '\n' `fileb` b left join `filea` on b.pr_hand_size = a.user_hand_size order a.user_id just add columns names select. should work: select * outfile 'johnoggyresult3.csv' fields terminated ',' enclosed '"' lines terminated '\n' ( select 'column1', 'column2' union (select a.column1, b.pr_name `fileb` b left join `filea` on b.pr_hand_size = a.user_hand_size order a.user_id) q ) please note dumping csv done @ end, after result fetched , sorted , after headers attached dataset. need sort data first before adding row headers or otherwise headers sorted , land somewhere in middle of dataset instead of top ...

c# - "An existing connection was forcibly closed by the remote host" when accessing Photobucket API -

when using photobucket api, says... [socketexception (0x2746): existing connection forcibly closed remote host] system.net.sockets.socket.receive(byte[] buffer, int32 offset, int32 size, socketflags socketflags) +139 system.net.sockets.networkstream.read(byte[] buffer, int32 offset, int32 size) +146 any ideas here? i asked photobucket , said: photobucket api disabled external using.

After Renaming Elixir/Phoenix Codebase: variable "X" does not exist and is being expanded to "X()" -

i renamed codebase livestory citybuilder. used find , replace on text in files, mv rename directories. codebase search livestory returns 0 results. https://stackoverflow.com/editing-help when run mix phx.server , get: variable "citybuilder" not exist , being expanded "citybuilder()", please use parentheses remove ambiguity or change variable name mix.exs:1 i tried running mix deps.clean , mix deps.get . same result "citybuilder not exist". i found similar question here, doesn't apply me i'm running latest versions of elixir , phoenix: phoenix setup failing: compilation error, (keyerror) key :model not found * mix.exs defmodule citybuilder.mixfile use mix.project def project [app: :citybuilder, version: "0.0.1", elixir: "~> 1.4", elixirc_paths: elixirc_paths(mix.env), compilers: [:phoenix, :gettext] ++ mix.compilers, build_embedded: mix.env == :prod, start_permanent...

How do I update the Font that is backinng text style "Title 1" in ios/xcode? -

Image
sort of css, want use custom font "title 1" heading. i'm not sure how in storyboard.?? as of ios 9, ios system font "san francisco" ... "helvetica neue". all of text styles based on system font, fonts returned by: // obj-c uifont *fnt = [uifont preferredfontfortextstyle:uifonttextstylecaption1]; // swift let fnt = uifont.preferredfont(fortextstyle: uifonttextstyle.caption1)

msbuild - Visual Studio online build failing with 0 warnings and 0 errors -

i setting basic build bare bones webapi app, , getting failed build, without errors or warnings... how can figure out going wrong? project "d:\a\1\s\my.project.api.sln" (1) building "d:\a\1\s\my.project.api\my.project.api.csproj" (2) on node 1 (default targets). _cleanrecordfilewrites: creating directory "obj\release\". done building project "d:\a\1\s\my.project.api\my.project.api.csproj" (default targets) -- failed. done building project "d:\a\1\s\my.project.api.sln" (default targets) -- failed. build failed. 0 warning(s) 0 error(s) time elapsed 00:00:00.15 ##[error]process 'msbuild.exe' exited code '1'. even way can useful log or error message great! edit: added /v:diag build arguments verbose logging, isn't seeming help. in build definition, there variable called system.debug set false . change true @ template or @ time of triggering , debug lines written build tasks. ins...

python 3.x - Python3 Shelve: how to append a value permanently? -

i want users append new values in shelve module. everytime close file, appended values disappear. import shelve shelvepracticefile = shelve.open('/shelvepractice', writeback=true) shelvepracticefile['funnynames'] = ['lala', 'dada', 'mama', 'baba'] shelvepracticefile['funnynumbers'] = [3,9,18] shelvepracticefile['funnyskills'] = ['python', 'football', 'gaming'] # try append. print('lets try append. type in something') myinput = input() shelvepracticefile['funnyskills'].append(myinput) # lets read , print shelve file we've created! print(shelvepracticefile['funnynames']) print(shelvepracticefile['funnynumbers']) print(shelvepracticefile['funnyskills']) shelvepracticefile.close() this code works , saves shelve. beginners me; if keep running code above on , over, shelvepracticefile['funnyskills'] = ['python', 'footb...

Download SQL Server 2012 Developer Edition -

does know can download sql server 2012 developer edition, or purchase licence it? i'm not talking sql server 2014+ developer edition, free. need sql server 2012, our production server is. thanks all. you can head downloads section in visual studio subscription portal. seen, no key required.

How to use Perl's XML::XPath with non-English element names? -

how can work xml::xpath when elements' names not in english? i use strawberry perl. i employees.xml , train_xml.pl web, work good. but when when add chinese characters, following error: wide character in die @ d:/strawberry/perl/site/lib/xml/xpath/parser.pm line 189. query: /employees/employee[@age="30"]/工作... ..............................^^^ invalid query somewhere around here (i think) how can solve this? employees.xml : <?xml version="1.0" encoding="utf-8" ?> <employees> <employee age="30"> <name>linux</name> <country>us</country> <工作>教师</工作> </employee> <employee age="10"> <name>mac</name> <country>us</country> </employee> <employee age="20"> <name>windows</name> <country>us</country> </employee> </emplo...

css3 - CSS height: (x)vh viewport not scrollable -

Image
this general css question height: vh variable. have page split 2 columns, column on left needs fixed (i.e doesn't scroll or move when page moves) , column on right needs scroll indefinitely (i.e normal page would. here's screenshot illustration: presuming start both sides of page being scrollable have given left column id #profilecol added following css in order fix left section of page height of browser window: #profilecol { z-index: 999!important; height: 100vh!important; } update: have page scrolling both sides scroll, attempt add position:fixed either column fries structure of page places 1 container on top of other. does know why isn't working? you can achive requirement .left-col{ position:fixed; height:100vh; } .right-col{ height:100vh; overflow:auto; }

android:background killing Activity enter/return transitions -

i used activity enter/return transitions (using xml transitions slide , fade animate views) , worked because it's straightforward. in last project having problems dummy activites (without real processing), transitions don't work, after hours of changing layout code, figured out responsible android:background in root framelayout of activity layout set background color. when removed attribute, transitions came work. also, if apply attribute in activity theme, transitions stop again. currently project animating second activity has layout structure: <framelayout 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:background="@color/colorprimary" android:layout_width="match_parent" android:layout_height="match_parent"> <imageview> <recyclerview> </framelayo...

javascript - How to open dialogue box in parent window when clicking button from related list hover over -

Image
we have custom onclick javascript button on list page of opportunity. button open jquery dialogue box when click on button. working fine when clicking button opportunity list page or opportunity related list account. when try open related list hover on dialouge box opening this. please 1 in opening dialogue box in proper window. $g("#dialog").dialog({ modal: true, buttons: { "yes": function() { window.open("/apex/contractprocessflowvf_slds?accid={!account.id}", "_top "); $g(this).dialog("close"); }, "no": function() { window.open("/006/e?returl=%2f{!account.id}&accid={!account.id}&recordtype=" + rt + "&ent=opportunity&opp3=ee%20-%20{!account.name}&opp9={!account.ee_future_close_date__c}&opp11=target", "_parent"); $g(this).dialog("close"); } } }); any appreciated. in advance. naveen

c++ - How to set an std::vector with another one, where the two are vectors of different classes? -

is there way set std::vector one, 2 vectors of different classes? struct { int a; }; struct b { int a, b; b(int _a, int _b) : a(_a), b(_b) {} }; int commonb = 123; std::vector<a> va; std::vector<b> vb; // fill va... // code optimise: for(size_t = 0; < va.size(); ++i) { vb.push_back(b(va[i].a, commonb)); } anything (pseudo-code): vb = va; with b::b values uninitialised? i'd point out, since range-based loops, haven't had desire use simple algorithms transform often. hope can see why. std::transform(va.begin(), va.end(), std::back_inserter(vb), [commonb](a x) -> b { return b(x.a, commonb); }); (auto& e : va) vb.emplace_back(e.a, commonb);

asp.net mvc - MVC accessing external Web API using login credentials -

in need of accessing external web api passing along credentials in order access methods available. have included code below use in order attempt access web api. however, receive following error every time attempt access it: "the underlying connection closed: not establish trust relationship ssl/tls secure channel." what missing or doing wrong? have been circling around couple days , have tried couple different techniques continue same error. here 1 technique used. private static async task<string> getapitoken(string username, string password, string apibaseuri) { try { using (var client = new httpclient()) { //setup client client.baseaddress = new uri(apibaseuri); client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/json")); //setup login data...

how to pause Kafka Consumer when I am using @KafkaListener Annotation -

i pulling data data base check if have available system resources process further messages coming kafkalistener. if condition not met want @kafkalistener pause , when condition met, want @kafkalistener resume. how achieve in spring kafka? also there disadvantages of pausing consumer particular partition? ­­­­­­­­­­­­­­­­­­­­­­­­­­­ there no pause/resume control in current version. automatic framework, when detects slow listener. in latest 2.0 have opposite situation: don't provide automatic pause/resume - no reason more, @ same time allow configure @kafkalistener method consumer argument, can perform desired logic there already.

powershell - How do you troubleshoot PS1 script execution in MSI installer? -

i've tested , ran ps1 scripts , ran find without problem. tried integrate them wix installer fail stupid installer never give meaningful on why failed... i have these in wix wxs file: <property id="installplugin" value="&quot;powershell.exe -file [#installps1]&quot;" /> <customaction id="installplugin" binarykey="wixca" dllentry="wixquietexec" execute="deferred" return="ignore" impersonate="no"/> <property id="uninstallplugin" value="&quot;powershell.exe -file [#uninstallps1]&quot;" /> <customaction id="uninstallplugin" binarykey="wixca" dllentry="wixquietexec" execute="deferred" return="ignore" impersonate="no"/> <installexecutesequence> <custom action="installplugin" before="installfinalize">not installed</custom> <custom action=...

javascript - Launch click event from tooltip highcharts -

i want launch event when clicking on tooltip of highcharts. i'm using highcharts in ionic/angular project. here example: highcharts.chart('container', { title: { text: 'tooltip footer format demo' }, subtitle: { text: 'the tooltip should provide html table table closed in footerformat' }, xaxis: { categories: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'] }, tooltip: { shared: true, usehtml: true, pointformat: '<button onclick="launchevent()"></button>', valuedecimals: 2 }, series: [{ name: 'short', data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }, { name: 'long named series', data: [129.9, 171.5, 106.4, 1...

javascript - Unable to set element proprieties passed as argument -

i have following code (read comments , code): <!-- panel --> <div class="panel panel-default" num="1"> <!-- there boring stuffs --> <div style='float: right;'> <!-- 3 buttons: hearth, tic , cross --> <span class="glyphicon glyphicon-heart-empty" aria-hidden="true" style="margin-right: 5px;" act="1"></span> <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true" style="margin-right: 5px;" act="3"></span> <span class="glyphicon glyphicon-ok" aria-hidden="true" style="margin-right: 5px;" act="0"></span> </div> <!-- other boring stuffs --> <script> $('.glyphicon').click(function(){ //panel father of button clicked panel = $(this).closest('div.panel'); //action: 1 like, 2 dislike, 3 signal, 0 accept ...

Generate variable by the syntax definition in bash -

i looking library in bash or in c solve following problem: when want define own script, defining syntax definition command (that should appear in man). example: buildcron.sh [options] file... options: -f, --force -m, --memo -c <file>, --credential=<file> -h, --help -v, --version -q, --quiet i find library/script that: syntax definition, generate variables names force , memo , credential_file or similar. , best information given, regular tests ( credential_file file, not directory etc...). i thinking of implementing it, exists, no need ! don't find (maybe don't have keywords...). thank much. hoping clear.

django - How should i call class based generic view in function view -

i want call class based index view in function view render index template in login function view when add context in index template function views ' render's context not 1 rendered class based index view. so thought if call class based index view function add context class based view , render @ same time. in short word's want add context function view , render it. this class based generic view listing object's in index template. class indexview(generic.listview): template_name = 'polls/index.html' title = 'hello' num_visit = 'a' context_object_name = 'question_list' def get_queryset(self): """return last 5 published questions.""" return question.objects.filter(pub_date__lte=timezone.now()).order_by('-pub_date')[:5] and login view render's same template class based index view def login_view(request): user = authenticate(request,username=r...

Excel - Extract Test Between Semi-Colon -

Image
i have list of data in column different lengths in following format: abc radiologist 100; abc nurse 200; abc technologist 300; abc biller 400; abc coder 500 i trying extract each line of data separate column show such: course 1 course 2 etc abc radiologist 100 abc nurse 200 i need each course name in separate column. i used formula in column b: =mid(a1,1,search(";",a1)-1) and formula in column c: =trim(mid($a$1,len(b1)+2,find(";",$a$1,len(b1)))) this formula returns values, because of varying lengths of data, in column c, cuts data off or adds data after third ; any suggestions? i need repeat formula 9 times with data in a1 , enter in b1 : =trim(mid(substitute($a1,";",rept(" ",999)),columns($a:a)*999-998,999)) and copy across. edit#1: we copying b1 across. c1 contain: =trim(mid(substitute($a1,";",rept(" ",999)),columns($a:b)*999-998,999)) and d1 contain: ...

php - Strange link bug with hyperlink in Wordpress -

when clicked on link redirects main shop page of woocommerce, there blank page no products. (see link ПРОДУКТИ in top right bar above header) when click on button main menu ok (button: ПРОДУКТИ ). i disable plugins , change theme, no luck! see here website shop page: https://www.mangustaceramics.com/продукти/ example of problem: http://i.imgur.com/kcgsk10.jpg if have suggestions problem, glad hear them! thank you! these technically different links. can see copying url address bar , pasting them in text editor. the top right bar link gives output: https://www.mangustaceramics.com/%d0%bf%d1%80%d0%be%d0%b4%d1%83%d0%ba%d1%82%d0%b8/ whereas main menu 1 gives this: https://www.mangustaceramics.com/%d0%bf%d1%80%d0%be%d0%b4%d1%83%d0%ba%d1%82%d0%b8/ you need ensure urls encoded correctly or specify them explicitly using second link above (with lowercase letters).

java - SWT Resize Error -

Image
i've been using swt , have found issue. when selecting , deselecting check boxes , maximizing window cause icon of first button set though null. layout of text on buttons can end incorrect. to recreate error: select checkbox 1 deselect checkbox 1 select checkbox 3 maximize window the icon checkbox 1 should null (empty) instead has cross icon. public static void main(string[] args) { final display d = new display(); shell s = new shell(d); s.setlayout(new gridlayout(2, false)); s.setsize(500, 500); new label(s, swt.none).settext("c"); final button c = new button(s, swt.check); new label(s, swt.none).settext("l1"); final button b = new button(s, swt.push | swt.flat); b.setlayoutdata(new griddata(swt.fill, swt.center, true, false)); b.settext("button 1"); b.setenabled(false); new label(s, swt.none).settext("c2"); final button c2...

javascript - jquery ajax response error not working -

i have ajax call api return correctly (200) when url , parameters fine. trying force error bad request. console inform me error code 400 never seems error method. instead gets stuck in jquery line , never returns. fetch: function(successcallback, errorcallback) { var apiurl = this.applyfilter(filters); var self = this; this.log('fetch', apiurl, currentsearchmode); $.ajax({ url: apiurl, type: 'get', cache: (debug) ? true: false, processdata: true, crossdomain: true, scriptcharset: 'utf-8', jsonp: 'callback', datatype: 'jsonp', success: function(data, statustext, jqxhr) { console.log(jqxhr); // if(jqxhr.status == 400){ // console.log('there error'); // } self.log('fetch::success', data); ...

javascript-ionic $scope isnt updated -

so know there lot of questions area cant still fix it. i'm making app ionic v3 , have issue updating in scopes, have tried everything, put scope in object, parent , still not working. have in controller, , here find problem when console.log doesnt change value , stays in 1, please need help... function($scope, $stateparams) { $scope.cosas = $stateparams.bulto; var arts = $scope.noarticulos = [{ 'id': 1, 'label': 1 }]; (var = 2; < 300; i++) { arts.push({ 'id': i, 'label': }); }; $scope.artis = { 'noarticulo': $scope.noarticulos[0].id }; var art = $scope.artis.noarticulo; console.log(art); $scope.items = []; (var = 0; < art; i++) { $scope.items.push(i); }; ...

postgresql - Where to find plv8.so, plv8.control, etc. and where to copy them to? -

i following these instructions both build , install plv8 on postgresql: plv8 readme.md instructions in particular, following instructions not clear: installing build: after running make or make static following files must copied correct location postgresql find them: pl/v8 javascript extension: plv8.so plv8.control plv8--{plv8-build-version-here}.sql 1.) find 3 files listed above after successful build? 2.) copy them to? e.g., definition of 'the correct location postgresql find them' all generated files should appear in folder in have unpacked package. if cannot see them means compilation has failed. you should use pg_config param. example. postgres folder /opt/postgres/9.5 . can check running command in psql: show data_directory data_directory ------------------------ /opt/postgres/9.5/data (1 row) use corresponding bin/pg_config path in make commands automatic installation (remove unpacked files before installation): /h...

regex - bash expression to get the jira key out of git commit -

i have below code in jenkins configuration in execute shell jira_key=$(curl --request "http://jenkins-server/job/myproject/job/mysubproject/job/mycomponent/${build_number}/api/xml?xpath=/*/changeset/item/comment" | sed -e "s/<comment>\(.*\)<\/comment>/\1/") the result of above command is jira_key=<comment>jra-1011 commit message. </comment> i not sure how can improve above expression start , end tags excluded result. however ultimate goal extract jira key first word in comment i.e. jra-1011 , store in jira_key. once tags excluded can first word command set -- $jira_key jira_key=$1 is there other better way this? the xml <freestylebuild _class="hudson.model.freestylebuild"> <changeset _class="hudson.plugins.git.gitchangesetlist"> <item _class="hudson.plugins.git.gitchangeset"> <comment> jra-1011 commit ...

datetime - Have a date in vb.net surrounded by # signs what do they do? -

usually when comparing date hard coded use string, query brings #1/1/0001 12:00:00 am# if date hasn't been set in 400 database. tired comparing "1/1/0001 12:00:00 am" because though other error seems work find in comparison date time. # mean in instance. if lastchg <> #1/1/0001 12:00:00 am# ''do stuff end if lastchg declared date or datetime . date vb alias system.datetime . cannot compare date value string , can compare date constant date variable. #1/1/0001 12:00:00 am# so-called date literal , of type date . textual representation of date constant. you write const emptydate date = #1/1/0001 12:00:00 am# if lastchg <> emptydate ''do stuff end if in case make sure if lastchg of type date compare date literal (with # ), if string string literal (with " )

regex - Remove index.php? with mod_rewrite -

there plenty of answers on removing index.php mod_rewrite in .htaccess need remove index.php? incoming urls , rewrite them all, i.e. /index.php?pagename.php /pagename.php . either of these work separately, , remove index.php 1) rewritebase / rewriterule ^index.php?/(.*)$ $1 [r=301,l] 2) rewritebase / rewritecond %{the_request} ^get.*index\.php [nc] rewriterule (.*?)index\.php/*(.*) /$1$2 [r=301,ne,l] but not ? , urls this: example.com/?pagename.php the issue ? special character in regex, if that's added, understand needs escaped. neither of these work: 1) rewritebase / rewriterule ^index.php\??/(.*)$ $1 [r=301,l] 2) rewritebase / rewritecond %{the_request} ^get.*index\.php\? [nc] rewriterule (.*?)index\.php\?/*(.*) /$1$2 [r=301,ne,l] how correctly escape ? in index.php? ? this answer not work me; leaves ? : mod_rewrite rule remove index.php and beyond that: there appreciable differences between 2 rewrite rules? you can use rule in si...

numpy - Tensorflow infinity mask breaks gradient -

i'm trying softmax on selected indices, using infinity mask silent out unwanted ones. however, gradient of unwanted entires become nan opposed 0 . the reason didn't use boolean mask mask indices different in batch, can't end nice matrix form. if there's workaround here i'll more happy adopt. the code tested infinity mask import numpy np import tensorflow tf = tf.placeholder(tf.float32, [5]) inf_mask = tf.placeholder(tf.float32, [5]) b = tf.multiply(a, inf_mask) sf = tf.nn.softmax(b) loss = (sf[2] - 0) grad = tf.gradients(loss, a) sess = tf.session() a_np = np.ones([5]) np_mask = np.ones([5]) * 4 np_mask[1] = -np.inf print sess.run([sf, grad], feed_dict={ a: a_np, inf_mask: np_mask }) sess.close() the output [array([ 0.25, 0. , 0.25, 0.25, 0.25], dtype=float32), [array([-0.25, nan, 0.75, -0.25, -0.25], dtype=float32)]] the mask working gradient has nan , should have been 0 think.

c# - Process.Kill() Method is Missing -

so i've looked around on place , nobody seems have problem. added using system.diagnostics list of references, process exists, not kill method. show in intellisense menu. has start method. no kill method. has getprocessesbyname method no kill method. going on here? foreach(var x in objserverlist) { process[] proc = process.getprocessesbyname("myproc.exe", x); proc.ki //nope it's missing, not in long list of options process.ki //nope, not there either } proc array of process it'll have methods relevant arrays. access specific index , have methods of process type: proc[index].kill() by way second attempt of process.kill not work because class process not have static method of kill

javascript - Send HTTP.call Json -

i have problems sending json verified server, response process has been exist. i'm using http.call, have not gotten far results in when functionality. tests postman , works me correctly. here copy of code: // client side event click button var jsonstr = json.stringify(jsonobj); meteor.call("json", jsonstr, function(error, result){ if(error){ console.log("error", error); } if(result){ console.log(resul); } }); ///server side json(jsonstr) { var options = { data: jsonstr, headers: { 'content-type': 'application/json' } } try { var url = "https://api.xxxxxxxxx.com/xxxxxxx-api/4.0/xxxxxx.cgi"; var result = http.call('post', url, options ) return result; } catch (err) { console.log(err) } } //i must receive { ...

OpenCV-Python: How to get latest frame from the live video stream or skip old ones. -

i've integrated ip camera opencv in python video processing done frame frame live stream. i've configured camera fps 1 second can 1 frame per second in buffer process, algorithm takes 4 seconds process each frame, causing stagnation of unprocessed frame in buffer, keeps growing time & causing exponentially delay. sort out, have created 1 more thread i'm calling cv2.grab() api clean buffer, moves pointer towards latest frame in each call. in main thread, i'm calling retrieve() method gives me last frame grabbed first thread. design, frame stagnation problem fixed , exponential delay removed, still constant delay of 12-13 seconds not removed. suspect when cv2.retrieve() called not getting latest frame, 4th or 5th frame latest frame. there api in opencv or other design pattern problem fixed can latest frame process. thanks in advance help. i'll appreciate quick response.

amazon s3 - Why do I get AttributeError when trying to open a folder in django cms filer manager? -

i have fresh install of django cms , when try create folder , add images using filer app gives me error: attributeerror @ /en/admin/filer/folder/1/list/ 'str' object has no attribute '_meta' it looks issue in filer/admin/folderadmin.py in directory_listing i thought maybe had fact using django-storage store on s3, took part out stored files locally , still getting error. if has information on how fix please let me know. happening out of box no previous data.

html - Change navigation from floating right to centered when resized -

i've searched , searched , found similar issues, none of previous threads me solve problem. on desktop home page, have navigation menu floating right. however, when resized or viewing on mobile device, want menu items centered rather floating right, looks messy. i've tried various suggestions other posts, nothing seems working , it's driving me nuts. i've tried media queries change alignment below size , have been unsuccessful must doing wrong. also, not big priority, noticed header logo gets ever-so-slightly clipped in mobile version, great if me well. thank in advance help! please see attached screen shots. desktop version mobile version edit: sorry forgot post code. college class, right css , html combined 1 document, later have separate style sheet. also, live version can seen @ geocities.ws/dinetown <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, height=device-height, initial-s...

python - Unable to plot the data calculated from elements of each row from a data file -

i have data file contains 4 elements per row kev , keverror , counts , countserror , each element separated space. each row, want calculate hertz(hz) , flux density( fnu ) using these 4 elements , plot them. so, after reading 4 elements of row, want calculate hz kev(simple multiplication) , use hz value calculate fnu multiplying counts value same row. write output in file. code able calculate hz written output txt file matches manually calculated values produced plot showing different values. first few lines of file : kev kev error counts counts error 0.616850019 7.29998946e-3 6.82969764e-2 5.15005877e-3 0.631449997 7.30001926e-3 7.20156059e-2 5.33540128e-3 0.646049976 7.29998946e-3 8.04692879e-2 5.47288591e-3 0.65882504 5.47501445e-3 0.102332868 7.17073539e-3 my inexperienced attempt @ code writing goes this: import numpy np import matplotlib.pyplot plt (kev,keverr,cts,ctserr)=np.loadtxt("sedtotal.dat", usecols=(0,1,2,3),unpack=true) hz=kev...

foreach in List<object> in c# -

Image
[ ] i have list<object> 26 rows. wanted write foreach fetch values. tried diff ways that. no luck. please me. please check attached images unfortunately, i'm not sure you're asking here sample code started. create list filled string value each object in list. list<string> stringlist = new list<string>(); foreach(object o in objectlist) { string s; s= o.tostring(); stringlist.add(s); } as it's been mentioned, take @ loops , conditional statements learn more them/how use them. hope helps.

python - Filtering rows by `df.str.split` on columns in pandas -

i have dataframe looks following url1, labela:0.5 url2, labelb:0.4 url3, labelc:0.7 i trying following, split label column ':' , filter numeric value, greater 0.6. in above case, filter out rows url1 , url2 since values 0.5 , 0.4, respectively. i did following won't work: df = df[df["labels"].str.split(':').get(1).astype('float') >= 0.6] i guess happen get(1) give me second row instead of imaginary second column after split. tried bunch of variation of didn't work. hope illustrate idea though. elegant way this? thanks. you can use df.str.split(..., expand=true) followed type conversion float df.astype , boolean indexing : in [782]: df[df['labels'].str.split(':', expand=true)[1].astype(float) >= 0.6] out[782]: url labels 2 url3 labelc:0.7

Conditional Column Validations in SharePoint 2010 list using Javascript or SharePoint Designer 2010 -

in sharepoint list, have column called "column 1" "yes" , "no" dropdowns such selection of yes or no dropdown, related columns wil shown or hidden per set criteria. if “column 1” dropdown "yes", columns related "column 1" should become mandatory filled , columns related dropdown "no" should not become mandatory. if “column 1” dropdown "no", columns related both "yes" , "no" should become mandatory filled. i want set validations above using javascript/sharepoint designer 2010 such that, when fields become mandatory (based on dropdown selections) not filled, , clicked on save button, system should give error message in red colour right below mandatory field telling fill field. can please me code/method this? below screenshot of sample page trying on. if choose yes in " is cloud involved? " column, " choose cloud offers " column displayed , should become mandatory fil...

php - Laravel query doesn't want to select last one -

i tried distinct before somehow query won't select last comment. select oldest comment. tried groupby instead of distinct. won't work either. my current query: \app\comment::limit(5)->groupby('comments.id') ->orderby('comments.id', 'desc') ->join('topics', 'comments.topic_id', '=', 'comments.id') ->select('comments.user_id', 'topics.id', 'topics.name') ->wherein('topics.cat_id', $cats) ->where([['comments.removed', '=', false],['topics.removed', '=', false]]) ->get(); it's pretty long. hopfully can explain me why won't work. errors found far groupby not needed your join statement join('topics', 'comments.topic_id', '=', 'comments.id') should joining columns in table comments , topics fix \app\comment...

javascript - How do I return the response from an asynchronous call? -

i have function foo makes ajax request. how can return response foo ? i tried return value success callback assigning response local variable inside function , return one, none of ways return response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- tried 1 } }); return result; } var result = foo(); // ends being `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify inside of function? - asynchronous code reference -> if understand problem, skip possible solutions below. the problem the a in ajax stands asynchronous . means sending request (or rather receiving response) taken out of normal execution flow. in example, $.ajax returns , next statement, return result; , executed before function passed success callback ca...

What is the point of the last command in this MSDN powershell Add-Member example? -

example 6 msdn article on add-member copying properties of 1 object another: function copy-property ($from, $to) { foreach ($p in get-member -inputobject $from -membertype property) { add-member -inputobject $to -membertype noteproperty ` -name $p.name -value $from.$($p.name) -force $to.$($p.name) = $from.$($p.name) } } just playing code, last line of $to.$($p.name) = $from.$($p.name) seems totally redundant. description on page says last line gives new property same name original property. doesn't that, appears try set value of new property value of original property. done add-member call. is bug in example? i'm guessing is, i'm still new powershell, , have found enough "quirks" great have confirmed.