Posts

Showing posts from January, 2013

excel - Using a wildcard with a cell reference. What am I missing? -

in sheet list of names. attempting count different names on sheet in table on sheet b, column b. names not exact , referring cell , not writing in name. sub below works think not using wildcqard correctly. please if can. in advance. sub countif_crr_cnt_until_lastrow() dim lastrow long dim wb1 workbook set wb1 = workbooks("macro client v.01.xlsm") lastrow = wb1.sheets("a").range("a:a").find("overall - total", searchorder:=xlbyrows, searchdirection:=xlprevious).row = 21 lastrow cells(i, 10) = application.countifs(wb1.sheets("b").range("b:b"), "*" & cells(i, 3) & "*") next end sub i believe issue unqualified references when use cells() . vba needs know sheet expect on, when using multiple sheets. i'm assuming cells(i,10) , cells(i,3) on sheet "a". if not, change sheet name: wb1.sheets("a").cells(i, 10) = application.countifs(

Redshift WLM: "final queue may not contain User Groups or Query Groups" -

i want update wlm configuration redshift cluster, unable make changes , save them due following message displayed: the following problems must corrected before can save workload configuration: the final queue may not contain user groups or query groups. now, obvious solution create new queue no user group specified , give remaining amount of memory adds 100%. that's annoying because adding new queue requires cluster reboot, that's not reason i'm asking question. my main question need new "non-user" queue explained? change because previously, had 4 queues, each assigned user group, , collective memory allocation 87%. didn't add 100%, , supposedly rest dynamically managed redshift. now, have no problem creating new queue, see explicit explanation of does/what affects before it. didn't see update on official blog, don't see mentioned in docs, or doc updates ( http://docs.aws.amazon.com/redshift/latest/mgmt/document-history.html , htt

access vba - Inconsistencies in looping through and creating reports -

i have database 5 tables, 3 queries, 3 reports (the queries recordsets) , 3 reports each showing several fields on recordsets. problem is, though have same code, 1 of sub routines has inconsistent results. cycling through each supervisor , creating report , doing again, it's caught in loop , can't see issue is. hoping can help. private sub cmdfedinvest_click() dim x string dim y string dim strsql string dim stwherestr string 'where condition' dim stsection string 'selection drop down list dim stfile string dim stdocname string dim stremail string strsql = "select distinctrow [qryactt8_sup].[sup], [qryactt8_sup].sup_email " & _ "from [qryactt8_sup];" y = year(date) dim db dao.database dim rst dao.recordset set db = currentdb dim qdtemp dao.querydef set qdtemp = db.createquerydef("", strsql) set rst = qdtemp.openrecordset() if rst.eof , rst.bof msgbox "no data available ledge

c# - WCF Service enable tracing -

after 2 days of try , error , blind debugging, web service still produces error in cases , now, don't know why. therefor, enable tracing service in order have @ least little feedback. however, tried few addition web.config, none ever produced trace file, if service responded error. so long, web.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <configsections> <section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false" /> </configsections> <connectionstrings> <...removed here... /> </connectionstrings> <appsettings> <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true" /> </appsettings> <system.web>

javascript - How to open a window with window.open that fits its contents? -

i have window opening via window.open . call window.open can take parameters width, height, scroll bars, etc. in application, use window.open show screen of varying height. instance, may 200 pixels high or 400 pixels high depending on user state. state unknown @ location of window.open . possible have opened window sized fit content? far can tell, can use window.resizeto , doesn't seem work in chrome. if possible, load content in parent page inside container div, obtain container div's width , height using javascript's *.offsetwidth , *.offsetheight, use values in window.open have new window fit content.

android - What is the best way of getting / using Context inside AsyncTask? -

i've defined separate thread extending asynctask class. within class perform toasts , dialogs within asynctask's onpostexecute , oncancelled methods. toasts require application's context such need is: toast.maketext(getapplicationcontext(),"some string",1); the dialogs created using alertdialog.builder requires context in constructor. right in thinking context should activity's context? i.e. alertdialog.builder builder = new alertdialog.builder(getactivity()); where getactivity user defined class returns current activity. if best way handle situation? creating class getactivity or passing current activity's context asynctask's constructor? i guess i'm trying understand use of context - have noticed memory leaks can issue (don't understand yet) , how using getapplicationcontext() best approach possible. simply create asynctask inner class of activity, or pass context constructor of asynctask. inner class: my

angularjs - Angular Material Date Picker Filter -

