Posts

Showing posts from June, 2014

java - i keep getting 404 tomcat error -

i've wamp installed , working fine using port 80 installed tomcat apatche use java ee , keep getting 404 tomcat error on first project http://localhost:8080/test/ (a simple , empty html page) server [started,synchronised] i've set system variables below catalina_home c:\apache-tomcat-8.0.24 java_home c:\program files\java\jdk1.8.0_51 and added ;%java_home%;%java_home%\bin path it doesnt work i've stopped server, switched server location "use tomcat installation(take control of tomcat installation)" , didn't fix either had tomcat year before working wamp wasn't installed i'm running out of options here . can me please ? i think indeed wamp guilty. if running listening port 80, tomcat cannot start listening port (if configured in server.xml). when turn localhost/test arrive wamp instead of tomcat. so, first check whether wamp running , port tomcat expected listen to. either stop wamp or change configuration of 1 of severs avoid po

python - wxPython Phoenix source build fails on build_py step -

summary i'm trying build wxpython phoenix source on travis-ci (ubuntu 12.04), getting "no member named 'api_get_reference'" error during sip_corewxheaderctrlevent.cpp. details below process flow i'm following [ source ]. have separated out each build.py step me debug (and travis-ci log folds output). note: reason, build/build.py sip not correctly download sip. why have steps 1 , 2. dl, extract, , build sip source. create environment variable 'sip' points install dir dl wxpython phoenix source tarball, extract, cd extracted dir python ./build.py --build_dir=./bld dox python ./build.py --build_dir=./bld touch python ./build.py --build_dir=./bld etg --nodoc sudo -e python ./build.py --build_dir=./bld sip i've found need sudo step. -e option keep environment variables. python ./build.py --build_dir=./bld build_wx up here, appears work fine. when run python ./build.py --build_dir=./bld build_py i "no member named

jquery - convert array from inside of returned object into select item list js -

i've looked @ several examples here on how , answer still alludes me. i have ajax call returns object couple properties array of other objects. want take 2 properties each internal object create list. right now, have code looks this: mymethod: function(data){ $.each(data, function(){ $('#myselectlist').append($('<option></option>').text(data.name).val(data.id)); }); } i have tried json.stringify(data.name) well, believe needed here, think accessing properties incorrectly. object returned looks in chrome dev tools: object {booleanproperty1: true, booleanproperty2: true, rows: array[9]} and when drill down rows: 0: object id: 1 title: "sometitle" someotherproperties: propertydata //more properties 2: object id: 2 title: "someothertitle" someotherproperties: propertydata //more properties //more objects how can access properties inside array use them when creating list

Android widget works well in emulator but on phone it turns into the Google App widget -

