Posts

Showing posts from August, 2014

Create a PHP file using PHP? -

i'm planning creating simple script allow unexperienced in php users create code files 1 video game. have 2 files, "code.txt" , "exec.php". first file looks this: getglobal_move_call("turntarget") getglobal_move_loadk_call("generatecsm", "15") and "exec.php" creates "temp.php", imports user made file. it's filled "str_replace" functions, , results supposed this: <? $temp_line = "turntarget(param1)"; file_put_contents($generated_output, $temp_line, file_append); $temp_line = "generatecsm(param1, 15)"; file_put_contents($generated_output, $temp_line, file_append); ?> but, when echo code after these replacements, i'm getting this: <? = "turntarget(param1)"; file_put_contents(user/apple/sites/generate/generated.txt, , file_append); = "generatecsm(param1, 15)"; file_put_contents(user/apple/sites/generate/generated.txt, , file_appe

java - Jenkins: Build job with dependency to other artifact/project -

i'm trying configure jenkins jobs have problems regarding setup. my goal: one build job core project one build job project has dependencies core project current setup: - core -- src/ -- build.gradle -- settings.gradle - project -- src/ -- build.gradle -- settings.gradle "core" , "project" in separate git repositories. the settings.gradle of "project" contains following code: include ':drivers', ':capabilities', ':features', ':extensions', ':pageobjects', ':reports' project(':drivers').projectdir = new file(settingsdir, '../core/drivers') project(':capabilities').projectdir = new file(settingsdir, '../core/capabilities') project(':features').projectdir = new file(settingsdir, '../core/features') project(':extensions').projectdir = new file(settingsdir, '../core/extensions') project(':pageobjects').projectdir = new

How to add blank lines to complete an Access report so that it matches a printed form? -

Image
i deal bunch of government forms, , find myself trying access 2013 output report matches pre-printed form. most of forms in .pdf form, access doesn't handle them (to knowledge) without additional software, cannot install on user production computers. so re-create form access report, have real difficulty when have enough records half page. how report print required records, , fill page blank records "form" looks correct? i'd willing try possible solution - i've gone far create blank records try make work. goal, however, automate process user can generate report , prints out correctly without bunch of fiddling. on form, or of lines might used, , each person (i have ~550 people each have individual form) has different number of lines, depending on number of jumps have completed. i have dummy table single numeric field called id . populate number of records greater biggest number of 'extra' records you're ever going need fill form,

tcp ip - how can i different request and response in tcp commication -

i want different request , response in tcp, tried different [tcpheader.destinationport] , [tcpheader.sourceport] in tcp headers. request->[access port] same with[tcpheader.destinationport] reponse->[access port] same with[tcpheader.sourceport] client user not want input access port in page,and different source ip , destination ip,but if source ipaddress , destination ipaddress same, can not different that. please me,thank much!!!!!

qt - Qbytearray byte to int and storing it as string value -