i have formatted angular material date picker below: $mddatelocaleprovider.formatdate = function(date) { return moment(date).format('yyyy-mm-dd'); }; but when want use date picker filter, it's not working: <md-datepicker ng-model="search.date""></md-datepicker> with <input ng-model="search.date"> date filter working. how make angular material date picker working filter? edit : datepicker output : tue jun 21 2016 00:00:00 gmt+0300 (eest) , want 2016-06-21 you have 2 double quotes in there. <md-datepicker ng-model="search.date""></md-datepicker> here working code. $mddatelocaleprovider.formatdate = function(date) { return moment(date).format('yyyy-mm-dd'); }; })

multithreading - Exception handling in call method of Java executor framework -

wondering if there customized exception happening in call method, wondering best practice client exception? shall catch exception when call get method? or before call get method, exception thrown call method (from thread pool)? thanks. i referring sample below, http://www.vogella.com/tutorials/javaconcurrency/article.html package de.vogella.concurrency.callables; import java.util.concurrent.callable; public class mycallable implements callable<long> { @override public long call() throws exception { long sum = 0; (long = 0; <= 100; i++) { sum += i; } return sum; } } package de.vogella.concurrency.callables; import java.util.arraylist; import java.util.list; import java.util.concurrent.callable; import java.util.concurrent.executionexception; import java.util.concurrent.executorservice; import java.util.concurrent.executors; import java.util.concurrent.future; public class callablefutures { private static final int nthreds = 10;

Laravel roles on routes -

i have laravel 5.2 application using auth functionality provided laravel. roles , permissions i'm using laravel-permission . have defined 3 roles: admin, seller, buyer. i looking solution able specify role per route. have group of routes accessible user role 'admin', group of routes accessible user role 'seller' , group of routes accessible users role 'buyer'. i thinking define separate middleware admin, buyer , seller , use routes. or better way define 1 middleware 'roles' differentiates between roles? better ways? you can make middleware takes parameters. can like 'middleware' => 'role:role_name', a single middleware params passed should fine

c++ - What's the best "type renaming" method? -

if wanted rename std::string type simpler , more naturally looking string , of these 2 methods should use (based on performance , standard) should rename preprocessed directive #define string std::string or type definition typedef std::string string; what's performant method? more familiar , recognized community? just using std::string; if want different name, e.g. using string = std::string; avoid macros, don't respect scopes , evil™. for example, proposed macro #define string std::string … yields formal undefined behavior if include standard library header, because defines name used standard library. c++11 §17.6.4.2.2/1 [macro.names]: ” translation unit includes standard library header shall not #define or #undef names declared in standard library header.

compilation - Multiple definitions error in C++ -

i'm writing c++ program each file has it's own set of global variable declarations. of these files make use of global variables defined in other files using extern. here's example similar program: main.cpp #include "stdafx.h" #include <iostream> #include "other_file.cpp" int var1; int var2; int main() { var1 = 1; var2 = 2; otherfunction(); var4 = 4; // other_file.cpp std::cout << var1 << " " << var2 << " " << var3 << " " << var4 << std::endl; return(0); } other_file.cpp extern int var1; extern int var2; int var3; int var4; void otherfunction() { var3 = var1 + var2; var4 = 0; } when build code in visual studio (windows), runs fine , output correct. when attempt build using g++ on linux receive following error: g++ -o testing testing.o other_file.o other_file.o:(.bss+0x0): multiple definition of var3' testin

maven - Spring mvc @RequestMapping on class level and method level 404 Status -

i know there lot of posts here same problem, none of them seem me, duplicate. im creating spring mvc application using maven, have 1 controller 1 method. when put request mapping annotation on class level application works fine when put on class level , method level , send request this: localhost:8080/myapplication/planification/projet i 404 error: http status 404 - /myapplication/planification/web-inf/pages/test.jsp here controller @controller @requestmapping("/planification") public class planificationcontroller { @requestmapping("/projet") public modelandview projets (modelandview m){ m.addobject("projets", "all projects"); m.setviewname("test"); return m; } } mvc-dispatcher-servlet.xml <beans> <context:component-scan base-package="com.smit"/> <mvc:annotation-driven/> <!-- **** view resolver bean **** --> <bean id="viewresolver" class=&quo

Configure Paypal Sandbox ReturnURL with localhost -