i created android widget. in genymotion nexus 4 emulator running android 4.4.4 works well. on nexus 4 device running android 4.4.4 put widget on home screen , turns google app widget. turns widget again google app widget , on. until remove widget home screen. using parse.com online storage , on phone data doesn't seem obtained. can't tell sure because widget keeps changing. widget contains 3 files. 1 extends application class: public class myapp extends application { private mymodel model; @override public void oncreate() { parse.enablelocaldatastore(this); parseobject.registersubclass(gdbddata.class); parse.initialize(this, "-", "-"); if(model == null) { intent intent = new intent(this,gdbdwidgetprovider.class); intent.setaction(widgetutils.widget_refresh_storage); intent.putextra("userid",123); sendbroadcast(intent); } super

c# - Cannot write log to LogEntries from Azure Web App -

from inside asp.net web api application (version 5) trying send logs logentries cannot. same code , configuration, can send logs localhost. this code using send logs (with nlog:) private static logger log = logmanager.getcurrentclasslogger(); public static void logstring(string message) { log.error(builder.tostring()); } this web.config configuration: <appsettings> <add key="logentries.token" value="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" /> </appsettings> <nlog> <extensions> <add assembly="logentriesnlog" /> </extensions> <targets> <target name="logentries" type="logentries" debug="true" httpput="false" ssl="false" layout="${date:format=ddd mmm dd} ${time:format=hh:mm:ss} ${date:format=zzz yyyy} ${logger} : ${level}, ${message}" /> </targets> <rules> <logger name="*" minlevel="debug"

C# / C++ - How to find out how many bad sectors on the hard drive? -

is there way in can information pc's hard-drive amount of bad sectors through c# or c++? i tried looking in c# win32_diskdrive class ( https://msdn.microsoft.com/en-us/library/aa394132(v=vs.85).aspx ) didn't find related bad sectors.

awk - Comparing files based on column -

i try write script comparing 2 large files based on column 2. each file contains 1 million records. output, need know records common on column 2 (exist on both files) have different value in column 1. files quoted comma separated value files file1_pair 20151026,1111 20141113,2222 20130102,3333 77777777,9999 file2_pair 20151026,1111 20203344,2222 50506677,3333 77777777,8888 desired_output 20141113,2222,20203344 20130102,3333,50506677 i tried modifying script below not able right. awk 'fnr==nr { a[$0]; next } !($2) in { c++ } end { print c }' file1_pair file2_pair` you had right idea operating on wrong fields. you need save $2 values first file in array , check $2 values second file against array. need compare value of $1 in corresponding rows. this awk script that. awk -f , -v ofs=, ' nr==fnr { # store value of $1 under $2 key in a[$2]=$1 next } # if $2 in (we've seen value before) , # if value in arr

linear regression - doParallel in R - Improvement in speed but CPU is not always utilised to 90%-100% -

i trying run many linear regressions , diagnostics on them , speed things using doparallel package in r programming language. i have come across though interesting issue. although have seen performance improvement -as expected- usage of cpu not consistent . for example, if run of code, cpu utilization may 30-40% cores. if run again code, possible cpu utilization goes 90% without me changing in meantime. in both cases, not running else on same time. is there explanation why cores used 30% 1 time , 90% time without me changing anything? i running windows xp, 4gb or ram, , have inter(r) xeon(r) cpu x5650 @ 3.67ghz. my code looks like: results <- foreach(i=seq(1:regressions), .combine='rbind', .export=c('lmresults','lmcsig', 'lmcvar')) %dopar% {model <- lm(as.formula(as.character(dat[i])), data=df) lmresults(model) } your system has become memory constrained either within r or other programs taking memory resources.

javascript - Duplicate-free version of array of objects -

i implemented function creates duplicate-free version of array, doesn't work array of objects. don't understand , can't find information how fix it. my function: function uniq(array) { var length = array.length; if (!length) { return; } var index = 0; var result = []; while (index < length) { var current = array[index]; if (result.indexof(current) < 0) { result.push(current); } index++; } return result; } example: var my_data = [ { "first_name":"bob", "last_name":"napkin" }, { "first_name":"billy", "last_name":"joe" }, { "first_name":"billy", "last_name":"joe", } ] uniq([1, 1, 2, 3]) // => [1, 2, 3] uniq(my_data) // => [ { "first_name":"bob", &qu

mysql - Left join for three tables -

i have 3 tables follows table - user answerd user id | question id | answer option id | 1 | 1 | 2 | 1 | 2 | 1 | table b - question question id | question text | 1 | question 1 | 2 | question 2 | table c - answer answer id | question id | answer option id |answer text | 1 | 1 | 1 |question 1 answer 1 | 2 | 1 | 2 |question 1 answer 2 | 2 | 2 | 1 |question 2 answer 1 | 3 | 2 | 2 |question 2 answer 2 | i want find out user gave answer result should this 1 | question 1 | question 1 answer 2 | 1 | question 2 | question 2 answer 1 | i tried so select * left join b on a.question_id = b

r - Can I get back info like: "hover location", "Brush location" or "click location" -

i want set interactive graph shiny , plotly. shiny has build in feature info user interaction. like: input$plot_click , input$plot_dblclick , input$plot_hover , input$plot_brush . see: http://shiny.rstudio.com/articles/plot-interaction.html is there option on plotly api? or can api handle 1 direction? plotly cool. love use in shiny apps. thanks , best regards nico yes, there click , hover bindings plotly graphs through postmessage api: https://github.com/plotly/postmessage-api a sketch of how use postmessage api shiny here: http://moderndata.plot.ly/dashboards-in-r-with-shiny-plotly/ and code here: https://github.com/chriddyp/plotly-shiny

VB.Net How to export every 'n' number of rows from DataGridView to different tabs in Excel -

i have dgv 500 rows , 15 columns. have 5 team members. have allot equal amount of rows members. so, in above e.g. have send 100 rows each of team member dgv. first 100 rows go emp#1, rows 101 - 200 go emp#2, , on.. i checked this , this not able try code logic working. i looking in vb.net only. thx in advance. edit: we're little tight on budget, not able invest in plugin now. you can use easyxls excel library export excel file 5 sheets , 100 rows each: ' create instance of class exports excel files, having 5 sheets dim xls new exceldocument(5) dim n integer = datagridview.rows.count()/5 sheet integer = 0 4 ' set sheet names xls.easy_getsheetat(sheet).setsheetname("emp#" & (sheet+1)) ' sheet table stores data dim xlstab excelworksheet = xls.easy_getsheetat(sheet) dim xlstable = xlstab.easy_getexceltable() dim tablerow = 0 ' add data in cells row integer = 0 n - 1 column intege

linux - cp command conflicts on non-existent files -

an error occurs when ran command on redhat server data directory: rm -rf data; cp -r another_dir data an error occurs command: cp: cannot create directory `data/test': file exists this error not happen. when see error can rerun commands , succeed. also, changing ; sign $ not solve problem. i don't understand. how possible? what data? directory or file ? if directory try rmdir data if file , try rm -f data since rm -rf data;cp -r another_dir data 2 different commands . try 1 one , give me result

php - preselected values in DateControl yii 2 -

i have following code : $form->field($model, 'start_time')->widget(datecontrol::classname(), [ 'type'=>datecontrol::format_datetime, 'displayformat' => 'php:d-m-y h:i:s', 'ajaxconversion'=>true, 'options' => [ 'pluginoptions' => [ 'autoclose' => true ] ] ]); that works perfectly. can select date , time , send data controller save it. the problem when write same code in update form, values comming database not show in datecontrol field. empty.. have tried provide unix type datetime , normal string(24-jul-2015) doesn't show thing. 1 know how ? other fields following seems working , being populated values database <?= $form->field($model, 'price')->textinput() ?> i

javascript - Access Data Layer from Previous Page -

i'm using javascript data layer across domain of mine , due analytic requirements surrounding conversion tracking, when lead converted need @ page type (tracked in data layer) of previous/referring page. i'm gathering previous page's url document.referrer because isn't function, can't pass data layer call page type. my current understanding of document.referrer history can't access elements of previous page without stepping page in browser history.go(-1) not acceptable purpose. has lead me think i'll either need use session or cookie tracking purposes or setup 1x1 pixel iframe on each page contains previous page can access element. is there method can use access data layer aside redirection, iframe, or session/cookie? you indeed can't access previous page. there several methods store data, either client or server side. for server side should check environment use, guess have basic 'session' can store data. also, use databas

html - Background image to fill background when browser fully opened, and crop when closed -

i use image total window background when browser window open using size display. if browser window made more narrow, left , right sides of image should cropped , scrollbar should not displayed. background-size: cover; seems me close, crops off right side. how can accomplished? body { background-image: url("image.jpg"); background-repeat: no-repeat; background-size: cover; background-position: center; } centers background image on page.

sprite kit - Swift Comparing two color objects to see if their color is the same with touch -

the choiceball set black randomly changes color match 1 of other balls each tap. idea tap the other balls according choiceball's color is. for example: choiceball turns blue. touch blue ball. choiceball turns red touch red ball etc. how can check if have tapped right ball according choiceball. can implement score board keep score. thanks :) class gamescene: skscene { var choiceball = skshapenode(circleofradius: 50) var blueball = skshapenode(circleofradius: 50) var greenball = skshapenode(circleofradius: 50) var yellowball = skshapenode(circleofradius: 50) var redball = skshapenode(circleofradius: 50) var array = [skcolor(red: 0.62, green: 0.07, blue: 0.04, alpha: 1), skcolor(red: 0, green: 0.6, blue: 0.8, alpha: 1), skcolor(red: 0, green: 0.69, blue: 0.1, alpha: 1), skcolor(red: 0.93, green: 0.93, blue: 0, alpha: 1)] override func didmovetoview(view: skview) { choiceball.position = cgpointmake(self.frame.size.width / 2, self.frame.size.height

How to send multiple modified messages to one endpoint in camel? -

in application query service based on given data structure identification numbers. each returned identification number want sent mail message based on query data enriched identification number same recipient: from("direct:querysource") .enrich("direct:executequeryids", new idwithdataaggregator()) // here stuck - want send original received message // querysource n (executequeryids) times enrich iterating // on executequeryids result .to("smtp://...") .end() i tried split messages using split based on message header, inside split obtian splitted header value body, not original message. using split call aggregator second parameter neither worked well, because second exchange null . i experimented loop constructs, feel there should more convenient , idomatic way of doing it. thanks in advance! if want turn single message multiple messages still want use splitter. want this: from(start) .split(). method(splitbean.class, "splitm

ruby - Rails - Heroku error, nothing in logs, works locally -

i've made minor modifications rails app , 1 route works locally , raises error on heroku . this simple route directs ' new ' of controller . everything works fine locally, in prod: raise heroku error we're sorry, went wrong there nothing in logs, i've put rails.logger.warn in method, nothing appears . how possible specific error in production heroku not in local? can same process in local see error , fix it? you should try reproduce issue locally fetching data local database. first make sure current branch (most master) same heroku master app deployed. then pull database local , try re same steps. follow commands capture latest snapshot , store database local. heroku pg:backups capture --app sushi curl -o latest.dump `heroku pg:backups public-url --app sushi` rake db:drop db:create pg_restore --verbose --clean --no-acl --no-owner [-u user_name] -d database_name latest.dump https://devcenter.heroku.com/articles/heroku-postgres

java - How to apply Blink animation or effect on old android devices? -

i used code posted below blink animation, code still buggy , if user click 2 times on button, blink becomes faster. stopping thread not effective. boolean mythreadalive = false; private void blink(final view txt){ if(mybestthread != null){ if(!mythreadalive) { mythreadalive = false; if (mybestthread.isalive()) { mybestthread.interrupt(); try { mybestthread.join(); } catch (interruptedexception e) { } } } } mybestthread = new thread(new runnable() { @override public void run() { final int timetoblink = 1000; //in milissegunds mythreadalive= true; while(mythreadalive) { try {thread.sleep(timetoblink);}catch(exception e){} handler.post(new runnable() { @override public void run() { if (

objective c - Framework for pairing iOS and Mac apps over WiFi -

i have mac app (not suitable app store) i'd write little remote control ios app (to used on local wifi). big issue initial pairing of 2 apps. absolutely not want allow unsecured traffic between two, i'm hoping not have bootstrap huge pile of code them securely talking. know of framework, or sample code, sort of thing?

rename - Renaming a file name to exclude the first couple parts Powershell -

i have on million files such: first_last_mi_dob_ , lots more information. there way can run rename script can remove first, last, mi, , dob file name, keep stuff after that? thank you. edited answer question: parse , switch elements of folder names using powershell # path folder $path = '.\' # regex match "id_000000..." $regex = 'id_\d+.*$' # objects in path get-childitem -path $path | # select objects not directory , name matches regex where-object {!$_.psiscontainer -and $_.name -match $regex} | # each such object foreach-object { # rename object rename-item -path $_.fullname -newname $matches[0] } update #1 : seems need write regex match required part of name , use in rename document. assuming file name x-john_doe_._dob_01-11-1990_m_id_000000_titleofdocument_dateofdocument_docpagenu‌​mber_ , here couple of examples: regex ( https://regex101.com/r/gi0fz2/2 ): (id_\d+.*)$ - m

matlab - Limit output of PID controller by second variable in Simulink -

Image
i have problem need limit output of pid controller, needs "monitor" 2 values. i have swinging system, pendulum swinging angle phi. want reduce swinging other system, gyroscope. reduction proportional rate of precession angle (alpha)of gyroscope, phi_reduced = phi - a* alpha_dot, proportional gain. in ideal case monitor difference of phi , 0 error, , use pid controller determine torque controlling gyro angle. implemented shown below in image, , works charm there limiting factor: maximum precession (gyroscope) angle limited 150 degrees... @ moment, without limiting, maximum gyro angle 1500 degrees, problem. so have limit torque controls gyroscope limit not exceeded. how can without creating 2 pid controllers "fighting" each other (one increasing, 1 decreasing)? see image clarification for simple implementation of limits, saturation block, in am304s answer alright. should know do. saturating pid controllers can cause integral wind-up should cons

vba - Skipping a column when copying highlighted cells from one table to another in the same sheet on excel 2007? -

i have problem when copying highlighted cells table another, skip 1 column, don't know problem exactly here code: sub copycat() activesheet.unprotect password:="p@ssw0rd" dim lr long, long, j long dim c range j = 1 lr = range("a" & rows.count).end(xlup).row each c in worksheets("mb").range("a15:o" & lr) if c.interior.colorindex = 3 c.copy destination:=worksheets("mb").range("j" & j) j = j + 1 end if next c activesheet.protect password:="p@ssw0rd" end sub please me !!

assets pre compile every time i push to heroku rails? -

i deploying rails app on heroku server. , every time deploy heroku, assets pre compilation done. slows down deployment process. can me out on this. sure! you'll need create manifest.yml in your_app/pubilc/assets directory. the file can blank. ideally, precompile locally, deploys heroku faster. make sure committed manifest.yml file when you're pushing heroku. git add -f your_app/pubilc/assets/manifest.yml , git push heroku master should suffice.

angularjs - How to hide ng-message with timeout? -

i dont want ng-message keep showing until user enters valid input. want hide ng-message after 5 seconds on showing. i saw class toggle ng-active ng-inactive. now how can manually set ng-message inactive or hide after seconds? the @muller answer solved problem. it's temporary solution only. because if used more ng-message need manage of them. but options may go angularjs-toaster . angularjs toaster customized version of "toastr" non-blocking notification javascript library. i hope can see demo more clarifications . and son't worry integrations. don't need long time integrate this. need download files link bring above (js,css) , drag files main screen . that's all.

javascript - conflict in event.dataTransfer.setData -

the datatype in event.datatransfer.setdata conflicts in firefox , ie.'text/html' not supported in ie.so suppossed use 'text'.the problem firefox not support 'text'.it supports 'text/html' or 'html' alone.any solution fix issue? html: <div class="box" draggable="true"> <img src="drag icon.png" width="16" height="16"/> <header>b</header> <p> put me </p> </div> <div class="box" draggable="true"> <img src="drag icon.png" width="16" height="16"/> <header>c</header> <p> right </p> </div> <div class="box" draggable="true"> <img src="drag icon.png" width="16" height="16"/> <header>d</head

Android Gridview Selection not working -

when clicking icon in gridview, showing " clicked this". instead need go new page corresponding icon. here code mainactivity.java @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); gv=(gridview) findviewbyid(r.id.gridview1); gv.setadapter(new customadapter(this, prgmnamelist,prgmimages)); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.menu_main, menu); return true; } @override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent activity in androidmanifest.xml. int id = item.getitemid(); //noinspection simplifiableifstatement if (id == r.id.action_settings) { return true; } return super.onopt

c# - Calling a Javascript function from ASP.NET code-behind that is not inline JS -

i've found many examples of people calling inline js functions in html pages, i'm wondering if possible call js functions in own file. for example if have ~/scripts/mainjs.js house of our javascript functions, there way call functions in file c# code-behind? edit: preferably passing parameters js function try this string jsfunc = string.format("myfunction('{0}');", parametervalue); scriptmanager.registerstartupscript(this.page, page.gettype(), "myjsfn", jsfunc, true); write in aspx.cs file here myfunction function name , parametervalue argument.

ios - NSURLRequest produce different result than HTTP proxy client -

Image
i send same http message http proxy client , nsurlrequest + nsurlconnection , , different result. authentication request. http proxy authentication request accepted, sending app not. why? accepted means after redirection html contains no oops substring. let url = nsurl(string: "http://www.swisshttp.weact.ch/en/user/login") let request = nsmutableurlrequest(url: url) request.httpmethod = "post" request.setvalue("application/x-www-form-urlencoded", forhttpheaderfield: "content-type") let email2 = (viewcontroller!.email.text nsstring).stringbyreplacingoccurrencesofstring("@", withstring: "%40") let str = "name=\(email2)&pass=\(viewcontroller!.password.text)&form_id=user_login" nsstring let d = str.datausingencoding(nsutf8stringencoding) if let d2 = d { request.httpbody = d2 let urlconnection = nsurlconnection(request: request, delegate: self) } update i have put @teamnorge's code below

html - border / frame overlay blocks content -

Image
i want have fixed frame , content flowing behind it. did border property. problem content underneath layer border can't accessed. visible of course can't select text (no problem) or click links (big problem). my question how can make content accessible still keep frame stay on top. i'm not pro, it's personal portfolio page , hoping keep simple , clean html5/css3. if not possible pure css might tolerate bit of javascrip. maybe "clip-path", "mask" or maybe frame not made "border" instead svg rectangle without fill? smart rearrangement of html and/or z-indexes? tried hole day couldn't work. i made graphic representation illustrate problem: here code: * { box-sizing: border-box; } html, body { margin: 0; } body{ font-family: sans-serif; font-weight: bolder; } .max, .content{ overflow: hidden; } .max{ position: fixed; border: 1em solid black; top: 2em; right: 2em; bottom: 2em; left:

node.js - What is the best way to loop bluebird promises -

now i've working on nodejs , sequelize query , process database data. i've call findall table1 , want query each rows apply data table2 want add data array before send output, did this var last_promise; var output_results = {}; table1model.findall() .then(function(results1) { (var = 0; < results1.length; ++i) { var result1 = results1[i]; output_results[result1.id] = result1; var add_promise = table2model .create({ id_from_table1: result1.id, data_from_table1: result1.data }); .then(function(result2) { output_results[result2.id_from_table1].data2 = result2; }); if (last_promise) { last_promise.then(function() { return add_promise; }); } else { last_promise = add_promise; } } } } last_promise.then(functi

getting parameter value of json object in java -

i have jsonobject : {"result":[{"active":"true"}]} how can value of active? you can use jackson objectmapper mapper = new objectmapper(); map<string, object> parsedmap = mapper.readvalue(jsonstring, new typereference<hashmap<string, object>>() { }); we map key value pairs. input map<list<map<string,string>>> . "active", can use parsedmap.get("result").get(0).get("active") (note: pseudo code)

Maven Liquibase plugin executing previous changesets -

i able apply latest changes liquibase controlled database via maven. pom contains: <plugin> <groupid>org.liquibase</groupid> <artifactid>liquibase-maven-plugin</artifactid> <version>3.3.5</version> <dependencies> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> <version>5.1.23</version> </dependency> </dependencies> <configuration> <changelogfile>src/main/resources/config/database/db-changelog-master.xml</ch

linux - Strange Behaviour of [SED] when put in shell script -

when doing sed 1s/#text_to_be_replaced#/replacement_string/ filename then output expected when put in shell file , linenumber=1 sed $linenumbers/#text_to_be_replaced#/replacement_string/ filename then doesn't work expected replacement_string gets inserted 1 line above text_to_be_replaced . why happening ? it should be: sed "${linenumber}s/text_to_be_replaced/replacement_string/" filename

javascript - jQuery Datatables scroll to bottom when a row is added -

i'd datatable scroll bottom whenever row added. have tried multiple fixes problem, none of them work. tested solutions: how load table in datatables , have scroll last record automatically on load jquery datatable auto scroll bottom on load among others... i think separates case others, using datatable d capitalized. anyway, here current code: var table = $('#example').datatable({ "createdrow": function( row, data, dataindex ) { $(row).attr('id', 'row-' + dataindex); }, "bpaginate": false, "blengthchange": false, "bfilter": false, "binfo": false, "bautowidth": false, "scrolly": $(window).height()/1.5, "scrollcollapse": true, "paging": false, }); for(var = 1; <= 20; i++){ table.row.add([ i, &

xpath - Scrapy - Get all data within selector -

if have html in response looks like: <body> body text <div> div text </div> </body> if response.xpath('//body/text()').extract() [body text] i want everything inside <body> including tags i.e. whole thing: body text <div> div text </div> how can accomplish that? thank you. try it: response.xpath('//body/node()/text()') or if want tags too: response.xpath('//body/node()')

University Timetable Scheduling Project using Genetic Algorithm (JAVA) -

personal info: hello everyone, i'm computer science student; (unfortunately) has work on np-complete problem final year project. not experienced in programming beyond assignments , things learned in university. apologies ignorant questions might ask. university timetable scheduling project using genetic algorithm: this topic final year project of university. have gathered information needed , wrote proposal , progress report aware of fact that, topic np-complete. goal of project not create golden timetable, optimal , no problem instead have make sure acceptable , not break of rules. regarding methodology , way want create application, have decided use 2 main artificial intelligence techniques solve problem; genetic algorithm , constraint satisfaction. came rules , divided them in 2 main groups; soft constraints , hard constraints. algorithm should work way: assuming have our inputs (classrooms , capacities, subject names, lecturers , amount of students signed the

c# - File.Delete on bitmap doesn't work because the file is being used by another process (I used bitmap.Dispose();) -

i'm creating windows forms application in c#. i have buttons on form , used backgroundimage property set bitmap images on them. i wanted change images dynamiclly so: i used using (bitmap = new bitmap...) , saved new bitmap picture. i assign new bitmap on button. then, tried delete old bitmap calling dispose() , system.io.file.delete(nametodelete) ; the problem: file.delete function throws exception: "file being used process" , can't delete it. i tried calling gc.collect() , assigning bitmap null didn't work. the "solution" find call thread.sleep(2) before deleting, it's patch , doesn't work each time. here code (layerpics[z] array holds bitmaps, 1 each button): string name = "new name"; bitmap bitmap; using (bitmap = new bitmap(x, y)) { form.drawtobitmap(bitmap, new rectangle(0, 0, bitmap.width, bitmap.height)); bitmap.save(name); button.backgroundimagelayout = imagelayout.stretch; button

node.js - Do I run '''grunt build''' after installing a bower component -

i'm pretty new grunt & npm etc i'll explain question best can. i've got local wordpress project running foundationpress theme. have grunt running etc. i have installed foundation datepicker via 'bower'. terminal looks went , foundation datepicker files in bower_components/ folder. however i'm not sure if should changing directory bower_components/foundation-datepicker/ folder , running 'grunt build' command in directory "install" datepicker? folder have gruntfile.js in it. after installing foundation datepicker did run 'grunt build', in theme folder, don't know if of picked newly downloaded foundation datepicker , installed/built too. it on github page towards bottom should 'grunt build'. please see here again: https://github.com/najlepsiwebdesigner/foundation-datepicker thanks guys. daniel. i can't see .bowerrc file in project in .bowerrc file, should have path bower_components/fold

performing operations after uploading a CSV file in shiny [R] -

i have made upload button via uploading .csv file[dataset] in shiny. dataframe <- data.frame(a=c(2,3,4,5,6,7,3,7,8,9,2),b=c(3,7,8,9,2,1,2,3,4,5,6),c=c(1,1,1,2,2,1,1,1,1,2,2)) in ui.r : fileinput('datafile', 'choose csv file', accept=c('csv', 'comma-separated-values','.csv')), actionbutton("uploaddata", "upload"), i want perform operations such "a+b" , "a-b" on dataset , add new column in dataset of actionbutton. problem 1: tried use tableoutput() function display data in shinyapp displaying data dataframe in r console instead. in server.r: data <- dataframe %>% group_by(c) %>% mutate(a) %>% mutate(b) %>% mutate(add = (a+b)) %>% mutate(sub = (a-b)) problem 2: want use data input making ggplots of (add, sub) you this: ui.r library(shiny) shinyui(fluidpage( fileinput('datafile', 'choose csv file', accept=c

ios - How to access custom view properties after initialize -

Image
i'm targeting ios 8+. i have form used in more 1 place. decided create custom view define various "form" text fields. i have built xib, , uiview subclass contains outlets each textfield. the view composed of background image , scroll form fields on it. now, first obstacle was: need have custom view in container may or may not have navigation bar. made me create constraint outlet update value push down scroller view. way i'd have whole image in frame, top being behind navbar , scroller bellow nav bar). here's manual drawing understanding problem. it's possible i'm making lot of mess , confusion on way solve this. :) the problem is: after awakefromnib runs have no access constraint property. noticed same thing happens textfields outlets. so, how can access custom view's properties when instantiate them programatically? something like: controller: let customview = signupview(frame: f) view.addsubview(customview) customview.push

jquery - Datatables column filter checkbox not working with Ajax -

when bind datatables ajax datatables column filter checkbox disappear. here code $('#table1').datatable({ "ajaxsource": "js/group.json" }).columnfilter({ splaceholder: "head:after", aocolumns: [ { type: "checkbox", values: null }, { type: "checkbox", values: null }, { type: "checkbox", values: null }, { type: "checkbox", values: null }, { type: "checkbox", values: null }, { type: "checkbox", values: null } ] }); without knowing going on - know comment " it not working when data ajax " - , therefore assuming else working great, no news news etc; , taken notice of columnfilter being old buggy plugin built datatables 1.9.x +100 open issues, last fix 1½ year ago - simple matter of javascript asynchronicity. when using chaining $('#table1').datatable({ //some ajax stuff }).columnfilte

meteor - How to create different two head.html using iron-router -

i writing project in meteor, there client side , admin , js, css files different need create different head.html them, how can import "head"s elements (script, style etc.) using iron-router? i preface saying if you're loading css , js in meteor e.g.: <link href="styles.css" rel="stylesheet" /> <script src="script.js"></script> you're doing wrong. meteor automatically loads css , js put in project directory. if need dynamically load css or js external sources, see https://stackoverflow.com/a/14521217/2723753 . but assuming know that, there's not easy way you're asking. it's easiest create 2 apps , create packages can share of code/assets between apps. if want 2 distinct iron router layouts/styles within 1 app, way i've done use modified version of london:body-class package sets layout name , route name classes on html , body elements. then in css can refer e.g. body.adminlayout

localization - Translate Magento Shop Categories -

i want translate categories in magento didn't found way add products multiple times , set different store view time consuming if have lots of categories , lots of site views. any short way translate categories? yeah, 1 one of these things can done without extensions not intuitive. had check video youtube solution, is: go catalog->manage categories. select category want translate. assuming category applies whole store, store views included. then @ top left box select store view want display category in different language, i.e. "english". now general information tab of category shows checkboxes option "use default value". uncheck checkbox field "name" , change name translated text. save category. in case find difficult follow instructions check video: https://www.youtube.com/watch?v=vppfno14jfe

How to use Multithreading in Python -

i need check whether url's responding or not.if url(s) not responding need display that.here don't want wait 1 one checking , display.for reason want use multi threading concept.here's how use multi-threading make use of code in efficient way. import threading,urllib2 import time,pymongo,smtplib urllib2 import urlopen,urlerror socket import socket threading import thread res = {"ftp":'ftp://ftp.funet.fi/pub/standards/rfc/rfc959.txt',"tcp":'devio.us:22',"smtp":'http://smtp.gmail.com',"http":"http://www.amazon.com"} def allurls(): try: if 'http' in res.keys(): http_test(res["http"]) get_threads(res["http"]) if 'tcp' in res.keys(): tcp_test(res["tcp"]) if 'ftp' in res.keys(): ftp_test(res["ftp"]) if 'smtp' in res.keys(): smtp_test(re

Error while using Multiprocessing.Pool in python -

i tried options not able find issue below code, works when call sub self.processxmlfile(xml_file) throws below error multiprocessing when print result_list: cpickle.picklingerror: can't pickle <type 'instancemethod'>: attribute lookup __builtin__.instancemethod failed pool = multiprocessing.pool(processes=4) result_list = [] xml_file in os.listdir(self.local_folder): result_list.append(pool.apply_async(self.processxmlfile, args = (xml_file,))) pool.close() pool.join()

scala - HList filtered by foldRight is not providing instances -

i'm using librarydependencies += "com.chuusai" %% "shapeless" % "2.2.4" currently have model hlist types like sealed trait section case class header(...) extends section case class customer(...) extends section case class supplier(...) extends section case class tech(...) extends section type contractview = header :: (customer :: supplier :: hnil) :: tech :: hnil in user code, i'd filter technical sections not supposed view using foldright proposed in answer : trait collectallrf extends poly2 { implicit def atany[l <: hlist, x] = at[x, l](_ :: _) } object collectvisrf extends collectallrf { implicit def atinvis[l <: hlist, s <: section : invisiblesection] = at[s, l]((_, l) => l) } for example there defined: trait invisiblesection[s <: section] implicit object _techisinvisible extends invisiblesection[tech] fold working correctly, not use following filter or map on object, example code: val filtered = view.