Posts

Showing posts from August, 2010

Error while running ant build.xml -

hi below code when iam running code command prompt ant run iam getting error error: f:\xxx\build.xml:29: problem: failed create task or type target cause: name undefined. action: check spelling. action: check custom tasks/types have been declared. action: check <presetdef>/<macrodef> declarations have taken place. this code: <target name="checkout" description="checkout code perforce"> <exec executable="cmd"> <arg value="/c"/> <arg value="p4 -u -p sync"/> <arg value="-p"/> </exec> </target> <target name="getlatestcode" description="checkout , latest code perforce"> <exec executable="cmd"> <arg value="/c"/> <arg value="p4"/> <arg value="-p"/> </exec

machine learning - mahout for content based recomendation -

i have list user data : user name, age, sex , address, location etc , a set of product data : product name, cost , description etc now build recommendation engine able : 1 figure out similar products eg : name : category : cost : ingredients x : x1 : 15 : xx1, xx2, xx3 y : y1 : 14 : yy1, yy2, yy3 z : x1 : 12 : xx1, xy1 here x , z similar. 2 recommend relevant products product list user how kind or recommendation engine can implement mahout ? available methods ? there useful tutorial/link available ? please help in mahout v1 here https://github.com/apache/mahout can use "spark-rowsimilarity" create indicators each type of metadata, categroy, cost, , ingredients. give 3 matrices containing similar items each item based on particular metadata. give "more this" type of recommendation. can try combining metadata 1 input matrix , see if gives better results. to personalize record items user has expressed preference for. index indica

joomla3.0 - Joomla user registration insert file -