i'm trying insert http://localhost:4000/api/myroute returlurl on https://developer.paypal.com . paypal displays message : sorry went wrong while saving application please try again... so, localhost seems forbidden last week, it's ok. how can enter localhost url ? please, not answer me 127.0.0.1 solution. "localhost" paypal's server, themselves, if tried redirect http://localhost/whatever , go right own server, , url wouldn't exist, , you'd end 404 @ paypal server. if want test on local server you're going need setup dns point sort of domain public ip address there, , make sure web server configured answer domain well. for example, site might www.domain.com. lookup public ip address there, , create dns record domain.com points sandbox.domain.com public ip address there. then can use http://sandbox.domain.com anytime need work paypal (or else) , it'll work same "localhost" now, 3rd party servers able communicat

java - Add artifact to local repository from project -

is there way add artifact local maven repository eclipse project? currently have project contain many jars, , have started using maven. need add these jars local repository in automated way without redownload them or adding them 1 one , specifying coordinates. make new maven project in eclipse, , add code src/main directory. have lots of compile errors, because of missing dependencies. now start auto adding dependencies. in intellj can add using alt-enter, has option "add maven dependency". adds dependency maven repository pom. not know eclipse enough, has feature. now, in normal project, find of required dependencies somewhere in maven central. if miss any, can add them using manual installation local repository, suggested manas mukherjee mvn install:install-file -dfile={jar_file_name_path}.jar -dgroupid={groupid} -dartifactid={artifactid} -dversion={version} -dpackaging=jar

algorithm - Find word in string buffer/paragraph/text -

this asked in amazon telephonic interview - "can write program (in preferred language c/c++/etc.) find given word in string buffer of big size ? i.e. number of occurrences " i still looking perfect answer should have given interviewer.. tried write linear search (char char comparison) , rejected. given 40-45 min time telephonic interview, perfect algorithm he/she looking ??? the kmp algorithm popular string matching algorithm. kmp algorithm checking char char inefficient. if string has 1000 characters , keyword has 100 characters, don't want perform unnecessary comparisons. kmp algorithm handles many cases can occur, imagine interviewer looking case where: when begin (pass 1), first 99 characters match, 100th character doesn't match. now, pass 2, instead of performing entire comparison character 2, have enough information deduce next possible match can begin. // c program implementation of kmp pattern searching // algorithm #include<stdio.h

c++ - How to index all the derived components in a base component list in Entity -

