Posts

Showing posts from July, 2013

passing javascript variable to html5 video source -

i want pass javascript variable src html5 video video changes dynamically based on js variable value. not able achieve <script type="text/javascript"> var path = "/api/videos/mp4/"; var filename = '@viewbag.filename'; var fullpath = path.concat(filename); document.getelementbyid('fullpath1').src = fullpath.tostring(); </script> <p><script type="text/javascript">document.write(fullpath)</script></p> <video width="480" height="320" controls="controls" autoplay="autoplay"> <source src="fullpath1" type="video/mp4"> </video> please me working. thanks! you looking element id document.getelementbyid('fullpath1').src = fullpath.tostring(); but haven't yet define id: <source src="fullpath1" type="video/mp4"> ...

node.js - Message: Unexpected string , while migrating model to mysql db in strongloop -

i trying migrate model class mysql db strongloop tool in node.js loopback framework. when click migrate button showing error oops! wrong unexpected string message: unexpected string request: /workspace/api/datasourcedefinitions/server.mysql/autoupdate status: 500 my model class example { "name": "media", "base": "persistedmodel", "properties": { "path": { "type": "string" }, "filename": { "type": "string" }, "createdat": { "type": "date", "required": true }, "updatedat": { "type": "date", "required": true } }, "validations": [], "relations": {}, "acls": [], "methods": {} } db source file { "db": { "name": "db", ...

c# - What is a good .Net RefEdit control to use with ExcelDna? -

i using exceldna , c# build suite of tools. part of forms i'd want user select cells/ranges workbook. i've got application.inputbox route working...but doesn't cool... i haven't read many things excel's refedit control, , see many have in past written workarounds, in (shudder) vba or vb.net. however, none of these seem recent... best approach/control refedit functionality on form run via exceldna (if applicable)? the refedit sample project of github explores different ways of dealing threading when showing form excel add-in, main issue making refedit control .net add-in. check page links various other implementations: https://github.com/excel-dna/exceldna/wiki/links-about-refedit

How to access a variable stored in a function in R -

one of features of r i've been working lately (thanks r.cache ) ability of functions declare other functions. in particular, when 1 this, 1 able have variables inherent part of resulting function. for example: functionbuilder <- function(wordtosay) { function() { print(wordtosay) } } can build function so: functiontorun <- functionbuilder("hello nested world") then functiontorun() result in "hello nested world" . if @ functiontorun (i.e., print it), see code matches functionbuilder . see functiontorun has environment. how can 1 access value of wordtosay stored inside of functiontorun ? at first tried: get("wordtosay",env=functiontorun) ... functiontorun isn't environment , can't transformed environment via as.environment. similarly, because functiontorun isn't environment, can't attach or use with . i found environment accessor function , set environments, in analgous way how names get...

openerp - Installing Magento connector on Open ERP 9 -

Image
from last few days exploring odoo , magento connector. have configured odoo 9 on ubuntu 14 finding difficult add magento connector module ( https://github.com/oca/connector-magento ). following documentation http://odoo-magento-connector.com/guides/installation_guide.html instalation , configuration looks bit old , not updated odoo9 also put magento connector plugin inside addons folder no new module getting display in odoo admin (inside aaps/module section) after updating module list. do need update configuration file see magento connector module in module list ? can see in backend

javascript - How to make bottle appear to be standing still -

i have created bottle label inside of div automatically scrolls , forth div scrolls bottle , label appear rotating. below demo along code in jsfiddle. https://jsfiddle.net/pkfxqmls/ <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>bottle demo</title> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <style type="text/css"> body { margin: 0; padding: 0; height: 100%; } #coke { width: 510px; height: 500px; overflow: auto; padding-right: 100px; padd...

image processing - quadprog in MATLAB taking lot of time -

my goal classify image using multi class linear svm (with out kernel). write own svm classifier i using matlab , have trained linear svm using image sets provided. i have around 20 classes, 5 images in each class (total of 100 images) , using one-versus-all strategy. each image (112,92) matrix. means 112*92=10304 values. i using quadprog(h,f,a,c) solve quadratic equation (y=w'x+b) in svm. 1 call quadprog returns w vector of size 10304 1 image. means have call quadprog 100 times. the problem 1 quadprog call takes 35 secs executed. means 100 images take 3500 secs. might due large size of vectors , matrices involved. i want reduce execution time of quadprog . there way it? first of all, when classification using svm, extract feature (like hog) of image, dimensionality of space on svm has operate gets reduced. using raw pixel values, generates 10304-d vector. not good. use standard feature. secondly, not call quadprog 100 times. call once. concept b...

Find a delimiter of csv or text files in c# -

i want find delimiter being used separate columns in csv or text files. i using textfieldparser class read files. below code, string path = @"c:\abc.csv"; datatable dt = new datatable(); if (file.exists(path)) { using (microsoft.visualbasic.fileio.textfieldparser parser = new microsoft.visualbasic.fileio.textfieldparser(path)) { parser.textfieldtype = fieldtype.delimited; if (path.contains(".txt")) { parser.setdelimiters("|"); } else { parser.setdelimiters(","); } parser.hasfieldsenclosedinquotes = true; bool firstline = true; while (!parser.endofdata) { string[] fields = parser.readfields(); if (firstline) { foreach (var val in fields) { dt.columns.add(val); } firstline = false; ...

java - toString() behavior of object when not overridden -

if tostring() method of class not overridden (or overloaded), , method returns string defined in class, happens when pass instance of class string expected? if class extends object , result of object#tostring() , called. if class extends else, first #tostring in inheritance path.

c++ - Result from operator+ to be floating-point if either lhs or rhs object is floating-point -

so have written simple template class stores array. i'm trying overload + operator sums 2 objects' arrays element element. works fine, here problem. i want if either lhs or rhs (or both) object of floating-point type, result floating-point object. for example: testclass({1, 2, 3}) + testclass({2.2, 3.3, 1.1}) return testclass<double> object. i managed work if rhs object double, can't right when lhs double. this code have written far: #include <iostream> #include <initializer_list> template<class t> class testclass { public: t data[4]; public: testclass() {} testclass(const std::initializer_list<t> &ilist) { short = 0; (const t &el : ilist) this->data[i++] = el; } auto &operator[](const short &i) { return this->data[i]; } //so when called return object same //type rhs object template<class type_t> auto operator+(const testclass<type_t...

wso2 - WSO2IS logging client IP into file wso2carbon.log -

i have environment wso2is behind balancer , client ip logged file wso2carbon.log beyond http_access.log file. on application log need manually parse value log. shall ip address request. may add thread local , configure pattern layout[5]. string ipaddress = request.getheader("x-forwarded-for"); if (ipaddress == null) { ipaddress = request.getremoteaddr(); } you may use request header "x-forwarded-for"[1]. <valve classname="org.apache.catalina.valves.accesslogvalve" directory="${carbon.home}/repository/logs"                prefix="http_access_management_console_" suffix=".log"                pattern="%{x-forwarded-for}i %h %l %u %t &quot;%r&quot; %s %b &quot;%{referer}i&quot; &quot;%{user-agent}i&quot;" /> [2] [1]. https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#proxies_support [2]. https://docs.wso2.com/display/esb490/access+logs ...

go - Safari reloading web page 3 times during redirect -

for life of me thought going mad because far see was/is ok code in regards. out of exasperation decided try application in browser , found in chrome , ff app works fine, in safari reason refreshes page 3 times. i've tried resetting safari , turning off extensions in case issue same thing happens. i'm not sure if quirk setup, or potentially code i've pasted here below have other eyes @ it. if more code/context required, please let me know. in essence takes user index page, movie page , repeats process 3 times. func moviehandler(w http.responsewriter, r *http.request) { command := r.url.query().get("command") film := r.url.query().get("movie") if pagedata.player.playing == false { if film == "" { log.println("no film selected") http.redirect(w, r, "/", http.statusfound) return } err := pagedata.player.startfilm(film) if err != nil { ...

html - Make bootstrap columns fill screen width in grid -

here link bootstrap code in demo can see cells resize , stack nicely (use full screen best effect). however, cells don't fill entire screen width!! how have identical setup, cells cover entirety of screen horizontally?? replace main wrapper class container container-fluid , fill width:100%

c# - Control.Invoke from same thread where the form is running -

in c#, there problem using control.invoke change property of control same thread form running? i know best using control.property = value , i'd know consequences of using control.invoke instead. example: using this: public partial class formmain : form { private void button1_click(object sender, eventargs e) { this.invoke(new delegate {label1.text = "hello"}); } } instead of this: public partial class formmain : form { private void button1_click(object sender, eventargs e) { label1.text = "hello"; } } this.invoke(new action( delegate() { label2.text = "test"; })); or this.invoke(new methodinvoker( delegate() { label2.text = "test"; }));

sql - PostgreSQL from E-R to correct trigger -

Image
i have e-r diagram: i've done sql translation, , have written relationship way: create domain origine varchar(6) default null check (value ='upload' or value = 'link'); create table progetto.utente ( id_utente varchar(4) check (id_utente ‘u%’), primary key (id_utente), username varchar(20) not null unique ); create index progetto.idx_utente_id_utente on progetto.utente (id_utente); create table progetto.bacheca ( id_bacheca varchar(4) check (id_bacheca ‘b%’), id_proprietario varchar(4) not null, primary key (id_bacheca), foreign key (id_proprietario) references progetto.utente (id_utente) on update cascade on delete cascade, titolo varchar(20) not null, n_follower int ); create table progetto.immagine ( id_img varchar(4) check (id_img ‘i%’), primary key (id_img), origine origine, descrizione varchar(20) default null, bacheca varchar(4) not null, foreign key (bacheca) references progetto.bacheca (id_bacheca) on update cascade on delete cascade, possessore ...

jquery - Enabled Adblock moves div up -

Image
my problem is, when enable adblock, "box_and_content" div moves behind navigation. when adblock disabled, looks now "box_and_content" should fixed margin-top, or this. it shouldn´t move when user has adblock. sorry eventual bad english , in advance. i checked site, should post codes. image not helpful enough. can not comment because not have enough reputation. the problem not "box_and_content" div . see alright when there "ad" because "ad" has margin-top value, inline style. , see problems when "ad" removed, because "box_and_content" not have "margin-top" value set same amount. solution: remove inline style ad. instead add padding-top or margin-top "#wrapper", value should same or more "nav" height visible. noticed using css @media. not forget change value there, when change height of "nav".

amazon web services - AWS Beanstalk Worker - Node.js Message format -

i'm in place aws. i'm figuring out how use worker app in elastic beanstalk. have express app set listen post. put message sql queue. in node, can trigger message. have not idea how @ payload. usual, seem left grasping aws trying glean basic of details documentation. if can give me pointers, appreciate it. i'm pasting json message body on aws sqs console @ point in time. have tried request.body , request.payload on node side - nothing. this request gets hit when data comes - it's pretty simply. should put log. i've tried request.body, request.params, 'undefined'. dumped out entire request object here, , i'm not seeing it. don't know it's supposed be, can't tell whether it's code, or it's not there. var stringify = require('json-stringify-safe'); function test(request, response, next) { mainlog.log("info",stringify(request)); respond_to_http_request(response, null, null);; } exports.test = test; ...

ios - Manage my certificates and provisioning profiles on developer page -

Image
i haven't logged in apple developer account half year. now, logged in https://developer.apple.com/ . i remember there used link named " ios dev center " can manage certificates & provisioning profiles . now, cannot find link more. can manage certificates & provisioning profile on developer page? go https://developer.apple.com click account (top right) fill credentials click 'certificates, ids & profiles'

javascript - Firefox and FCKeditor not rendering cftextarea - only on one computer -

i have 1 computer in our network not render cftextarea in firefox 41.0.2. firebug console shows following on particular computer; syntaxerror: missing } after function body fckeditorcode_gecko.js:108:329 referenceerror: fckconfig not defined fckconfig.js:27:1 referenceerror: fckbrowserinfo not defined fckeditor.html:125:1 referenceerror: fckconfig_loadpageconfig not defined fckeditor.html:164:1 referenceerror: fcktools not defined fckeditor.html:176:5 referenceerror: fck_contextmenu_init not defined fckeditor.html:195:1 referenceerror: fcklang not defined fckeditor.html:203:1 referenceerror: fckbrowserinfo not defined fckeditor.html:270:1 referenceerror: initializeapi not defined this not happen on other computers (all windows 7). i'm stumped! update: i can go through list of emails go out (in particular app) , after 3 records blank textarea. if hold down shift key , click on refresh icon (on url bar) textarea goes away. there kind of place holder because area text...

python - Advanced URLs in Django -

the task write 2 url patterns. the first 1 take single argument <path> , can url random depth: test/dorogi/ or test/foo/bar/as/deep/as/you/want the second 1 same first one, number in end. test/dorogi/1/ it talkes 2 arguments: <path> , <pk> . last 1 number. i made solution first pattern: url(r'^(?p<path>.*)/', mptt_urls.view(model='activities.models.category', view='activities.views.category', slug_field='slug'), name='activities'), but how make second 1 , prevent conflicts beteween them? it should like: url(r'^...', views.articledetailview.as_view(), name='article-detail'), just add second parameter regex first pattern: r'^(?p<path>.*)/(?p<pk>\d+)/$' but make sure put before first 1 in list of urls. (note should terminate pattern $, did above.)

.htaccess - How to add a slash or why it isn't added? -

i using bootstrap add accordion function jobs page on new website. works fine, when click view specific accordion display listing, url works this: website/jobs#developer , not this: website/jobs/#developer lot more professional on job boards , maintain have on our current site. i don't want have go every link distributed , remove slash. attaching have done in htaccess not sure affected it. please help! <ifmodule mod_rewrite.c> rewriteengine on errordocument 404 /views/errors/404.php rewriterule ^(jobs|jobs|jobs)$ views/jobs.php [l] </ifmodule> the rewrite rule not match trailing slash ^(jobs|jobs|jobs)$ this rewrite rule will not match url trailing slash, means: ^ # start of match jobs|jobs|jobs # 1 of these strings $ # end of match to have match urls trailing slash, needs in rewrite rule: rewriterule ^(jobs|jobs|jobs)/?$ ^ slash ^ 0 or 1 times - i.e. optional prof...

How do i setup jQuery footables to show the toggle -

as question suggests cannot seem configure foo-tables, in basic way - 3 columns, last column toggle shows detail row. markup code thus: $('.footable').footable({}); .footable { font-size: 88%; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <table class="table footable fw-labels" data-page-navigation=".pagination" data-page-size="6"> <thead> <tr> <th>action</th> <th data-toggle="true">details</th> <th data-hide="all">details</th> </tr> </thead> <tbody> <tr class="row-primary"> <td><span class="label label-primary">primary</span> </td> <td>this footable expandable <b class="text-primary">"primary"</b> row</td> ...

c - getting bad input from dirty buffer -

essentially have simulating tcp connection sockets , sending information between client , server between sockets. want use single buffer each file, unfortunately when writing, overwrites buffer getting bad/dirty string in line (b) buffer containing noexistshed , hed part, being remnant of established previous message written. @ first client prints connection status: established fine, later on, because of dirty buffer, printf in line (c), prints 1 , since "noexistshed" , "noexist" different. all buffers declared char buffer[1024]; . user , pass defined char user[80] , char pass[80] , (although seeking make these 2 single buffer). this problematic section of client: read(clientsocket, buffer, 1024); /*---- print received message ----*/ printf("connection status: %s\n", buffer); printf("please enter username:\n"); scanf ("%s", user); write(clientsocket, user, strlen(user)+1); read(clientsocket, buffer, 80);...

logging - Correlation Token for Service Fabric Actors and Services -

we started playing service fabric microservice platform , after having succesfully implemented our firsts "hello world" samples actor pattern, stateless/stateful services, web api (and on) moving looking solutions other core aspects auth/autz , application logging. i have doubt logging; in soa have designed till added "correlation token" services involved (often @ architectural level, automatically added header onto wcf, hidden developers) so, trying same service fabric. looking best solution let flow "correlation token" through actor/service calls, since haven't found out ready out-of-the-box, wondering if looking theoretically wrong. any suggestion out there? i've had lot of success using serilog , seq , using enricher add properties log messages. in services call servicelogger.createlogger(this) log enriched state service. if want correlation token should able add relatively easily, it's not i've done yet. i thin...

Problems with configuration of Bluemix server -

i'm trying increase timeouts in bluemix. i've set timeout settings 5 min. after 2 min of request got error: 500 error: failed establish backside connection how solve problem? "this particular message comes l1 load balancer in bluemix when fails timely response application tries route to. 1 of possible cause here because application not send response before load balancer times out, 2 minutes if memory serves me well." https://developer.ibm.com/answers/questions/25439/bluemix-500-error-failed-to-establish-a-backside-connection-on-web-service-call.html i open support ticket if need additional help.

ios - Assertion failure when delete rows in UITableView -

Image
when delete row in tableview,i getting following exception: *** assertion failure in -[uitableview _endcellanimationswithcontext:], /buildroot/library/caches/com.apple.xbs/sources/uikit_sim/uikit-3512.60.7/uitableview.m:1716 and here's part of code: [self.feedlistview.tableview beginupdates]; [self.feedlistview.tableview deleterowsatindexpaths:@[ atindexpath ] withrowanimation:uitableviewrowanimationfade]; [self.feedlistview.tableview endupdates]; and screenshot: any appreciated. thanks you need remove feedtodelete self.allfeeds: [self.feedlistview.tableview beginupdates]; nsmutablearray *array = [self.allfeeds mutablecopy]; [array removeobject:feedtodelete]; self.allfeeds = array; [self.feedlistview.tableview deleterowsatindexpaths:@[ atindexpath ] withrowanimation:uitableviewrowanimationfade]; [self.feedlistview.tableview endupdates];

How to Create a Database in Spark SQL -

how create database or multiple databases in sparksql. executing sql spark-sql cli. query in hive create database sample_db not work here. have hadoop 2.7 , spark 1.6 installed on system. spark.sql("create database test") //fetch metadata data catalog. database name listed here spark.catalog.listdatabases.show(false)

How to refactor comparison loops in my excel vba code for speed? -

i new excel vba , not have experience. have 2 worksheets of data compare , if value matches copy , paste second worksheet. use loops compare every row , wondering if there better way this? using brute force , hoping there way program not run long. (i repeat block of code on different sheets 13 times). code consolidating information if meets conditions. below code. sub consolidate(z) sheets(z).range("b1:axh100").delete '''deletes former values''' = 1 30 x = 1 500 if isempty(sheets("sheet1").cells(x, 13)) 'if cell value empty skip it' = 1 else: if sheets("sheet1").cells(x, 18) = sheets(z).cells(1, 1) 'check see if value same' if sheets("sheet1").cells(x, 13) = sheets(z).cells(i, 1) 'check see if value same' sheets("sheet1").cells(x, 15).copy 'copy value' sheets(z).select 'select secon...

java - Android getRelativeTimeSpanString flags not working in other languages than English? -

i'm trying use android helper method dateutils : public static charsequence getrelativetimespanstring (long time, long now, long minresolution, int flags) in documentation : can use format_abbrev_relative flag use abbreviated relative times, "42 mins ago". but can't find way make format_abbrev_relative work... "42 minutes ago", string never abbreviated. here code : dateutils.getrelativetimespanstring( message.getcreationdatetime().gettime(), system.currenttimemillis(), dateutils.minute_in_millis, dateutils.format_abbrev_relative ) can please tell me i'm doing wrong ? thank in advance. edit : in fact, found out working when phone in english, not in french, "i y 42 minutes", long. know solution work on multiple languages ? what's device language setting? i'm using english (united states) , following code "42 mins ago" dateutils.getrelativetimespanstring( system.curr...

How to upload Xcode Project including CocoaPods to the App Store -

i use cocoapods in xcode project , want how upload xcode project app store. before using cocoapods uploading xcode project there xcode workspace. should upload workspace or project? once have cocoapods running in project, should use .xcworkspace . goes opening application edit code way though deploying application. you build, run , archive single project.

c# - Read string value from registry but the result contains some weird characters -

i'm reading string values registry using registry.getvalue , result seems have 'invisible' characters don't see registry editor. for example, registry.getvalue returns "london\0j" expected "london" , , in registry editor can see value "london" , there doesn't seem @ end of string. if export key .reg file shows "london" . don't have permission write registry can't test importing .reg file. apply string.trim result doesn't work either. what "\0j" ? edit: code read key value var registryvalue = registry.getvalue(@"hkey_local_machine\system\\currentcontrolset\\services\\netlogon\\parameters", "dynamicsitename", string.empty); the exported .reg file: windows registry editor version 5.00 [hkey_local_machine\system\currentcontrolset\services\netlogon\parameters] "dynamicsitename"="london" as can see in reference sourc...

Optional parameter with UML class diagram -

is there official syntax specifying optional parameter of method in uml class type diagram? for example, have method: public function abc( $arg = 0) { ... return void; } how indicate $arg optional parameter , default value? uml 2.5 has following definition parameterlist <parameter-list> list of parameters of operation in following format: <parameter-list> ::= <parameter> [‘,’<parameter>]* <parameter> ::= [<direction>] <parameter-name> ‘:’ <type-expression> [‘[‘<multiplicity>’]’] [‘=’ <default>] [‘{‘ <parm-property> [‘,’ <parm-property>]* ‘}’] where: <direction> ::= ‘in’ | ‘out’ | ‘inout’ (defaults ‘in’ if omitted). <parameter-name> name of parameter. <type-expression> expression specifies type of parameter. <multiplicity> multiplicity of parameter. (see multiplicityelement – sub clause 7.5). <default> expression defines val...

android - Stack up views in RecyclerView -

Image
i'm little bit confuse. had refactor old code, , i've ended place hundreds of views need stack on each other adding relativelayout with parentview.addview(m_view, 0); which kinda sad. wanted rewrite recyclerview elements, instantly faced problem of order. can't find examples on how it, maybe google incorrect or smth. i've tried write own layoutmanager , couldn't find obvious way achieve goal. is there maybe way? or it's not hard order childs in recylcerview in relativelayout ? as suggested in comments, i've added image see how want as can see views lying on each other, that's want achieve i refer use library. swipestack : simple, customizable , easy use swipeable view stack android.

java - Display omitted versions in maven dependency:tree? -

Image
in eclipse, when go maven dependency hierarchy page, output states conflicts caused versions omitted: however, if use dependency:tree , that's omitted , see evrsions used: | +- commons-httpclient:commons-httpclient:jar:3.1:compile | +- commons-codec:commons-codec:jar:1.4:compile | +- commons-io:commons-io:jar:2.4:compile | +- commons-net:commons-net:jar:3.1:compile | +- javax.servlet:servlet-api:jar:2.5:compile and later on referenced versions... +- commons-collections:commons-collections:jar:3.1:compile is there way dependency:tree output versions omitted conflict? thanks! yes, can have omitted artifacts setting verbose attribute true : whether include omitted nodes in serialized dependency tree. this attribute defaults false . on command line, have mvn dependency:tree -dverbose=true

scala - spray json attribute with special char -

i have json attribute name has special char. trying parse spray json. below code how can attribute name in json @xml:lang parsed case class. import spray.json._ import defaultjsonprotocol._ object specialcharinname extends app { case class person(name: string, `@xml:lang`: string) val json = """ {"name":"myname", "@xml:lang":"us"} """ object personprotocol extends defaultjsonprotocol { implicit val personformat = jsonformat2(person) } import personprotocol._ val person = json.parsejson val personclass = person.convertto[person] println(personclass) } the code above throws exception below [error] (run-main-0) spray.json.deserializationexception: object missing required member '@xml$colonlang' spray.json.deserializationexception: object missing required member '@xml$colonlang' @ spray.json.package$.deserializationerror(package.scala:23) @ spray.json.productformats$cl...

java - return strings with concatination with the use of for loop -

i'm trying return value of ?,?,? when executing main function. however, ?, answer. don't want use system.out.println (although job) because want return values function. first return works want in second part, not sure how concatenate 2 returns , loop because useless after i've change println return public static void main(string[] args) { scanner kb = new scanner(system.in); r r = new r(); system.out.println(r.func(3)); } public static string func(int size) { if(size == 1) return "?"; else { (int = 1; < size; i++) { return "?,"; } return "?"; } } editted code little bit, trying use return statements within loop. have understand once return statement called, specified value automatically taken out of function. cannot use multiple versions of this. try code below , see if works. ive made string, , added "?," each time needs to. public static void main(s...

node.js - How to provide different data to different users from a NodeJS web server? -

we building website visualizing large sets of data. datasets loaded on server (nodejs , express) using crossfilter.js , exposing different endpoints data sent website visualizations getting built. so far server able provide visualizations dataset loaded when server starts. changing dataset, server needs restarted. trying allow user change dataset visualizing. problem don't know best approach. necesary steps next ones: the user provides new dataset the server loading dataset without altering datasets other users using the server able provide each user right dataset. basically, our uncertainty how load multiple datasets memory. server might become overloaded. any advises? you have couple of choices here memory management. can allocate enough memory everything, , overflow swap. or, more complicated, store files on disk, , have datasets follow cache pattern. using fixed size lru cache allow many datasets have disk space, caveat returning users may have wait...

python - Dictionary and List -

while reading through file convert given data in format of key , value. (value age of person) for example if file has data: 20120101,56years 20120102,45years 20120103,67years 20120104,38years .. , on until 20120131,21years . i create dictionary , make date key ( in case let's line 1 , key 20120101 ) , make value 56years . when print out, separate dictionary every date. example: {'20120101': ['56years']} {'20120102': ['45years']} {'20120103': ['67years']} {'20120104': ['38years']} since see every dictionary has same starting values 201201 , how can make single dictionary has 1 key 201201 , values appended in list? example: {'201201': ['56years', '45years', '67years', '38years'...]} you can use collections.defaultdict from collections import defaultdict d = defaultdict(list) now, when key k , value v d[k].append(v) after adding first key,va...

What is the purpose of having a class inside a constructor? Java -

what purpose of having board class inside of computer class constructor be? called in programming? how use assign variable, arrays, methods, integers, etc? board board = new board(); player computer = new player(board, "x"); well, information you've given.. here's best explanation. "player" class constructor allow "board" come in , set up. "board" class reliant on class , need object for. instance, object "board" contains constructor well. inside "boards" constructor might contain "variables, arrays, method integers, etc.", "players" constructor could. "computer" going inherit object "board" if it's declared in constructor. although, in situation sense it's passed parameter it's going used set 1 of variables within "player" constructor. call "inheritance", "sending object parameter", object-oriented programming.

r - How to format the title in ggplot2 -

Image
i have data name "catch" , observations are: x y 0.50 3.66 0.63 3.95 0.77 5.82 0.92 7.38 1.07 8.58 1.24 9.31 1.42 9.52 1.61 9.52 1.81 9.58 2.04 9.54 2.29 9.56 2.56 9.44 2.87 9.07 3.21 8.61 3.61 7.92 4.09 7.04 4.67 5.93 5.43 4.52 6.52 2.90 8.43 0.63 i used code in r: library(ggplot2) ccplot <- ggplot(data = catch, aes(x = x, y = y)) + geom_point(shape = 19, colour = "#0072b2") ccplot <- ccplot + geom_abline(intercept = 14.58, slope = -1.85, col = "#d55e00") ccplot2 <- ccplot + xlab("time") + ylab(expression(paste("ln[c(l1, l2)]/(", delta, "t)"))) ccplot2 + ggtitle(expression(paste("length-converted catch curve\n(for z=1.85; m(at 23"*degree*"c)=0.69; f=1.16; e=0.63"), hjust = 0)) the problem arises when printed plot have large (distant) space between number 23 , degree symbol. how format title space gone? or there other method accomplish proper ti...

c# - how to return pdf file result to ajax jquery and display it in new tab of browser -

i want generate pdf using rdlc. want call using ajax, returns correct data dont know how show in browser. public class customercontroller { //render report public fileresult printpofile(customerinputmodel model) { //file generation logic renderedbytes = localreport.render( reporttype, deviceinfo, out mimetype, out encoding, out filenameextension, out streams, out warnings); //filestream fs = new filestream(filepath, filemode.create); using (filestream fs = new filestream(server.mappath("~/download/") + filename + ".pdf", filemode.create)) { fs.write(renderedbytes, 0, renderedbytes.length); } response.clearheaders(); response.clearcontent(); response.buffer = true; response.clear(); response.contenttype = "application/pdf"; response.addheader("co...

css - How can I fix this nav menu opacity issue? -

i've pasted code here: https://jsfiddle.net/jtbennett/sdydw4l6/ [css - fadein stuff @ top, nav stuff @ bottom] but copy+paste following if want see actual issue in browser...jsfiddle fixes somehow. html: <header class="masthead" style="z-index:9999; top:30%;"> <nav> <div class="nav-container"> <div id="fadein-menu-1"> <input id="slider1" name="slider1" type="checkbox"> <label class="slide has-child" for="slider1"> <span class="element">vi</span> <span class="name">v:hcc</span> </label> <div class="child-menu"> <a href="#">option 1</a> <a href="#">option 2</a> <a href="#">option 3</a> </div> </div>...