i looking file in joomla 3, query inputs db values registration fields? thanks in advance. if follow code com_users see loads , uses model usersmodeluser (loaded /administrator/models/user.php ) in turn uses class juser (loaded /libraries/joomla/user/user.php ). if want create/alter users, should load , instance of usersmodeluser , use it's load() load existing user , it's save() method store change or create new user entries. by using usersmodeluser , therefore juser of niceties two-factor authentication (if it's configured) , correct hash password based on authentication system/plugins in use. generate random password if don't pass 1 in data used create new user.

java - Any workaround for distributing(sharding) key of collections like Lists, Sets etc -

we using redis 2.8.17 jobqueues. we using rpush , brpoplpush making reliable queue. as per our current design multiple app-servers push(rpush) jobs single job queue. since brpoplpush operation atomic in redis, jobs later poped(brpoplpush) , processed of server's consumers. since app servers capable of scaling out, bit concerned redis might become bottleneck in future. i learnt following documentation on redis partitioning: "it not possible shard dataset single huge key big sorted set" i wonder whether pre-sharding queues app servers option scale out. is there cluster can in above design? the main thing need consider whether you'll need shard @ all. entire stackexchange network (not stackoverflow -- all network) runs off of 2 redis servers (one of i'm pretty sure exists redundancy), uses aggressively. take @ http://nickcraver.com/blog/2013/11/22/what-it-takes-to-run-stack-overflow/ redis absurdly fast (and remarkably space-efficient), 1

android - In custom LayoutManager (extends RecyclerView.LayoutManager) RecyclerView.getChildViewHolderInt NullPointerException issue -

after trying similar (simplify version): @override public void onlayoutchildren(recyclerview.recycler recycler, recyclerview.state state) { .... addview(new textview(mrecyclerview.getcontext())) } i have exception: java.lang.nullpointerexception @ android.support.v7.widget.recyclerview.getchildviewholderint(recyclerview.java:2497) @ android.support.v7.widget.recyclerview$layoutmanager.addviewint(recyclerview.java:4807) @ android.support.v7.widget.recyclerview$layoutmanager.addview(recyclerview.java:4803) @ android.support.v7.widget.recyclerview$layoutmanager.addview(recyclerview.java:4791) i can't add recyclerview child view without viewholder? new children should never added recyclerview directly in layout manager. views adds should obtained attached recyclerview.adapter, accounted , have valid viewholder attached.

api - What is the appropriate HTTP status code to ask a client to redo an operation -

i have endpoint on web application takes data client , once enough data collected, operation performed. if result of operation invalid, need inform client operation must redone. i send response sort of flag in it, if status code exists purpose already, i'd rather utilize it. looking @ definitions of status codes here , seems there not 1 appropriate, however, if take names account , not descriptions, status code 406 not acceptable sounds appropriate. 406 not acceptable not appropriate because status code content negotiation: the 406 (not acceptable) status code indicates target resource not have current representation acceptable user agent, according proactive negotiation header fields received in request (section 5.3), , server unwilling supply default representation. -- https://tools.ietf.org/html/rfc7231#section-6.5.6 202 accepted seems better: the 202 (accepted) status code indicates request has been accepted processing

asp.net mvc - Kendo UI Grid binding with scaffolding/CRUD operations to model -

first of all, i'm complete novice kendo ui/client side code. i'm used using standard mvc scaffolding display tables (entity first): +------------------------------------+ | +--------------------------------+ | | |___id___|__name_|__price_|______| | | | | | |crud | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +--------+-------+--------+------+ | +------------------------------------+ where crud part shows: @html.actionlink("edit", "edit", new { id=item.id }) | @html.actionlink("details", "details", new { id=item.id }) | @html.actionlink("delete", "delete", new { id=item.id }) in terms of kendo grid, however, i'm @ loss incorporating actions these. i.e. how meant 'adding' inline or (preferably) pop up editing this? my model database tabl

adding Telerik MVC DropDownList in TreeView Template -

i want add telerik mvc dropdownlist in treeview template, not working in way: can tell me whats problem? <script id="treetemplate" type="text/kendo-tmpl"> <p>#: item.text #</p> <p>#=item.id#</p> <p> @(html.kendo() .dropdownlist() .name("permission_#:item.id#") .bindto(permissionable.getpermissiontitles()) .datatextfield("title") .datavaluefield("permission") .toclienttemplate() ) </p> @(html.kendo().treeview() .name("pables") .templateid("treetemplate") .htmlattributes(new { @class = "tree tree-selectable" }) .bindto(model.permissionables, mapping => mapping .for<permissionable>(binding => binding .children(c => c.childs) .itemdatabound((item, c) => { item.text = c.title ?? c.name; item.id =

git - creating jenkins jobs with ansible -

i'm working on project deploy jenkins ci server on centos7 using ansible , i'm having problems creating jenkins jobs xml template using ansible. everything works fine far, want able create jobs, , give them basic configuration xml file using ansible. solution following command jenkins-cli: sudo java -jar jenkins-cli.jar -s http://localhost:8080 create-job job_test1 < job_test1.xml this works when entered manually in centos7 box, when put ansible , run it: - name: create jenkins jobs xml files sudo: yes command: "java -jar {{ jenkins.cli_dest }} -s http://localhost:8080 create-job {{ item.name }} < {{ jenkins_dest }}/{{ item.xml_name }}" with_items: jenkins_jobs it gives following error message: stderr: many arguments: < java -jar jenkins-cli.jar create-job name creates new job reading stdin configuration xml file. does know solution this? far can see i'm doing properly(since command works when not entered ansible) the com

entity framework - Defining navigation from Person to Country but not from Country to Persons using the Fluent syntax -

i have following relationship between person , country defined convention. works perfectly. public class person { public long personid {get; set;} public string name {get; set;} public long countryid {get; set;} public virtual country country {get; set;} } public class country { public long countryid {get; set;} public string name {get; set;} } i wish change name of property country else. understand means relationship not work anymore convention. wish define using fluent syntax. i found this reference not clear me how should handle exact scenario since in examples both sides of relation contain foreign key or collection. there section "configuring relationship 1 navigation property" makes me think should this: modelbuilder.entity<patient>() .hasrequired(t => t.country) .withrequiredprincipal(); however, whenever when storing countries results in following exception {"the insert statement conflicted foreig

javascript - history.pushState how can I get rid of get parameters? -

i using history.pushstate('id','mytitle','myurl'); to manipulate displayed url , history stack. @ point pushing parameters so: history.pushstate('id','mytitle','?mysublinkedstuff=hotsublinkedstuff'); now when do history.pushstate('id','mytitle','#justsomehashtag'); it produces http://example.com?mysublinkedstuff=hotsublinkedstuff#justsomehashtag can overwrite value of mysublinkedstuff not seem able rif of alltogether. desired result: http://example.com#justsomehashtag or http://example.com/#justsomehashtag and don't want make whole roundtrip on server , want avoid using absolute path or url keep project portable. as nimrodargov rightly remarked: overwriting existing get-parameter strings works if push full url. ensuring portability of app (keep usable on various domains) did this: history.statepush(document.location.origin + window.location.pathname + '#myhashvalue'

symfony - Get entity assert property in form view (or in form builder) to use with JS -

i'm trying access assert information defined in entity class form class myentity { [...] /* * @assert\count(min="1", max="3") */ protected $myfield; [...] } the purpose customize view. in example, display message said "you must enter between [min] , [max] items" i var_dumped lot of variable in form_div_layout.html.twig i've tried explore formbuilder object haven't found this. do know way achieve ? ps: sorry poor english edit after martin rios answer: the goal not provide error message. the final goal use these values construction of view. for example, if use jquery plugin: sfprototypeman , can have "add item" link , "remove item". if want disable "add item" link when collection reaches maximum size, need manipulate constraint property in javascript i tried study plugin jsformvalidatorbundle didn't understood how works... why don't validation in cookbook ?

python - New to tkinter tuple has no attribute -

code: from tkinter import * # constructor syntax is: # optionmenu(master, variable, *values) speed = [ "fast", "medium", "slow" ] master = tk() variable = stringvar(master) variable.set(speed[0]) # default value w =(optionmenu, (master, variable) + tuple(speed)) w.pack() mainloop() error message: traceback (most recent call last): file "s:/ks4/year 10/computing/python/tkinter.py", line 18, in <module> w.pack() attributeerror: 'tuple' object has no attribute 'pack' yes, w tuple, indeed can see if print(w) : (<class 'tkinter.optionmenu'>, (<tkinter.tk object @ 0x02f97f30>, <tkinter.stringvar object @ 0x02fae970>, 'fast', 'medium', 'slow')) this two-tuple where: the first element w[0] optionmenu class object; and the second element w[1] tuple, containing 5 elements: the master tk instance; the variable stringvar instan

javascript - Create multiple rows in table from array? -

is possible add multiple rows @ once array sequelize.js? code: var user = user.build({ email: req.body.email, password: req.body.password, userlevel: '3', }); user .find({ where: { email: req.body.email } }) .then(function(existinguser){ if (existinguser) { return res.redirect('/staff'); } user .save() .complete(function(err){ if (err) return next(err); res.redirect('/staff'); }); }).catch(function(err){ return next(err); }); thanks advise! http://sequelize.readthedocs.org/en/rtd/api/model/#bulkcreaterecords-options-promisearrayinstance user.bulkcreate([{ /* record 1 */ }, { /* record 2 */ }.. ])

How to iterate over a ctypes array in python? -

a = ((c_char*2)*2)(('a','b'),('c','d')) out::<__main__.c_char_array_2_array_2 @ 0x47da8c8> b = [cast(i, c_char_p) in a] b out::[c_char_p('abcd'), c_char_p('cd')] how can iterate output out::[c_char_p('ab'), c_char_p('cd')]

jquery - How do I check if an element exists inside an iframe? -

$('#frame').load(function(){ settimeout(function() { alert($("#frame a[href=check]").length); },2000); }); the alert shows 0 , iframe loads correctly , link exists. to fetch contents of iframe try $('#frame').load(function () { settimeout(function () { alert($('#frame').contents().find('a[href=check]').length); }, 2000); }); .contents() the .contents() method can used content document of iframe, if iframe on same domain main page.

javascript - Backbone adding content to current view -

i'm not familiar backbone have project support has tiny usages of backbone. there spot in backbone script of page: app.views.products = backbone.view.extend({ tagname: "table", classname : "table table-bordered table-hover data-table", }); which initializes view-template , parse table , renders view. want add before table, have added following piece above code not work, , adds content beginning of table: initialize : function(){ this.$el.prepend("i have added content,"); } .prepend() method inserts specified content first child of matched element(s). in case have use .before method instead: initialize : function(){ this.$el.before("i have added content,"); }

jquery - Applying Javascript classes to generated content before it is applied to DOM -

i have situation whereas generating content (video links) via ajax call in javascript object. once content returned backend, html string generated , appended current html in dom. html string contains video links wrapper in 'div'. need apply new javascript object each of these new generated divs , have done using following code: if(response.videos.length != 0) { jquery(response.videos).each(function(key, video) { self.html += "<div class='col-md-4' data-related-video='" + video.videoid + "'>"; self.html += '<a href="#" class="dashboard-video"></a>'; self.html += '<div class="video-information">'; self.html += '<h5 class="tk-bebas-neue">' + video.videoname + '</h5>'; self.html += '<p>' + video.videodesc + '&

How do I assemble on github page instead of jekyll -

hello need build static page exhibition. i aleardy use jekyll static site. but.. i want use assemble, found use assemble on github static page.. i think "github pages" use html, js, css .. becuase available idea... i found site using assemble without jekyll on github pages.. assemble not processed github pages. means have : generate site locally pull resulting files github add empty .nojekyll file @ root of repository. and go!

sql server 2008 r2 - No orderby in LINQ query, but ORDER BY in SQL -

i have linqtoentities query not use orderby clause, on resulting sql query, there order clause (which costs 77% on query on execution plan). does know why order clause added , how can remove (if possible) ? here linqtoentities query : var classementsquery = classement in _dbcontext.classements .include(c => c.operations) .include("operations.matrices") .include("operations.qualifications") .include("operations.qualifications.matrices") .include("operations.qualifications.qualificationetapes") .include("operations.qualifications.qualificationetapes.matrices") classement.operations.any() select classement; nota : each of included entities relations n-n.

NetLogo: Is there any way to change patch colour under turtles which dies? -

i wrote simulation contain ants , spiders . spider kill ants , not things happens spider take of ant venom , reduces health. @ point spider die after there energy equal 0 . want spider die , change patch colours under death spider black brown i have tried code didn't work . spider disappear (die) pcolor not change to spider-death if energy <= 0 [ask antiagents-here [die if pcolor = black [set pcolor brown]]] end please help after agent dies, no longer exists, , therefore can no longer take actions. so example: ask turtles [ die print "hello!" ] nothing ever printed, because turtle dies before can print anything. so in code, need change part: die if pcolor = black [set pcolor brown] to: if pcolor = black [set pcolor brown] die

sql server - How to set order of SQL-response? -

i've got mule flow queries sql-server database , converts response json , writes json comma separated file. my problem order of column in written file doesn't match order of fields in query. how tho define order of columns in query answer? the json csv conversion this: public class bean2csv { /** * @param args * @throws jsonexception */ public string conv2csv(object input) throws jsonexception { if (!input.equals(null)){ string inputstr = (string)input; jsonarray jsonarr = new jsonarray(inputstr); string csv = cdl.tostring(jsonarr); csv = csv.replace(',', ';'); system.out.println(inputstr); //csv system.out.println(csv); //csv return csv; } else return "";} } and here flow <?xml version="1.0" encoding="utf-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.

javascript - Disable other options in a dropdown, if clicked on the first option -

i have dropdown can select multiple options. if select 1 option in that, need rest of options disabled. for example : in below code, if select option all, need rest of options disabled. <select id="searchregion" name="searchregion" multiple="multiple"> <option> choose region(s) </option> <option value="all"> </option> <option value="east"> east </option> <option value="north"> north </option> <option value="west"> west </option> <option value="south"> south </option> </select> image try var $searchregion = $('#searchregion').change(function() { var isall = $searchregion.find('[value="all"]').is(':selected'); if (isall) { $searchregion.val('all'); } $searchregion.find('option').not('[value="all"]').prop('disabled&

visual studio - MSI: How to add rows to 'Upgrade' table in c#? -

i have visual studio setup project. after msi built apply transformation. adds 2 rows 'upgrade' table (properties p1,p2)and modifies property securecustomproperties previousversionsinstalled;newerproductfound to previousversionsinstalled;newerproductfound;p1;p2 how can in vs setup avoid transformation applying? you can't avoid using vs setup. it's 1 of many design limitations of tool. either live through postbuild hacks or rewrite installer using tool such wix. i maintain open source project called iswix. has project tempates , visual designers make easy such task.

php - MultipartUpload error -

i'm working amazon s3 , aws sdk php . i'm trying use multipartupload upload files have error: php catchable fatal error: argument 2 passed guzzle\service\client::getcommand() must of type array, string given, called in /var/www/html/aws/guzzle/service/client.php on line 76 , defined in /var/www/html/aws/guzzle/service/client.php on line 79 this error occurs when put more 10 simultaneous uploads. anyone knows why? php: ( connection.php ) use aws\common\exception\multipartuploadexception; use aws\s3\model\multipartupload\uploadbuilder; use aws\s3\s3client; $uploaded = (object) $_files['uploaded_file']; $this->file = $uploaded->tmp_name; $arrayconfig = array( 'key' => $this->accesskey, 'secret' => $this->secretkey ); $this->awsclient = s3client::factory($arrayconfig); $uploader = uploadbuilder::newinstance() ->setclient($this->awsclient)

c# - Error in Saving of Regarding Attribute (Lead_PhoneCall Activity) from CRM Portal (2011)? -

i trying save guid of lead in regarding field of phonecall activity, gives error - "regardingobjectid" only. [on premise] please help! in new_phonecall.cs page : phonecall_save.regardingobjectid = guid.parse(hdnfld_regarding.value); //(hdnfld_regarding hiddenfield in m passing guid, have taken along textbox) in appcode/crmdmlibrary.cs : public class phoneentity { public guid regardingobjectid; } public bool savenewphonecall() { try { iorganizationservice context = crmdmlibrary.getcrmservice(url, domainname, username, password); entity phone = new entity("phonecall"); phone["regardingobjectid"] = new entityreference("regardingobject", regardingobjectid); guid phoneid = context.create(phone); return true; } catch (exception ex) { httpcontext.current.response.write(ex.message); httpc

java - cannot receive udp broadcast packet on android -

i trying receive udp packets being sent android machine.ii can receive same packets on java udp client program same not working on android. here code: //main activity public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); log.v("main activity", "intialized started"); list = (listview) findviewbyid(r.id.listview1); mainwifiobj = (wifimanager) getsystemservice(context.wifi_service); wifireciever = new wifiscanreceiver(); mainwifiobj.startscan(); log.v("main activity", "mainactivity started"); clientdatagramreceiver=new clientdatagramreceiver(); clientdatagramreceiver.start(); //clientdatagramreceiver class import java.io.ioexception; import java.net.datagrampacket; import java.net.datagramsocket; import java.net.inetaddress;

Call a C# .net .dll script using PHP -

i have c# .net dll script calls sql stored procedure select s data in order run relevant methods. i need run dll using php entire application built in php. what best way of doing this? i'm not experienced @ c#. edit i registered .net dll using: regasm.exe dllname.dll /tlb:dllname.tlb i should able use php's com() method described below call dll's functions/methods. but these functions still accessible through com() method .net dll registered assembly? make difference? edit after registering .net dll assembly error message when try call method using com() : "php fatal error: uncaught exception 'com_exception' message 'failed create com object `dllname.classname': invalid syntax" edit tried using: new dotnet('dllname, version=4.0.30319.33440, culture=neutral, publictokenkey=14843e0419858c21', 'classname'); got internal server 500 error is because php doesn't communicate .net 4 assemblies?

Mysql insert on the first empty column on duplicate key update -

i'm trying set query insert data on first empty column or, if key value exists, update on first empty column "insert table (myid,tr1) values ('12345', '$data') on duplicate key update tr1 = case when tr1 = '' else tr1 end, tr2 = case when tr2 = '' else tr2 end, tr3 = case when tr3 = '' else tr3 end = $data" where myid unique key, in other words: -------------------------- | myid | tr1 | tr2 | tr3 | -------------------------- | 1233 | data| | | -------------------------- | | | | | -------------------------- when id matchs, updates $data in next empty column, in case myid=1233 column tr2. when myid not exist insert myid , $data on tr1. query getting syntax error appreciate help! maybe problem in case clause. try example. i made changes on query, should work. example insert `table` (myid,tr1) values ('12345', '111') on duplicate key update tr3 = case when tr2 != '

matplotlib - How to eliminate whitespace in pyplot heatmaps? -

Image
i trying make heatmap using pcolor in pyplot data=np.array(old_data) fig, ax=plt.subplots() mymap=ax.pcolor(data, cmap=plt.cm.blues) ax.autoscale(tight=true) plt.show() for reason keep getting blank white columns between heatmap columns: is there missing or doing wrong?

regex - htaccess redirect a plus sign -

i try make redirect of url old site new site, not work. think it's plus symbol, or problem i'm stupid shit. rewriterule ^nl/pageid/junair+compressor+onderhoud(|/)$ /nl/persluchttechniek/page/nieuwsberichten/compressor-onderhoud-junair [r=301,l] try redirect rule in root .htaccess of old site: rewriterule ^nl/pageid/junair[\s+]compressor[\s+]onderhoud/?$ /nl/persluchttechniek/page/nieuwsberichten/compressor-onderhoud-junair [nc,b<r=301,l] make sure first rule below rewriteengine line. check there no other .htaccess in system.

jquery - How to send javascript editable FileList to server? -

in documentaion says in javascript cann't edit filelist inside 'input' element, because readonly. alternatives send other javascript filelist, can edit, server? this html test-page: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>test-page</title> <script type="text/javascript"> //<!-- var fileobj, file; function init() { fileobj=document.getelementbyid('filepick'); fileobj.focus(); fileobj.click(); //should auto-trigger file-select popup, doesn't return; } function filed() { file = fileobj.files; //at point should have array of "item" objects, // containing files in directory. //you can write code pluck whatever want array, // , send list server. return; } // --> </script> </head> <body onload="init();"> <input id="filepick" type="file" multiple="multiple" onchange=&quo

c# - newid() as column default value -

Image
this question has answer here: entity framework - default values doesn't set in sql server table 4 answers i have table uniqueidentifier column. default value or binding should set in order each new row generate new uniqueidentifier? setting default newid() returns 00000000-0000-0000-0000-000000000000 edit : apparently got wrong, insert done entity framework, , doesn't handle scenario. entity framework - default values doesn't set in sql server table newid() should work. see images below: you have issue there.

Adding custom error messages for validation in Spring-MVC -

i using spring-mvc , validation tests in backend. able perform tests, redirect link. unable add custom error messages incase there problem, example : "firstname empty". tried using validationmessages_en_en.properties file in web-inf, didn't help. posting code, kindly let me know going wrong : controller : @controller public class personcontroller { @requestmapping(value = "/", method = requestmethod.get) public string listpersons(model model) { person person = personservice.getcurrentlyauthenticateduser(); if(!(person==null)){ return "redirect:/canvas/list"; } else { model.addattribute("person", new person()); // model.addattribute("listpersons", this.personservice.listpersons()); model.addattribute("notices",new notes()); model.addattribute("canvases",new canvas()); return "person"; }

Error Message when opening python program created with cx Freeze -

Image
i want make runnable program using python , cx_freeze. the script uses csv, socket, ipaddress, threading , tkinter packages. when open tool see error message displayed below. is problem imports? or doing wrong? this how setup script looks like: import sys cx_freeze import setup, executable # dependencies automatically detected, might need fine tuning. build_exe_options = {"packages": ["tkinter","socket","csv","struct","threading","ipaddress"], "excludes": []} # gui applications require different base on windows (the default # console application). base = none if (sys.platform == "win32"): base = "win32gui" setup( name = "csv tool", version = "0.1", description = "tool work data create csv import ucmdb", options = {"build_exe": build_exe_options}, executables = [executable("csv_tool.py", base = bas

.net - C# Not enough storage is available to process this command on Console.ReadLine() -

this code static void main() { /* servicebase[] servicestorun; servicestorun = new servicebase[] { new opentableimporter() }; servicebase.run(servicestorun);*/ xmlreader x = new xmlreader(new logcustome()); console.readline(); } i got: not enough storage available process command. on console.readline() could please? update 1 the class logcustome empty see: class logcustome { public void logstartservice() { } public void logstopservice() { } } update2 even when code simple this: static void main() { /* servicebase[] servicestorun; servicestorun = new servicebase[] { new opentableimporter() }; servicebase.run(servicestorun);*/ //xmlreader x = new xmlreader(new logcustome()); console.readl

Javascript call Parent constructor in the Child (prototypical inheritance) - How it works? -

i know works, don't know why , how. mechanics? // parent constructor function parent(name){ this.name = name || "the name property empty"; } // child constructor function child(name){ this.name = name; } // originaly, child "inherit" parent, name property, in case // shadowing name property in child constructor. child.prototype = new parent(); // want this: if dont set name, please inherit "the name property empty" // parent constructor. know, doesn't work because shadow in child. var child1 = new child("laura"); var child2 = new child(); //and result undefined (of course) console.log(child1.name, child2.name); //"laura", undefined i know need, call() or apply() method. call " super class " (the parent constructor) child , , pass this object , argument name that. works: function parent(name){ this.name = name || "the name property empty"; } function child(name){ // call "su

Jenkins cvs-plugin configuration -

i'm trying migrate jenkins 1.459 1.580. , cvs-plugin changes 1.6 2.12 in 1.6 cvs-plugin, use .cvspass file store cvs passwords. have lot of jobs , lot of repositories , not want store password in each jobs. but in 2.11, seems plugin not use file anymore. am correct? jobs need specify password repository. as our security policy change password every 2 months, not want change configuration of every jobs. is possible configure cvs repositories @ jenkins configuration level , not per-job configuration level? in jenkins > manage jenkins > configure system , see can add many cvs root + username + password. in job configuration , need specify cvs root should contains username , optionally password. how can configure jobs use configuration jenkins configuration? thanks in advance, in jenkins 'configure system' page, can enter cvsroot , username , password used repository. on job configuration page can enter cvsroot in 'configure system'

javascript - jQuery UI, Droppable - Why this doesn't work -

this simple ... drag , drop in area. when set margin dragged element (.a1_73, .a2_73) nothing happend on dropped area. have no idea why. wrong ??? without margin works greate. html <div id="a1_73" class="empty">#a1</div> <div id="a2_73" class="empty">#a2</div> <div id="a3_73" class="empty">#a3</div> <div id="a4_73" class="empty">#a4</div> <div class="a1_73 dragme">.a1</div> <div class="a2_73 dragme">.a2</div> <div class="a4_73 dragme">.a3</div> <div class="a3_73 dragme">.a4</div> javascript $(".dragme").draggable({ start: function (event, ui) { $(this).put_element(); } }); $.fn.put_element = function () { $this = $(this).attr('class').split(" "); $this = $this[0]; $("#" + $this + "").

css - IE: remove underline on pseudo-element -

on chrome , firefox, if apply text-decoration:underline on tag, default underline not apply pseudo element. on ie does, , can't remove it. want link underlined, not pseudo element. work if add span inside , put underline on it, want know if can made without additional markup. a{ padding-left: 9px; position:relative; display:inline-block; } a:before{ content:'\203a\00a0'; position:absolute; top:0; left:0; display: inline-block; } #underline{ text-decoration: none; } #underline:hover{ text-decoration:underline; } /* special ie */ #underline:hover:before { text-decoration:none !important; /* nothing ! */ } #color{ color:green; } #color:hover{ color:red; } #color:hover:before{ color:green; /* work ! */ } #span{ text-decoration: none; } #span:hover span{ text-decoration: underline; } <a href="#" id="underline">underline</a> <br> <a href="#" id="

logging - Continuously update control (listBox) from live feed (file) c# -

i'm doing small app reads log file continuously updated, parses , shows relevant information. i started doing prototype in console app , working smoothly. i'm totally stuck when trying to, instead of outputting console, trying control (a listbox in case). the ui freezes read never ends thou async method , works flawlessly console app. i'm trying find information not sure if have run background workers or kind of approach should make. the current situation follows: win form controls class handles reading the class works said console app. reads continuously file , parses information , outputs if instead outputting try add info listbox, ui freezes. quick update: the async method enclosed while(almostalwaystrue) that's reading new data if there is. hope clear. appreciated. thanks. i used filesystemwatcher. log created first read , instantiate watcher. whenever change, watcher reads last point. ran different problem. i couldn't acces

how to print X amount of lines after finding a string in a file using C++ -

i'm trying implement function in c++ searches string in file, prints the line containing string , x subsequent lines. i have following code works finding string , printing line, can't work print lines under line string. void repturno(void){ system("cls"); string codemp, line,output; bool found = false; ifstream myfile ("pacientes.csv"); //captures string need for, in case employee code cout<<"\nbienvenida enfermera en turno, por favor introduzca su codigo"<<endl; cin.ignore(); getline(cin,codemp); system("cls"); /*reads file , searches string, prints whole line, searches again string , if finds it, print whole line again*/ while (getline(myfile, line)) { if (line.find(codemp) != string::npos) { cout<<line<<endl; getline(myfile,line); found = true; } } //using check if code working, , verif

excel vba - VBA auto-complete / suggestion -

typing 'activesheet.' not bring list of suggestions whereas other classes will. how bring autosuggestion screen in coding screen typing? in excel, typing activesheet invoking property of default object, excel.application . if working in access (based on tags), default object access.application, doesn't have activesheet property. instead, access, see activesheet undimensioned variant variable. intellisense seek, must: have reference excel library declare variable of type excel.application type dot after variable's name , you'll see activesheet in intellisense or (from @dee) dim somesheet worksheet 'as excel.worksheet in access set somesheet = activesheet 'as excel.activesheet in access 'use somesheet, there have intellisense if type option explicit @ top of module, you'll helpful compile error when refer doesn't exist or mis-spelled, instead of accidentally declaring new variable.

angularjs - WebStorm navigate to Angular directive with dependencies not working -

i using webstorm 8.0.4 , when have module of type: var module = angular.module('mymodule'); module.directive('mydirective', function() { return { templateurl: 'xxx.html', restrict: 'e' }; }); it works fine when ctrl + clicking on element within webstorm, such as: <my-directive></my-directive> but not when directive includes dependencies such as: var module = angular.module('mymodule'); module.directive('mydirective', ["$scope", function($scope) { return { templateurl: 'xxx.html', restrict: 'e' }; }]); anybody encountering same issue? please try upgrading - web-13091 fixed in webstorm 9

javascript - show fade in and fade out of an array of images simultaneously -

jquery var images=new array('images/pipe.png','images/pipe1.png','images/pipe2.png'); var nextimage=0; doslideshow(); function doslideshow() { if($('.slideshowimage').length!=0) { $('.slideshowimage').fadeout(500,function(){slideshowfadein();$(this).remove()}); } else { //alert("slide"); slideshowfadein(); } } function slideshowfadein() { $('.leftimage').prepend($('<img class="slideshowimage" src="'+images[nextimage++]+'&quo

javascript - jQuery: is it possible to make ID/class-less elements change on click? -

example css: div { background-color: green; } example html: <div>apple 1</div> <div>apple 2</div> <div>apple 3</div> is possible bind jquery clicks these, clicked div change background color blue, , others revert default color? i'm thinking like: $("div").click(function() { // first change default color $("div").each( background-color: green; } // change clicked div blue how clicked element in here dont know. }); use $(this) refer clicked element: $("div").click(function() { // first change default color $("div").css('background-color', 'green') // change clicked div blue $(this).css('background-color','blue'); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div>apple 1</div> <div>apple 2</div>

java - null pointer exception while resizing arrays -

i have nullpointerexception in line " newindexer[i].index = (int)double.positive_infinity; " , cannot figure out why. appreciated. public void resizeindexer(int newkey) { if (maxheap >= newkey) return; if (newkey > maxheap){ handle[] newindexer = new handle[newkey + 1]; (int = 0; < newkey; i++){ if (i < maxheap) newindexer[i] = this.indexer[i]; else{ system.out.println(i); newindexer[i].index = (int)double.positive_infinity; newindexer[i].status = false; } } maxheap = newkey; indexer = newindexer; } } you have create new handle instance each new index of new array before modifying index , status members : (int = 0; < newkey; i++){ if (i < maxheap) newindexer[i] = th

logging - python rotating file handler callback -

i'm using rotatingfilehandler ( https://docs.python.org/2/library/logging.handlers.html ) in python log messages - there anyway function callback when rotatingfilehandler switches new file? for example, i'm logging messages, , when file rotates want process of messages using defined function thanks! there's not callback, can subclass rotatingfilehandler , override own "rotation", implementing dorollover method : myfilehandler(rotatingfilehandler): def dorollover(): # invoke superclass' actual rotation implementation super(myfilehandler, self).dorollover() # start doing own tasks # ...

java - Error setting expression 'userBean.password' with value ['', ] -

i'm using struts 2 , tomcat together. problem i'm facing is: whenever submit data whether wrong or not (username , password) allways makes following field error appear: .error setting expression 'userbean.password' value ['xxx', ] .error setting expression 'userbean.username' value ['yyy', ] where 'xxx' password , 'yyy' username. my action class is: package direstruts.action; import static com.opensymphony.xwork2.action.success; import direstruts.model.userbean; public class loginaction extends genericaction { @override public void validate() { userbean ub = getuserbean(); if(ub.getusername().isempty()) { addfielderror("userbean.username", "por favor insira o username de utilizador"); } if(ub.getpassword().isempty()) { addfielderror("userbean.password", "por favor insira password de utilizador"); } }