i want convert byte data stored in qbytearray string value. string value using displaying in ui window.. qbytearray array; array.append( 0x02 ); array.append( 0xc1); qdebug()<<( uint )array[0]<<" "<<( uint )array[1]; uint = 0x00000000; |= array[1]; qdebug()<<i; uint j = 0x00000000 | ( array[0] << 8 ); qdebug()<<j; |= j; bool b = false; qstring str = qstring::number( ); qdebug()<<str; but str prints "4294967233"...this code works of bytes 0x1, 0x45 , of other..but code not working bytes of data string..please me , write code , post here..thanks all values equal or bigger 0x80 interprets in sample negative values, need cast unsigned type before bitwise operations. qbytearray array; array.append( 0x02 ); array.append( 0xc1); unsigned int value = 0; (int = 0; < array.size(); i++) value = (value << 8) | static_cast<unsigned char>(array

javascript - Google maps show and hide markers using checkboxes -

how show , hide markers using javascript , google maps? i use checkboxes show , hide markers, @ minute have 2 markers , 3 checkboxes. 1 show , hide , others show , hide each marker. not sure how connect them checkboxes , show/hide them respectively. sample of marker using: var jorvik = createmarker({ position: {lat: 53.95697, lng: -1.08100}, map: map, icon: 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png'}, "<h1>jorvik viking centre</h1><p>this home marker.<br/>test</p>"); codepen: https://codepen.io/mike43237/pen/qmevle you can use setvisible(true/false) method markers working fiddle see togglegroup() function

SQL Join Query - -

Image
i need perform join where: i interested in pulling person id's 1 of ids contains value 'n' then need perform join return name of ids hope helps select per.personid,per.name ,idn.identifier person per inner join idetifier idn on (idn.personid = per.personid , idn.identifier '%n%')

scheduler - Scheduling job with Apache NiFi by passing dynamic property values -

i have created nifi workflow shown below: generateflowfile --> custom processor --> logattribute custom processor has property start date. start date should change in each scheduled run based on maximum end date previous run. looking incremental data fetch server. could please help, how can achieved in apache nifi? processor scheduling left data flow manager configuring processor flow. recommend let them schedule processor, expecting run on periodic basis. but can use apache nifi's state manager feature store data tracks incremental progress. decide action take, if any, when processor triggered. if there nothing do, don't anything. the best examples of list* processors listfile. these processors typically store timestamp of file last read, use timestamp determine newer files should acted on, regardless of how asked check. executions of list* processor result in no output. there examples of reading , persisting state data in abstractlistprocesso

python - Using Composition instead of inheritance -

i new python , have been trying use composition instead of inheritance code below no avail have tried job_cls =job in permanent class gives me access method in job class.i cannot seem access attributes , methods of job class via permanent class using composition.i have looked @ countless videos , blogs online of them refer attribute self.l1= job(location) in permanent class.your appreciated. class job: def __init__(self, location, salary, description, fee): self.location = location self.salary = salary self.description = description self.fee = fee def charge(self): if self. fee > 1000 : print("sell") else: print("reject") def charge2(self): self.salary = int(self.salary * self.rate) class permanent(job): rate =1.05 permanent1 = permanent("london", 23000, "accounts assistant", 1200) permanent1.rate=

django - <User: root> is not JSON serializable -

i trying display chart shows number of books related each user , , getting right result in shell, when render template, following error : not json serializable my template_tag @register.simple_tag() def chart_data(): users = user.objects.annotate(num_books=count('books')) return json.dumps({ 'labels':[user user in users], 'series':[[user.num_books user in users]] }) you're seeing because you're trying encode python class object json, json module doesn't support serializing python class . only objects json supports listed here . to fix this, instead of serializing user object, try serializing user's username. change 5th line this: 'labels':[user.username user in users],

ruby on rails - GitHub Omniauth retrieve user location -

i'm trying github users' location using omniauth. works fine except location (i nil if mine set "paris"). the documentation says should "info.location" retrieve it. here code in rails app: class user < applicationrecord # include default devise modules. others available are: # :confirmable, :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :omniauthable def self.from_omniauth(auth) where(provider: auth.provider, uid: auth.uid).first_or_create |user| user.provider = auth.provider user.uid = auth.uid user.email = auth.info.email user.password = devise.friendly_token[0,20] user.nickname = auth.info.nickname user.name = auth.info.name user.location = auth.info.location end end end is possible r

requirejs - How to upload video with browse button in magento 2 admin? -

i have tried place browse button in add video section , unable save video. please me solve issue. you need create plugin handle file ,then upload media folder , save url file database vendor\modulename\model\plugin\adminhtml\product\initialization\helperplugin <?php namespace vendor\modulename\model\plugin\adminhtml\product\initialization; use \magento\catalog\controller\adminhtml\product\initialization\helper; class helperplugin { protected $mediadirectory; protected $objectmanager; public function __construct( \magento\framework\filesystem $mediadirectory, \magento\framework\objectmanagerinterface $objectmanager ) { $this->mediadirectory = $mediadirectory; $this->objectmanager = $objectmanager; } public function afterinitialize(helper $subject, $result) { if(!empty($_files['product']['name']['yourvideo

osx - Remotely query logged in Open Directory users from PowerShell (find if user logged into machine) -

i in mixed environment both macos (osx) , windows, dual booting on our client machines. have open directory , active directory running. macos connects od, windows ad. for our computers, wanna know os have booted (if any) , if there user logged on. should done remotely (for example our ad-server). i wrote script in powershell gets list of our machines active directory , tests if online (via test-connection ). tries get-wmiobject each machine online test if booted windows , if there logged on user. if online, get-wmiobject cannot connect, assume booted macos. the question is: how can i, powershell, find out if user logged macos machine, either remotely querying respective machine or our open directory? if on mac should able run command: last | grep "logged in" and should show there. since know works, can use powershell determine if computer on windows or mac environment variables available. if run this, pointed @ appropriate scripts, should solve issu

postgresql - More Efficient Way to Join Three Tables Together in Postgres -

i attempting link 3 tables in postgres. 3 tables generated subqueries. first table linked second table variable call_sign full join (because want superset of entries both tables). third table has inner join second table on call_sign (but theoretically have been linked first table) query runs quite slow , feel become slower add more data. realize there things can speed things - not pulling unnecessary data in subqueries , not converting text numbers on fly. there better way structure joins between these 3 tables? advice appreciated because novice in postgres. here code: select (case when tmp1.frequency_assigned null tmp2.lower_frequency else tmp1.frequency_assigned end) master_frequency, (case when tmp1.call_sign null tmp2.call_sign else tmp1.call_sign end) master_call_sign, (case when tmp1.entity_type null tmp2.entity_type else tmp1.entity_type end) master_entity_type, (case when tmp1.licensee_id null tmp2.licensee_i

PowerShell foreach, First expression runs once and the next expressions runs in loop -

in below powershell statement, looks first expression in {} runs once second expression in {} runs each of pipeline output, why? 1..5 | foreach{ write-host "run once!!" }{ write-host "loop"} output: run once!! loop loop loop loop loop any specific reason why first expression after foreach runs once? the way write makes run advanced function begin/process/end construct. so: ps c:\> 1..5 | foreach -begin{ write-host 'run once!!' }-process { write-host 'loop'} -end{write-host 'finished!'} run once!! loop loop loop loop loop finished! you want when specific requires several steps process, so: begin { connect } process { number of things } end { disconnect }

php - .htaccess working not properly -

i on click http://fitwelpharma.com/pharma-franchise-monopoly & after show on addressbar url : fitwelpharma.com/about.php?q=pharma-franchise-monopoly but want url on addressbar: www.fitwelpharma.com/pharma-franchise-monopoly #options +followsymlinks rewriteengine on rewriterule ^pharma-franchise-monopoly about.php?q=pharma-franchise-monopoly rewriterule ^all-product-list all-product-list.php <limit post> order deny,allow deny allow </limit> <limit put delete> order deny,allow deny </limit> rewritecond %{the_request} ^.*/index.php rewriterule ^(.*)index.php$ http://fitwelpharma.com/$1 [l,r=301] rewritecond %{the_request} ^.*/index rewriterule ^(.*)index.php$ http://fitwelpharma.com/$1 [l,r=301] rewritecond %{http_host} ^fitwelpharma.com [nc] rewriterule ^(.*)$ http://fitwelpharma.com/$1 [l,r=301] <files ~ "^.*\.([hh][tt][aa])"> order allow,deny deny satisfy </files> # disable directory browsing options execc

javascript - How to render a Webix list as blank when no item in it -

i using webix uploader , linking list view display uploaded items. code has been taken [ http://docs.webix.com/desktop__file_upload.html][1] , looks below : view:"form", rows: [ { view: "uploader", value: 'upload file', name:"files", link:"mylist", upload:"js/upload.js" }, { view:"list", id:"mylist", type:"uploader", autoheight:true, borderless:true }, however, when page loads , no file has been uploaded, showing empty line 'undefined' being printed in list placeholder. after uploading file, disappears , uploaded filename getting shown. before uploaded, vainly trying below lines code in function prevent displaying of ugly "undefined" string : $$('mylist').

c# - Parsing nested dictionary with LINQ -

i have json object deserializing using newtonsoft.json dictionary<string, dictionary<string, string>> i want parse dictionary<string, dictionary<double, int>> using linq struggling nested part. for un-nested dictionaries using .todictionary(k => double.parse(k.key), k => int.parse(k.value)) thanks var input = new dictionary<string, dictionary<string, string>>(); input.add("test1", new dictionary<string, string>()); input["test1"].add("1.2", "3"); var output = input.todictionary( x => x.key, x => x.value.todictionary( y => double.parse(y.key), y => int.parse(y.value) ) ); should trick.

asp.net - Beginners jQuery issue -

i have experience javascript, complete noob when comes jquery. i'm trying add real simple click event handler return time. i'm not receiving errors in console nothing happens when button clicked (i added console.log purely testing purposes). imported entire bootstrap package through nuget, believe have complete jquery library. there else i'm missing? in advance! <%@ page title="" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codebehind="jquery.aspx.cs" inherits="garrettpenfieldunit10.webform2" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> </asp:content> <asp:content id="content2" contentplaceholderid="contentplaceholder" runat="server"> <h1>jquery page</h1> <p><asp:label id="labeljq" runat="server" text="click button!"&

extendscript - selectDialog with address bar instead of dropdown with Photoshop script -

Image
i'm writing custom script photoshop handle batch processing of images. have 2 input folders , output folder need specify. right i'm using select folders: var inputfolder = folder.selectdialog("select folder of images process"); because i'm working on server pretty deep folder hierarchy, can real pain select through drop-down menu photoshop presents me in dialog. it easier have folder selection dialog address bar , quick access panel this: all other ps scripts i've been digging around in use folder.selectdialog method set file paths variable. there reason this? if not, how can instruct photoshop second style of folder navigation dialog? it doesn't appear adobe supports dialog folder selecting option. there similar thread posted on adobe forums workaround suggested: https://forums.adobe.com/thread/1094128 the solution suggested use savedialog function instead of selectfolder . gives folder dialog want, comes downside

c++ - reducing syntax "noise" without using a macro -

i'm trying find way of reducing bit of syntax "noise" without resorting macro. following code: struct base { base() = delete; }; struct tag1 final : private base { static constexpr const char* name = "tag1"; }; template <typename t> std::string name() { return t::name; } // ... int main() { const std::string name1(name<tag1>()); return 0; } it nice rid of of static constexpr const char* (not mention other) syntax gets annoying repeat tag2 , tag3 , etc. plus, part of of interesting tag1 , rest "noise". straight-forward solution is use macro: #define make_tag(tag_name) struct tag_name final : private base { \ static constexpr const char* name = #tag_name; } make_tag(tag2); // ... const std::string name2(name<tag2>()); the macro-based make_tag(tag2); syntax has removed of "noise" leaving tag2 quite prominent. added benefit of macro tag_name can turned string literal prevents copy-paste

javascript - How to boot a multi-page app with Browserify and Gulp -

ok, i'm near finish line new php/js app built gulp , browserify. last part how "boot", mean how "first call". let's have 3 js entry points /js/articles.js /js/categories.js /js/comments.js each of them using js modules. have 3 html files, requiring js /articles.html /categories.html /comments.html example /js/articles.js var $ = require("jquery"); var common = require("../common.js"); var viewmodel = { readdata: function() { /* read record api , render */ }, insert: function() { /* open modal insert new record */ } }; what should perform sort of "boot": calling init function need, load server data, bind buttons , stuff viewmodel's methods $(document).ready(function() { common.init(); viewmodel.readdata(); $('#btn-add').click(viewmodel.insert); }); ok, put this? a) in html file? can't cause don't have global js va

Facebook Like Button from email -

i clients able "like" page right email received me. tried include button code facebook email client truncates javascript. when tried include iframe shows on laptops not on mobile devices. i created anchor proper url facebook page , there no problem when "like button" clicked on pcs - facebook page opens. problem same happens on mobile devices forces users log facebook accounts don't want this. logged in in facebook app. there way force facebook app open when url clicked? cheers mat

bash - Installing xdotool through port fails -

i trying install xdotool on osx project in bash. running following command sudo port install xdotool i following output ---> computing dependencies xdotool ---> building xdotool error: failed build xdotool: command execution failed error: see /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_xdotool/xdotool/main.log details. error: follow https://guide.macports.org/#project.tickets report bug. error: processing of port xdotool failed i have tried building xdotool using provided makefile git repo yields following output cc -pipe -o2 -pedantic -wall -w -wundef -wendif-labels -wshadow -wpointer-arith -wbad-function-cast -wcast-align -wwrite-strings -wstrict-prototypes -wmissing-prototypes -wnested-externs -winline -wdisabled-optimization -wno-missing-field-initializers -g -std=c99 -i/usr/x11r6/include -i/usr/local/include -fpic -c xdo.c xdo.c:34:10: fatal error: 'xkbcommon/xkbcommon.h' file not found

python - iterating on glob set doesn't work with if condition -

l have column composed of set of string follow : npa = pd.read_csv("file_names.csv", usecols=[3,5,6, 7, 8, 9], header=none) npa.iloc[:,0] xml_0_1841729699_001 xml_0_1841729699_00nn xml_0_1841729699_00145 xml_0_1841729699_00145 xml_0_1841729699_00178 xml_0_1841729699_001jklm xml_0_1841729699_001fjmfd and l have png names follow : path_img = "/images" os.chdir(path_img) images_name = glob.glob("*.png") set_img = set([x.rsplit('.', 1)[0] x in images_name]) set_img set(['xml_0_1841729699_001fjmfd', xml_0_1841729699_00145','xml_0_1841729699_001','xml_0_1841729699_00178']) l want check name in set_img matches 1 in dataframe before doing processing : for in range(1, 30): img_name in set_img: if (img_name==npa.iloc[i,0]): # 0 corresponds the column of string print("it works") however doesn't check condition if. what's wrong ? edit1: f = open("file_names.csv&q

Handling very fast button click on Android -

i have "+" , "-" button increase/decrease quantity of item. i need send network request (hitting webservice) everytime quantity changed. the problem is, user "spam" "+" , "-" button. example, might pressed 3 times in second. in regard of case, wait second, , send network request based on last quantity. reduce number of requests need (from 3 requests 1 request, in case). what recommended way this? can solve problem using postdelayed in onclick ? i think can try this private long lastclick; void onclick(view view) { lastclick = system.currenttimemillis(); new handler().postdelayed(new runnable() { @override public void run() { if (system.currenttimemillis() - lastclick >= 1000) { makenetworkrequest(); } } }, 1000); } this code skip first requests , run last request after 1 second pause

loopbackjs - loopback cli root path configuration -

i trying use loopback "lb" command generate model. writes on server folder (root dir) though configured boot have different configuration paths models. boot(app, { "env": "dev", "approotdir": __dirname, "appconfigrootdir": path.join(__dirname + "/config/app"), "modelsrootdir": path.join(__dirname + "/config/models"), "dsrootdir": path.join(__dirname + "/config/datasources"), "middlewarerootdir": path.join(__dirname + "/config/middleware"), "componentrootdir": path.join(__dirname + "/config/component") }, function (err) { if (err) throw err; console.log('the application successfuly bootstraped!'); // start server if `$ node server.js` if (require.main === module) app.start(); });

When files have to be saved to database? -

the images , documents saved filesystem or database. example can save byte array , store in database or can save filesystem , url. when files saved database , when filesystem? or both? best method store files? if looking system save files to, name suggests, "filesystem". database can hold files, purposes useless. you can save location (directory, name/hash, etc) in database, save file on filesystem. databases in lot of things, saving files isn't it. of course, if documents pure tekst, might better save them database, e.g. elasticsearch, can search, these special cases: you're not talking saving files, you're talking searching, accidentally find different way save file.

What is the difference between myArray.GetValue(2) and myArray[2] in C#? -

is there difference between using myarray.getvalue(2) , myarray[2]? for example: namespace consoleapplication16 { class program { static void main(string[] args) { int[] numbers = new int[] { 1, 2, 3, 4 }; console.writeline(numbers.getvalue(3)); console.writeline(numbers[3]); console.readline(); } } } getvalue return type object while using index return type specific array. you can see in fiddle (code below) variable val1 can have string stored in it, val2 can used integer. public static void main() { int[] numbers = new int[]{1, 2, 3, 4}; var val1 = numbers.getvalue(3); var type = val1.gettype(); var val2 = numbers[3]; console.writeline(type.tostring()); val1 = "hello"; type = val1.gettype(); console.writeline(type.tostring()); } this result in boxing , unboxing , won't have effect on small code snippet, if used in large scale po

javascript - XmlHttpRequest file upload strange behavior in IE11 -

i have servlet handle file upload via http post. also, have client-side page upload files. this strange thing in ie11: i uploaded file (abc.tiff). upload successful. i uploaded file (bcd.tiff). upload successful. i uploaded abc.tiff again. upload successful. now strange, upload abc.tiff again. ie did not make http post upload. knew monitoring network in developer mode. i repeated above steps many times , got same outcomes. in general, in ie11, if make consecutive uploads of same file, http post not invoked on client side. i not have issue in firefox. in firefox, consecutive uploads of same file succeed. could let me know why behaves in ie11? there way fix issue? thanks. this client-side code: <!doctype html> <html> <body> <input type="file" id="upload" size="50" onchange="process()"> <p id="message"></p> <script> function process() { var input = document.getelem

VBA Macro to Delete Empty Lines in Word Tables -

Image
i been struggling word macro deletes empty lines "$" exists. code below works selected table, how can have code loop through entire document , delete empty lines pages. option explicit sub test() dim long selection.tables(1) = .rows.count 1 step -1 if len(.cell(i, 2).range.text) = 3 , left(.cell(i, 2).range.text, 1) = "$" .rows(i).delete end if next end end sub this not tested on same data-set op has since not provided. option explicit sub test() dim tbl table dim mdoc document dim orow row set mdoc = activedocument each tbl in mdoc.tables each orow in tbl.rows if len(orow.cells(2).range.text) = 3 , _ left(orow.cells(2).range.text, 1) = "$" orow.delete end if next orow next tbl end sub

linux - Scaling filesystem on centos whm and nginx webservers -

we have built marketplace our clients, have hundreds thousands of companies in our database , add products many files (images,videos etc.). , individual users able send photos. we using centos +whm (nginx+cassandra+mysql+redis+nodejs+php+java) different parts of project according different content. for main software using mysql , cassandra database servers, there restful java webservices between php7 code , database servers (which scaled).nodejs+redis+cassandra (for chat) we have no problems scaling information, have decide how scale objects. company work supplies 10tb bandwidth each server get. if consider work amazon or other cloud services, 10tb bandwidth charge lot, on other hand in case have server used other issues well. seems better have servers instead of cloud storage. now question how should go ahead statics files ? best solution this. creating nodes subdomains static1.domain.com, static2.domain.com each new server. , add image location database show location of

Alignment of mulitple labels - HTML, CSS -

Image
i having problem aligning labels. what have right now: html: <div class="personalinformation"> <label for="" class="info">firstname:</label> <label for="">bill</label> </div> <div class="personalinformation"> <label for="" class="info">lastname:</label> <label for="">gates</label> </div> <div class="personalinformation"> <label for="" class="info">country:</label> <label for="">france</label> </div> css: .personalinformation { text-align: center; margin-left: auto; text-justify: inter-word; margin: 0 auto 1em auto; } .info { font-weight: bold; text-align: left; margin-right: 50px; } how labels align this: you need set fixed width , float left property each label. @ snippet: http://www.bootply.com/weqbl8tvo0 regards

Verilog carry lookahead adder -

`timescale 100ns/1ps module carrylas_tb; reg [7:0] a; reg [7:0] b; reg ci; wire [7:0] sum; wire of; //overflow wire co; integer i; carrylas_8 cla(a,b,ci,sum,co,of); initial begin a=0; b=0; ci=0; end initial begin // possible cases for(i=0; i<262144; i=i+1) // 2^18 #10 {a, b, ci} = i; end endmodule module carrylas_8(a,b,ci,sum,co,of); input [7:0] a,b; input ci; // 0; add 1: subtract output [7:0] sum; output co; output of; wire[7:0] c; wire[7:0] xb; xor(xb[0],b[0],ci); xor(xb[1],b[1],ci); xor(xb[2],b[2],ci); xor(xb[3],b[3],ci); xor(xb[4],b[4],ci); xor(xb[5],b[5],ci); xor(xb[6],b[6],ci); xor(xb[7],b[7],ci); xor(of,c[7],c[6]); xor(co,c[7],ci); carryla_8 clas(a,xb,ci,sum,co); endmodule module carryla_8(a,b,ci,sum,co); input [7:0] a,b; input ci; output [7:0] sum; output co; wire [7:0] sum; wire cm,co; carryla_4 cla0(a[3:0],b[3:0],ci,sum[3:0],cm); carryla_4 cla1(a[7:4],b[7:4],cm,sum[7:4],cm); endmodule module carryla_4(a,b,ci,sum,co);

java - javaFx radio button and textfield user selection and user input -

so question trying implement gui has 4 radio buttons let user choose type of sorting want do(quick,insertion,bubble,selection) , can pick 3 more radio buttons , choose either sorted, random, reverse sorted. has textfield allows them chose input size of array , block size. after user has chosen radio buttons , put in information input size text field , block size text field, hit go , program sort array , output sorted array console. so need implementing action event or listener go button information radio buttons , text fields. understand logic behind wasn't sure how link event handler/action event. code far compiles , when hit 'go' button prints array of 100 numbers sorted in order 1-100. doesn't take account user selects on radio buttons or text field's block size , input size , need that. here code: package project4practice; import java.util.random; import javafx.application.application; import javafx.event.actionevent; import javafx.event.eventhandler; i

Kendo Datepicker not working in ASP.NET.MVC project -

Image
instead of datepicker, normal text input showing on browser. code: @(html.kendo().datepicker().name("datepicker")) here screenshot of browser: console error: uncaught typeerror: jquery(...).kendodatetimepicker not function @ htmldocument.<anonymous> (index:58) @ fire (jquery-1.10.2.js:3062) @ object.firewith [as resolvewith] (jquery-1.10.2.js:3174) @ function.ready (jquery-1.10.2.js:447) @ htmldocument.completed (jquery-1.10.2.js:118)

c# - My datagridview ins't showing my data -

i have datagridview populating class library in c#. populate gridview calling method, fetchemployee() in employeedataaccess class returns datatable(dt). have set class bindingsource datagridview. however, datagridview populating first , last columns data. middle columns blank. binding method: private void dgvemployeebindgrid() { dgvemployee.datasource = null; dgvemployee.datasource = employeedataaccess.fetchemployees(); } this fetchemployee() method: public static datatable fetchemployees() { datatable dt = new datatable(); using (sqlconnection conn = new sqlconnection(databaseconnection.test)) { conn.open(); using (sqlcommand cmd = conn.createcommand()) { cmd.commandtype = commandtype.storedprocedure; cmd.commandtext = "employee_fetch"; using (sqldataadapter sda = new sqldataadapter(cmd)) { usi

python - Iterate over Numpy array for Tensorflow -

hello, i entry level in python.i have searched every doc on python , numpy didn't find.i want train multivariable logistic regression model. i have 100x2 numpy array train_x data , 100x1 numpy array train_y data.i couldn't feed placeholders.i think can't able iterate multidimensional matrix placeholder wants. here raw code better understand: import matplotlib.pyplot plt import tensorflow tf import numpy numpy learning_rate = 0.01 total_iterator = 1500 display_per = 100 data = numpy.loadtxt("ex2data1.txt",dtype=numpy.float32,delimiter=","); training_x = numpy.asarray(data[:,[0,1]]) # 100 x 2 training_y = numpy.asarray(data[:,[2]],dtype=numpy.int) # 100 x 1 m = data.shape[0] # thats sample size = 100 x_i = tf.placeholder(tf.float32,[none,2]) # n x 2 y_i = tf.placeholder(tf.float32,[none,1]) # n x 1 w = tf.variable(tf.zeros([2,1])) # 2 x 1 b = tf.variable(tf.zeros([1,1])) # 1 x 1 h = tf.matmul(w,x_i)+b cost = tf.reduce_

datatable - R Shiny observeEvent issues -

i trying delete rows dataframe when have been selected in datatable , presses "delete rows" switch. input$click_rows_selected gives id's of selected rows. there seems wrong use of observeevent , observe, because code deletes selected rows first time flick switch. afterwards however, every time select row deletes row. how stop deleting row once switch has been turned off? if , else statement don't seem @ all. shortened version of code: observeevent(input$deleterows,{ if(input$deleterows==true){ observe({ if (is.null(input$click_rows_selected)) return() values$df <- values[input$click_rows_selected,]})} else{ print("check")} }) the following code should toward solution. please note practice have nested observe should in general avoided. i've added updatecheckboxgroupinput thought made sense in context of example. library(shiny) values <- reactivevalues(df = iris) ui <- fluidpage(

session - PHP Combining Two PDFs Script Returns First Page Combined Twice -

i've got php script merges 2 pdf files. script works when pull 2 files directly server. point post 2 treat service , post 2 files base 64 encoded text , merge files , let receiving end download combined pdf. when using post variables, mixed results. think stuck in cache or in session, i'm not familiar how correctly make happen. when result incorrect, first pdf combined twice. started check if pdf1 = pdf2 , throw error, never happens when testing unless post same pdf. i've tried further tests in script, cannot identify point of error. how else can debug this? else can try? here's current script: <?php require_once($_server['document_root'].'/pdfmerge/tcpdf/tcpdf.php'); require_once($_server['document_root'].'/pdfmerge/tcpdf/tcpdi.php'); class mergepdf extends tcpdi { public $files = array(); public function setfiles($files) { $this->files = $files; } public function concat()//from set as

python - Iterate through JSON object to check if some entries already exists -

i'm trying loop on json object check if entries exists. json object this [ { "title": "scname", "html": "<div><iframe src=/scenario/test3dxblock.0/ width=\"400\" height=\"500\"></iframe></div>", "description": "desc", "status": "417" }, { "title": "test3dxblock.0", "html": "<div><iframe src=/scenario/test3dxblock.0/ width=\"400\" height=\"500\"></iframe></div>", "description": "desc", "status": "417" }, { "title": "filethumbs.0", "html": "<div><iframe src=/scenario/filethumbs.0/ width=\"400\" height=\"500\"></iframe></div>", "description": "desc", "status": "417"

php - Why I failed to query database? -

currently, i'm using 000webhost build website. configure wordpress in 000webhost free hosting. currently, problem when try login, shows me message failed query database access denied user 'id1351040_wp_f95ca011d778539df40db16f9d312e34'@'%' database 'login_table' based on wordpress pages, created form , coding shown below <form id="form1" name="form1" method="post" action="../wp-content/themes/main/process.php" onsubmit="return check();"> according phpmyadmin, directory /public_html/wp-content/themes/main/process.php let form action link here. code process.php shown below: <?php error_reporting(e_all & ~e_notice); error_reporting(e_all & ~e_notice & ~e_deprecated); // connect server , select database $con = mysqli_connect("localhost", "id1351040_wp_f95ca011d778539df40db16f9d312e34", "xxxxxx", "id1351040_wp_f95ca011d778539df40db16f9d312e34

javascript - why webpack does not like this expression -

i tried build reactjs app using webpack , babel. i started app react starter comes react-scripts build worked before. however, it's black box , didn't provide features need, when comes module doesn't uglifyjs. my webpack.config.js looks pretty simple: var path = require('path'); var webpack = require('webpack'); var build_dir = path.resolve(__dirname, 'build_webpack'); var app_dir = path.resolve(__dirname, 'src'); module.exports = { entry: app_dir + '/index.js', output: { path: build_dir, filename: 'bundle.js' }, module: { loaders: [ { test: /.jsx?$/, exclude: /node_modules/, loader: 'babel' }, { test: /\.css$/, loader: "style-loader!css-loader" } ] } } and have config in package.js : "scripts": { "start": "react-scripts start", "reactbuild": &quo

Creating a subset of an array in ansible -

my data file looks like --- data: - item 1 - item 2 - item 3 - item 4 i want include taskbook item 1 , diferent taskbook item 2 - 4. how can create array ['item 2', 'item 3', 'item 4'] --- - hosts: localhost tasks: - include: taskbooks1.yml param={{data[0]}} - include: taskbooks2.yml param={{item}} with_indexed_items: "{{ data }}" # want pass list without item 1 - include: taskbooks2.yml param={{item}} with_items: "{{data[1:]}}"

python - parse multilevel json to string with condition -

i have nested json item want flatten out comma separated string (i.e. parkinson:5, billy mays:4)so can store in database if needed future analysis. wrote out function below wondering if there's more elegant way using list comprehension (or else). found post i'm not sure how adapt needs ( python - parse json values multilevel keys ). data looks this: {'persons': [{'name': 'parkinson', 'sentiment': '5'}, {'name': 'knott david', 'sentiment': 'none'}, {'name': 'billy mays', 'sentiment': '4'}], 'organizations': [{'name': 'piper jaffray companies', 'sentiment': 'none'}, {'name': 'marketbeat.com', 'sentiment': 'none'}, {'name': 'zacks investment research', 'sentiment': 'none'}] 'locations': [] } here's code: def parse

php - Google Compute Engine + Cloud SQL + Cloud DNS + Google Domains - IP Changed -

i've been running successful wordpress install on google compute engine lemp (linux, nginx, mysql , php) stack, , cloud sql (generation 2 mysql) , tried tie in domain last night using cloud dns. i added record , cname , adjusted nameservers in google domains, nothing loading. at first, getting 504 bad gateway nginx/ubuntu error, nothing happens. however, noticed ip address compute engine changed, not sure how misunderstood reading , said yes. is there way change cloud sql see new ip address? if process? trying avoid having rebuild everything, guess that's how learn not in future. every google compute virtual machine has assigned default ephemeral ip address, gets changed every time restart it. can read more ips , recommend promote current ephemeral address static 1 , update wordpress config settings. please keep in mind in security risk @ moment, because old ip address granted access database might assigned user.

Upload error: Do not have last keystore for Android app -

Image
an app built developer don't have key file. know there no way key store. error message shown me when updating old apk new apk: is possible unpublish old app , republish new app same package name, version code, , version name? i want known users update app or not. there other way solve issue? if not have keystore used upload application, cannot publish update application. your option if not have correct keystore publish application new app in play store new app id. users need download new application independently of old app.

jquery - css transtion not working with javascript -

i trying move image bottom of page top. trying in way transition occurs after series of events fadein , fadeouts. here javascript: //move circles $("#fullcircles").delay(1500).fadein(); //document.getelementbyid("fullcircles").style.display = "block"; $(".circlesfull").toggleclass("move-circle"); and css .circlesfull{ height:100%; width: 100%; position: relative; left: 0px; z-index: 1; display: none; -webkit-transition: top 2s; -moz-transition: top 2s; -o-transition: top 2s; transition: top 2s; top: 800px; } /*trigger moving of circles*/ .move-circle{ top:80px; } this code not animate transition. instantly moves it. if same in css animates transition properly. .content2:hover .circlesfull{ top:0px; }

go - Protocol Buffers 3 partial update -

i trying implement partial update protocol buffers 3 (using go). problem in cases it's not possible distinguish default (empty) values , same values set on purpose (like description set empty string clear it). after digging found reference fieldmasks in this issue explains such values cannot distinguished, incremental update possible using fieldmasks. i tried find documentation or guide explaining how use fieldmasks, couldn't. so question is: how can achieve partial update proto3 (using fieldmasks)? any appreciated.

jackson - Spring boot deserialization for two models -

i want deserialize json 2 models not related, after research custom deserialization in jackson cannot see how can it? i know can solve issue creating wrapper model 2 models isnt there way deserialize on fly without jackson? i can use objectmapper twice same json input. may need annotation @jsonignoreproperties(ignoreunknown = true) and/or @jsoninclude(include.non_null) on producer side can too. if give 2 models ?