i trying entity component system design simulation. here confuses me now. trying make entity class entity.h class entity { public: entity(); virtual ~entity() = 0; //---------------------methods---------------------// void addcomponent(const shared_ptr<component> component); template<class t> t* getcomponent() const; //---------------------members---------------------// vector<shared_ptr<component>> m_components; } entity.cpp template<typename t> t* entity::getcomponent() const { component::component_type_t typeindex = /*t::component_type*/ t* returnptr = dynamic_pointer_cast<t>(m_components[component_type].get()); return returnptr; } and component class looks this class component { public: component(); virtual ~component() = 0; //---------------------methods---------------------// //---------------------members---------------------// typedef enum component_type_t {

Accelerating one-to-many correlation calculations in Python -

i'd calculate pearson's correlation coefficient between vector , each row of array in python (numpy , or scipy assumed). use of standard correlation matrix calculation functions not possible due size of real data arrays , memory constraints. here's naive implementation: import numpy np import scipy.stats sps np.random.seed(0) def correlateonewithmany(one, many): """return pearson's correlation coef of 'one' each row of 'many'.""" pr_arr = np.zeros((many.shape[0], 2), dtype=np.float64) pr_arr[:] = np.nan row_num in np.arange(many.shape[0]): pr_arr[row_num, :] = sps.pearsonr(one, many[row_num, :]) return pr_arr obs, varz = 10 ** 3, 500 x = np.random.uniform(size=(obs, varz)) pr = correlateonewithmany(x[0, :], x) %timeit correlateonewithmany(x[0, :], x) # 10 loops, best of 3: 38.9 ms per loop any thoughts on accelerating appreciated! the module scipy.spatial.distance implemen

html - How to configure opacity based CSS overlay to not effect spacing of surrounding elements? -

ok, have following code: http://jsfiddle.net/q8ser/1/ so issue when hover on image, shows overlay name specific image. if name longer image width, image right pushed away , overlay isn't centered on image. expands right, not on both sides. i can't work out how center overlay , avoid effecting divs on either side of it. *i tried using display: none , want preserve css3 transitions. using display: none remove element removes css3 transition. any ideas? change .item_overlay style to: .item_overlay { height: auto; width: auto; margin: 0 auto; margin-top: -95px; position: absolute; z-index: 1; background-color: #fff; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-transition: 0.3s linear; -moz-transition: 0.3s linear; -o-transition: 0.3s linear; transition: 0.3s linear; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px;

Importing CSV into SQL Server via powershell, but only the matching columns? -

i file particular vendor every week. once in while process changes, , wind getting fields, in middle of row. fortunately, proper header, , don't appear remove existing fields. unfortunately, nobody ever knows why or how changed. after changing several times, decided clever. so, i'd do: query sql server, columns target view/table, select fields exist in both, table. my current code (below) doesn't - import-csv, "select fields know good", insert table. works, yes, slow crap. , dumb, since have hardcode fields know good. i'd more extensible process. additionally, i'd stream in - existing process crawls (15 minutes 50mb file), because has load entire file, run through select & convert, insert. works. i played high-performance techniques importing csv sql server using powershell , kept running "i don't know powershell enough fix" issues. here's have far. ultra-simplified, though make simpler building view on top of

token - Communicating to ADFS using endpoint IP or Machine Name -

i able communicate adfs server , authenticate users successfully. have question regarding endpoint address. my question: when communicating adfs , can provide domain name in place of address. https://address/adfs/services/trust/13/usernamemixed when try enter domain name channel cannot created. want know if missing setting in server dns. when authenticate go to: https://xxx/adfs/ls you need same for: https://xxx/adfs/services/trust/13/usernamemixed

WNetAddConnection2 Remote Access and read the directory files in c# -

i have read file "abc.txt" content remote server on intranet. used wnetaddconnection2 that. used stackoverflow link , this link too . made connection success. when try use remote connection still points c drive. want connection use remote 1 made , files there. var onc = new system.net.networkcredential() { domain = "192.1.x.y", username = "localhost\\myremoteadminusername", password = "myremotepassword" }; using (new networkconnection(@"\\" + "192.1.x.y", onc)) { string[] sfoldernames = directory.getdirectories(onc.domain + "\\logs"); //get exception in above line bcoz somehow points local c:\...\\bin\debug\192.1.x.y\logs //instead of remote 192.1.x.y\logs foreach (string sfoldername in sfoldernames) { string[] sarrzipfi

Migrating Jenkins server using Git? -

i'm using scm sync configuration plugin jenkins git , wanted know if there way migrate config/jobs 1 jenkins server 1 using git. specifically, can sync jenkins in original server git , sync same git repository new jenkins server? i haven't found indicates whether possible or how it.

jquery - Any way to get the value checkbox -

been working checkboxes , curious if there way value of "connected" checkbox? whenever console.log('input:checked').val() value of on , fine wanted save bit of time. thanks. val() returns value of checkbox if set else returns on . if want check checkbox checked: $(selector).is(':checked') check fiddle: http://jsfiddle.net/sdf2h/120/

go - Youtube Content ID API always return Not Found -

my account connected cms can't see youtube content id in api library. however, see in enabled apis!! (it appeared after try "authorize requests using oauth 2.0" in youtube content id api reference doc). can test api in reference doc , shows data cms. when call api program, response this: { "error": { "errors": [ { "domain": "global", "reason": "notfound", "message": "not found" } ], "code": 404, "message": "not found" } } this implementation using go: func testyoutubeapi(w http.responsewriter, r *http.request) { data, err := ioutil.readfile("./google-service-key.json") if err != nil { log.fatal(err) } config, err := google.jwtconfigfromjson(data, "https://www.googleapis.com/auth/youtubepartner", "https://www.googleapis.com/auth/youtube.force-ssl", "https://www.googlea

How to pick CSS file with javascript if -

would possible me like <link href="nav.css" type="text/css" rel="stylesheet" /> in this? <script> if (screen.width <= 800) { link css here! } </script> just use css media query so you can read media queries here @media(max-width: 800px) { /* * enter css here */ }

send ir signals iPhone -

i develop app control ir receivers iphone. used arduino detect values of command remote, , have this: on 1250, 450, 1200, 450, 350, 1300, 1250, 450, 1200, 450, 400, 1300, 350, 1300, 350, 1300, 400, 1300, 350, 1300, 1200, 450, 350 off 1150, 550, 1150, 500, 350, 1300, 1150, 550, 1150, 500, 300, 1350, 350, 1300, 400, 1300, 350, 1300, 350, 1350, 350, 1300, 1200 i have build transmitter based on jack 3.5, send values through jack of iphone. how can it? there library or framework in swift or objective-c can me? in app store there app called "tv remote" want, , works samsung tv, has database of values , tv. develop app control electric fun or led stripe or other. can give me advice please? you can read data through iphone's headjack, if bandwidth of signal fits bandwidth of iphone's a/d-converter, 20hz 20khz. also @ project: https://code.google.com/p/hijack-main/ the incoming data must modulated @ frequencies within passband of iphone microphone inp

android studio - where does gradle put the jars it downloads? -

i using android studio gradle. in project find jar files pulling gradle say compile 'com.squareup.picasso:picasso:2.5.2' digging through android studio find xml file under /users/myname/studioprojects/myproject/.idea/libraries/picasso_2_5_2.xml i inside, opened terminal , routed path suggested. jar. want browse it. if source picasso-2.5.2-sources.jar using spotlight search nothing found. cannot view what's inside. how might that? when running gradle, .gradle folder created in home directory: ~/.gradle/caches .

dataframe - Performing simple lookup using 2 data frames in R -

in r, have 2 data frames & b follows- data-frame a: name age city gender income company ... jxx 21 chicago m 20k xyz ... cxx 25 newyork m 30k pqr ... cxx 26 chicago m na zzz ... data-frame b: age city gender avg income avg height avg weight ... 21 chicago m 30k ... ... ... 25 newyork m 40k ... ... ... 26 chicago m 50k ... ... ... i want fill missing values in data frame data frame b. for example, third row in data frame can substitute avg income data frame b instead of exact income. don't want merge these 2 data frames, instead want perform look-up operation using age, city , gender columns. library(data.table); ## generate data set.seed(5l); nk <- 6l; pa <- 0.8; pb <- 0.2; keydf <- unique(

In TypeScript's tsconfig file, how do I exclude 'node_modules' folder but include certain sub files -

i have tsconfig so { "compileonsave": false, "compileroptions": { "module": "es2015", "target": "es2015", "sourcemap": true, "jsx": "react", "allowsyntheticdefaultimports": true, "noimplicitany": false, "watch": true, "emitdecoratormetadata": true, "experimentaldecorators": true, "allowjs": true, "suppressoutputpathcheck": true }, "exclude": [ "dist", "node_modules", "bower_components", "typings/globals", "typings/modules" ] } and using webpack bundle project files. definition files have been added using typings npm modules includes own definition files. want able add typescript compilation. otherwise errors cannot find module x how include definition files in compilation? ce

r - Perform operation on subset of factors -

i have factor variable, condition, tells me whether subjects took test or not: data$condition.f <- factor(data$condition, labels = c("notest", "test")) i have variable, x contains right (1) , wrong (0) responses question. > data$x [1] na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na na [42] na na na na na na na na na na na na na na na na na na na na na na na 1 1 1 na na 1 0 na 1 1 1 0 0 0 1 0 1 0 [83] 1 1 0 1 na 1 0 1 1 1 1 1 na 1 na 0 1 1 1 0 1 0 1 1 0 na 1 1 1 1 1 1 0 1 na 1 0 0 the first half of vector corresponds did not take test (hence nas), , remainder represent did take test. i replace nas did take test 0. have tried following code: if (data$condition.f == "test") { data$x[which(is.na(data$x))] <- 0 } but error warning message: in if (data$condition.f == "test") { : condition

ruby - rails: adding css class to a select box -

how add css class select box? i have code <%= select_tag(:ptype, options_for_select(tourparticipation::ptypes, selected: "traveler", disabled: "role:", :class => "widens")) %> which doesn't work. you have closing parenthesis in wrong place. need pass class option select_tag , not options_for_select . want this: <%= select_tag(:ptype, options_for_select(tourparticipation::ptypes, selected: "traveler", disabled: "role:"), :class => "widens") %>

osx - dylib set by rpath is not loaded in OS X -

i making package manager, , ensure packages use correct dependent library setting rpath option @ compile time. surprised me in os x (10.11), here problem: $ otool -l /opt/starman/software/gcc/6.1.0/83894f21d07366be296600ec031ae4f6241381d9/libexec/gcc/x86_64-apple-darwin15.5.0/6.1.0/f951 /opt/starman/software/gcc/6.1.0/83894f21d07366be296600ec031ae4f6241381d9/libexec/gcc/x86_64-apple-darwin15.5.0/6.1.0/f951: /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /opt/starman/software/isl/0.17.1/104994def2b7fb2dae7950b42205eb718a46ee0c/lib/libisl.15.dylib (compatibility version 18.0.0, current version 18.1.0) /opt/starman/software/mpc/1.0.3/6058925218009b8ab17e07333dc54de334134f6e/lib/libmpc.3.dylib (compatibility version 4.0.0, current version 4.0.0) /opt/starman/software/mpfr/3.1.4/f142dfcda3b56650a8c9cfe2fdd09ffdf7283a00/lib/libmpfr.4.dylib (compatibility version 6.0.0, current version 6.4.0) /opt/starman/software/gmp/6.1.0/0ec8ef118

python - tkinter root window isn't quite the right size -

i creating tkinter canvas, , need check when user changes size of window. problem is, window apparently isn't size it's supposed be. have following: def print_size(self): print self.root.winfo_width() def init_simulation(self, size=300): self.root = tk() canvas = canvas(self.root, width=size, height=size) self.print_size() self.root.after(1000, self.print_size) when running get: 1 and second later: 306 ignoring fact tkinter add 6 pixels, why size first 1 , 306? setting wrong? when instantiate root widget tk() , tkinter starts process in separate thread create window - doesn't happen in main loop. the reason 1 size root window doesn't exist yet when call self.print_size first time, gives default value of 1 . next time call second later, window has finished spawning, gives the actual size. it's race condition - main event loop gets print self.root.winfo_width() before self.root done being created. if you'd cha

cblas on centos6 cannot be linked -

here ldconfig $ ldconfig -p | grep blas libptf77blas.so.3 (libc6,x86-64) => /usr/lib64/atlas/libptf77blas.so.3 libptcblas.so.3 (libc6,x86-64) => /usr/lib64/atlas/libptcblas.so.3 libf77blas.so.3 (libc6,x86-64) => /usr/lib64/atlas/libf77blas.so.3 libcblas.so.3 (libc6,x86-64) => /usr/lib64/atlas/libcblas.so.3 libblas.so.3 (libc6,x86-64) => /usr/lib64/libblas.so.3 libblas.so (libc6,x86-64) => /usr/lib64/libblas.so when try compile cblas, here error: gcc -std=c99 -g -wall -o0 -i../include -l../bin -i../externals/cxsparse/include example_als_mcmc.c -lfastfm -l../externals/cxsparse/lib -lcxsparse -lblas -lm -lcblas -o example_als_mcmc /usr/bin/ld: cannot find -lcblas collect2: ld returned 1 exit status make: *** [example_als_mcmc] error 1 i have cblas in ldconfig, why make cannot find it? thank help.

java - Struts2 file upload interceptor get duplicate action errors -

i using struts2 , ejb, when upload file larger max size, action same duplicate action error, why? public void validateuploaddoc() { if(this.hasactionerrors()) return; //actionerror: // [request exceeded allowed size limit! max size allowed is: // 10,485,760 request was: 36,830,776!, // request exceeded allowed size limit! max size allowed is: 10,485,760 // butrequest was: 36,830,776!] } i debug validation, find 2 same action errors, other setting in file upload ok, can tell me why? want show 1 action error in jsp.

angularjs - Uncaught Error: No module: LocalStorageModule -

i trying work on angularjs project local storage. making todo list application , storing each todo note using angular-local-storage . have made localstorageservice used in controller. have injected service dependency in app.js keep getting blank page , console error: uncaught error: no module: localstoragemodule . there wrong syntax??... or using service incorrectly? app.coffee @angtut = angular.module("angtut", ['localstoragemodule']); @angtut.config(["$routeprovider", ($routeprovider) -> $routerprovider = $routeprovider; $routeprovider.when("/", templateurl: "views/pages/welcome.html" controller: "pagescontroller" ); $routeprovider.when("/add", templateurl: "views/todos/add.html" controller: "todoscontroller" ); $routeprovider.otherwise( redirectto: "/" ); ]) todo_controller.coffee "use strict" @angtut.controller('todoscontroller',

app data - Can't read Excel file from the App_Data folder after uploading using a RadUpload -

<telerik:radupload id="fuexcelupload" skin="windows7" runat="server" overwriteexistingfiles="true" width="100%" controlobjectsvisibility="none" maxfileinputscount="1"> </telerik:radupload> above code radupload control foreach (uploadedfile file in fuexcelupload.uploadedfiles) { string filename = server.mappath("~/app_data/" + file.getname()); file.saveas(filename, true); dtexcel = new relatedparty().selectexceldata("oledb12", filename, "[sheet1$]"); sqlxml referencenumbers = passxml(dtupload); } above code upload excel file. code works on development machine, , in test environment, when deployed in iis server. this problem occurs when project published in uat testing server in client site. problem app_data folder? it appreciated if can suggest reason issue , resolution! also, no error occurs, file won't read. file crea

c++ - Differences between double *vec and double vec[] -

in our legacy c/c++ code encounter 2 versions of signatures void foo1(double *vec, int n) and void foo2(double vec[], int n) but there no difference in handling of parameter vec inside of methods e.g.: void foo2(double vec[], int n){ for(int i=0;i<n;i++) do_something(vec[i]); } is there difference between first version ( double * ) , second ( double ..[] )? in situations should version preferred on other? edit: after hint of @khaled.k tried compile: void foo(double *d, int n){} void foo(double d[], int n){} and got compile error due redefinition of void foo(double *d, int n) . double *vec , double vec[] mean same. the still open question version should used when. here relevant quote k&r 2nd (*), starting @ bottom of page 99: as formal parameters in function definition, char s[]; and char *s; are equivalent; prefer latter because says more explicity parameter pointer. when array name passed function, function can

python - pandas - rank elements of dataframe -

data = pandas.dataframe(numpy.random.randn(4,3)) print data out[4]: 0 1 2 0 -1.122880 -2.662009 1.180418 1 -0.335768 0.162640 0.105928 2 -1.282813 0.049638 1.532208 3 -0.422884 -1.110049 0.031648 working huge dataset , trying efficiently return tuples rank elements of dataframe. tried few awkward sequences of apply() , rank() , such want nicer. looking function get_ranks(data) return ordered set of (row, col) tuples. above: (2,2), (0,2), (3,2), (1,1), ... i searched around bunch haven't found commentary applying in particular. should cat rows or cols , rank there? or there more direct path? here can : >>> import pandas pd >>> import numpy np >>> df = pd.dataframe(np.random.randn(4,3)) >>> df 0 1 2 0 1.644294 1.476467 -0.137539 1 -0.448040 -0.329539 -0.996425 2 -1.015308 -1.397746 0.36

export excel multiple table to word -

i have excel many table in 1 sheet, have grouping table product , sparate each table space , header, how export each table excel word product | sub_porduct | price | | 1231 | 6 | | 3331 | 5 | | 1233 | 9 | product | sub_porduct | price | b | 1299 | 10 | b | 1001 | 9 | product | sub_porduct | price | c | 1871 | 15 | c | 1854 | 17 | c | 1782 | 19 | c | 1771 | 18 | many thx advice i tried generate data word below code sub roundedrectangle2_click() dim wdapp object dim wd object dim maxrow long dim orderno4 long dim orderno long dim orderno2 long dim wrksht worksheet dim orderno3 long on error resume next set wdapp = getobject(, "word.application") if err.number <> 0 set wdapp = createobject("word.application") end if on error goto 0 set wrksht = sheet1 set wd

c# - Postgresql NpgSql connection handling extra query and multiple close connection -

Image
i running sql query through dapper when profiling on over every query perform npg sql see executescalar query sent on connection. , there multiple npgsqlconnection.close events. run query in using statement terminates npgsqlconnection follow. using (var connection = new npgsqlconnection(connectionstring)) { return connection.queryasync<t>(sql, param); } the runs command 1 every sql send through code - set extra_float_digits = 3 set ssl_renegotiation_limit = 0 set lc_monetary = 'c' select 'npgsql73113' here profiler screenshot of relevant section. 1 know why there query , multiple connection close events. you using npgsql 2.2, old , sent these commands on startup. please upgrade latest stable version (3.1.3) , these should gone. i'm less sure connection close events, if see behavior in 3.1.3 please report issue.

c++ - How do I start an android activity from a .cpp script? -

say using c , c++ , want execute script made in c within terminal emulator in android opens activity, gui. possible? , how do it? i wouldn't care using assembly, tablet's processor armv7. if answer somewhere in there. you start android activity same way in java, constructing appropriate intent instance , calling context.startactivity() . main difference need thunk java via jni in order c or c++. look functions getmethodid , callvoidmethod within jnienv class—using those, can call java function c++ code. need small amount of java glue code want.

javascript - How to make web form appear after previous web form has data entered into it? -

i'm looking make second web form appear after first web form has entered it. i'm using sinatra set slim templating engine, , pure javascript. input#topic value="enter topic" onfocus="this.value = this.value=='enter topic'?'':this.value;" onblur="this.value = this.value==''?'enter topic':this.value;" input#subtopic value="enter subtopic" onfocus="this.value = this.value=='enter subtopic?'':this.value;" onblur="this.value = this.value==''?'enter subtopic':this.value;" the above 2 forms, onfocus , onblur make form value disappear , reappear if clicked on. my javascript follows. function checkfield(field) { if(field.value != null) { document.getelementbyid('subtopic_form').style.display = 'true'; } else { document.getelementbyid('subtopic_form').style.display = 'false'; } } this doesn't

c# - Rollback after saving changes -

i have controller , repository. using ef 6 controller file int userid = _myrepository.addcustomer(model) i userid then using third party plugin make payment (ex:) var success = makepaymentthroughpaymentprocessor(userid); now if payment not go through or error happens rollback changes no customer added not added database. i have tried using wrapping repository method (var transaction = objmcoentities.database.begintransaction()) { //code... context.savechanges(); return userid; i on https://msdn.microsoft.com/en-us/data/dn456843.aspx but i'm not sure how reference transaction after addcustomer repository methods has been called i take payment first , add customer db after if error happens while adding customer db customer not created payment made , have refund customer if you're using entity framework 6, have @ this page. you'll have choose between tranaction.commit() , transaction.rollback(); but don't think necessary in scenario. i

Initializing References and Variables In C++ -

given following c++ function: int& returnareference() { /* here */ } is there difference between 2 statements: int normalvariable = returnareference(); int& referencevariable = returnareferene(); is 1 version preferred on other? regarding this: int normalvariable = returnareference(); normalvariable integer, , assigned value of int returnareference() references. such incrementing, assigning, or doing else normalvariable not affect whatever returnareference() has internally. regarding this: int& referencevariable = returnareference(); referencevariable reference integer otherwise internal returnareference() . such incrementing, assigning, or doing else referencevariable will affect whatever returnareference() has internally. what preferred depends on you're trying accomplish, in many cases second approach (using referencevariable ) violates "encapsulation" ( http://en.wikipedia.org/wiki/encapsulation_(object-oriente

python - Why does my POST requests on flask-restless==1.0.0b1 result in ERROR:400 MissingData -

i have following code: import requests data = {u"username":u"cryarchy", u"password":u"pass1234", u"email":u"email@domain.com"} url = "http://localhost:5000/api/account" headers = {"content-type":"application/vnd.api+json", "accept":"application/vnd.api+json"} import json r = requests.post(url, data=json.dumps(data), headers=headers) after request, flask-debug console displays following: 127.0.0.1 - - [02/jun/2016 08:33:03] "post /api/account http/1.1" 400 - {u'username': u'cryarchy', u'password': u'pass1234', u'email': u'email@domain.com'} -------------------------------------------------------------------------------- error in base [/home/user/tizy/myflask/e2-papers/venv/local/lib/python2.7/site-packages/flask_restless/views/base.py:726]: -----------------------------------------------------------------------

php - How to find the sum of an associative array -

i have array this $sales = array('first'=>array('red'=>array(9,3),'green'=>array(4,5,8,2)), 'second'=>array('red'=>array(3,5,5,2),'yellow'=>array(4,2,5)), 'third'=>array('blue'=>array(1,2,4),'red'=>array(9,4,6)), 'four'=>array('blue'=>array(2,3,3,5),'black'=>array(4,5,8,9))); and have find total sales of each color in array. the result array should array('red'=>46,'green'=>19, ...) use array_sum inside foreach: $sales = array('first'=>array('red'=>array(9,3),'green'=>array(4,5,8,2)), 'second'=>array('red'=>array(3,5,5,2),'yellow'=>array(4,2,5)), 'third'=>array('blue'=>array(1,2,4),'red'=>array(9,4,6)), 'four'=>array('blue'=>array(2,3,3,5),'black'=>array(4,5,8,9))); $arr = [];

Javascript print in a new window won't display images -

i'am struggling problem , hoping can me. created function prints out data inputs in page. however, logo using on print page won't displayed if link image broken. thoughts? here code: function printreport() { win=null; var vin = $("input[name='vin']").val(); var make = $("select[name='make']").val(); var printdata = '<table width="960" border="0" align="center"> <tr> <td colspan="2"><img src="http://localhost/site/images/logo_print.png" width="291" height="109" /></td> </tr> <tr> <td colspan="2"><div class="print-title" align="center">service report </div></td> </tr> <tr> <td width="196">vin:</td> <td width="754"><b>'+ vin +'</b></td> </tr> <tr> <td>make:</t