Posts

Showing posts from May, 2015

ios - Horizontally scroll UITextField in a UITableViewCell if text overflows -

Image
how able horizontally scroll uitextfield in uitableviewcell if text overflows? want user can scroll text see of it, should not interfere swipe left delete gesture in uitableview. there way this? this should happening automatically, hit regions small. lead user confusion since 2 gestures in small areas 2 different things. are sure that's uitextfield you're using in cell? looks it's uilabel because of truncation.

mysql - SQL query for total unique hits -

i'm struggling write correct sql statement yield desired result normalized tables. i have: table: sites id, url 1, google.com 2, facebook.com table: hits id, site_id 1, 1 2, 1 3, 1 4, 2 i'd write sql statement produce following: site_id, total_hits 1, 3 2, 1 this show count of how many times each url has been hit. appreciated! select s.site_id, count(*) totalhits sites s join hits h on s.site_id = h.site_id group s.site_id sql fiddle: http://sqlfiddle.com/#!9/a5809/1 you should group by on site id , count number of hits.

go - multilevel slices with string indexes -

i have code looks this: var c [][]string c = append(c, d) c = append(c, l) assuming both d , l []strings. works, return this: [["0241025570","0241025571","1102182000"],["0241025570","0241025571","1102182000"]] how possible structure this: ["d": ["0241025570","0241025571","1102182000"], "l":["0241025570","0241025571","1102182000"]] what have no longer slice, map of slices. can desired results using following code: c := make(map[string][]string) c["d"] = d c["l"] = l depending on usage, may want make copies of d , l , instead of using them directly in map: c := make(map[string][]string) c["d"] = make([]string, len(d)) c["l"] = make([]string, len(l)) copy(c["d"], d) copy(c["l"], l)

javascript - $http in Ionic app not catching errors -

Image
i'm running ionic android app under genymotion emulator. i'm having problem $http. when request successful it's fine. when request return 401/403/404 code, exception thrown in ionic framework: ionic.bundle.js line 17288: "cannot read property 'data' of undefined", response undefined. it seems ionic intercepts responses, , 401/403/404 errors still tries trigger .success() callback. see attached excerpt ionic.bundle.js : ionic version: 1.0.0-rc.0 the issue caused because had http interceptor in app.js. seemed harmless commenting out solved problem. seem below got commented out: // .config(['$httpprovider', function($httpprovider) { // $httpprovider.interceptors.push(function() { // return { // 'responseerror': function(rejection) { // var message = "http error " + rejection.statustext + "(" + rejection.status + ") on " + rejection.config.method + " "

matlab - Rotating a Plot About the Y Axis -

Image
i have vector of values want plot brightness on circle through radius of (i.e. if 0 3 1 5 i'd want circle dark @ centre, bright ring around it, darker ring, brighter ring). to i've attempted rotate radial vector (e) around y axis, such [x,y,z] = cylinder(e); h = surf(x,y,z), however i'm not doing right, appears rotating curve around x axis. i've tried swapping x , y, still rotates around x axis. appreciated. one way rotate vector , create surface . z data of surface (your rotated vector) color coded according colormap choose, if display surface top circles @ different brightness. if interested "top view" of surface, no need create full surface, simple pcolor job. example: %% // input data (and assumptions) e=[0 3 1 5 2 7]; nbrightness = 10 ; %// number of brightness levels r = (0:numel(e)) ; %// radius step=1 default consecutive circles

javascript - Problems with jquery form validation : not working for one or two empty input fields -

i have 7 input fields in form , using jquery validation plugin validating each field. validation working fine if input fields empty. not working if 1 or 2 input field empty , others have value. want show error message if 1 field empty. here form: <form role="form" class="form-inline" enctype="multipart/form-data" method="post" action="insert.php" id="frmform"> <label >audit type</label> <select name="type" > <option value="0">select type </option> <option value="typ1"> type 1</option> <option value="typ2"> type 2</option> </select> <label> site</label> <select name="site" > <option value="0">select site </option> <option value="site1"> site 1</option> <option value=&

continuous integration - Configuring Windows slaves in Jenkins -

i in process of learning continuous integration using jenkins. tried configuring windows machine slave node vm linux box, , pretty straight forward. there 1 windows machine in picture, master (linux) can identify , map slave node when try launch slave browser (using launch slave agent via java web start option). my doubt is, in reality, if have configure multiple slaves, of windows, configuration similar windows nodes except when specifying remote fs directory (which can coincide few nodes), unlike linux slaves, specify ip address , credentials able ssh particular linux node. i can configure 2 nodes called windows_slave1, windows_slave2. can hit url of 1 of these 2 nodes of these machines , click on launch. if remote fs directory has same name, master can launch of these nodes. if want connect specific windows slave, then, how master distinguish among these windows slaves? each salve unique , referred name. job can tied slave restricting run on slave only. did read fo

java - Getting JSON.typeMismatch trying to convert string coming from an HTTP Get to JSON object -

i have looked @ multiple other answers here still have not been able resolve issue. i call php restful server json string database. here log output of string comes back: "{\"pat_list\":[{\"id\":\"1\",\"name\":\"john deere\",\"gender\":\"m\",\"child\":\"n\",\"email\":\"mail@site.com\",\"patientid\":\"12657\",\"pridiag\":\"sick\"}]}" this looks valid json (it validates) , looks escaped me (it created using json_encode in php on server) however, when try execute code: if (json_pat_list != null) { log.d("json_string",json_pat_list); try { jsonobject jsonobj = new jsonobject(json_pat_list); i get: w/system.err﹕ org.json.jsonexception: value {"pat_list":[{"id":"1","name":"john deere","gender":"m",

c - Getting UTC time as time_t -

i trying utc time time_t . code below seems giving correct surprisingly prints local time only: time_t mytime; struct tm * ptm; time ( &mytime ); // local time in time_t ptm = gmtime ( &mytime ); // find out utc time time_t utctime = mktime(ptm); // utc time time_t printf("\nlocal time %x (%s) , utc time %x (%s)", mytime, ctime(&mytime), utctime, ctime(&utctime)); as can see values of mytime , utctime different. however, when passed parameters ctime converts them same string. local time 55d0cb59 (sun aug 16 23:11:45 2015) , utc time 55d07e01 (sun aug 16 23:11:45 2015) the ctime result static variable. not use ctime twice in same print statement. in 2 separate print statements. if ctime replaced asctime, same problem arise asctime returns result static variable.

slider - Nullpointer exception for AndroidImageSlider DefaultSliderView In Android Studio, Build 22.0.1 -

this stack trace : 08-16 10:23:40.006 19022-19022/com.world.innov.ebilling e/androidruntime﹕ fatal exception: main process: com.world.innov.ebilling, pid: 19022 java.lang.runtimeexception: unable start activity componentinfo{com.world.innov.ebilling/com.world.innov.ebilling.mainactivity}: java.lang.nullpointerexception: attempt invoke virtual method 'void android.os.bundle.putstring(java.lang.string, java.lang.string)' on null object reference @ android.app.activitythread.performlaunchactivity(activitythread.java:2325) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2390) @ android.app.activitythread.access$800(activitythread.java:151) @ android.app.activitythread$h.handlemessage(activitythread.java:1303) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5257) @ java.lang.reflect.method.invoke(native method) @

php - Laravel 4 - db transaction on save while automatically creating other model -

i have 2 models: userpayout , usertransaction usertransaction polymorph , needs know model belongs to. whenever user creates payout, transaction should automatically made. if went wrong in process, both should rolled back. my actual solution follows: controller: $user_payout = new userpayout($input); $user->payouts()->save($user_payout); userpayout: public function save(array $options = array()) { db::begintransaction(); try{ parent::save($options); $transaction = new usertransaction( array( 'user_id' => $this->user_id, 'template_id' => $this->template->id, 'value' => -$this->amount ) ); $this->transactions()->save($transaction); } catch(\exception $e) { db::rollback(); throw $e; } db::commit(); return $this; } usertransaction: public function save(array $o

java - Android Unhandled exception: org.json.JSONException with ion -

i'm trying json array ion ( https://github.com/koush/ion ) error: unhandled exception: org.json.jsonexception :( my json: [{"title":"hello world","text":"this text"}] my code: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_json); ion.with(myactivity.this) .load(getstring(r.string.json_url)) .asjsonarray() .setcallback(new futurecallback<jsonarray>() { @override public void oncompleted(exception e, jsonarray result) { if (e != null) { toast.maketext(myjson.this, "error loading strings", toast.length_long).show(); return; } jsonobject c = result.getjsonobject(0); if (c.

ruby on rails - How to show confirmed invintations in RoR? -

this question exact duplicate of: why error no such column? 1 answer i have model invintation, , model company, company can send messages each other after confirmation of invitation messaging. invintation.rb class invintation < activerecord::base belongs_to :recipient, class_name: 'company', foreign_key: 'recipient_id' belongs_to :sender, class_name: 'company', foreign_key: 'sender_id' belongs_to :author, class_name: 'user', foreign_key: 'author_id' end company.rb class company < activerecord::base has_many :users_companies has_many :users, through: :users_companies has_many :sent_messages, class_name: 'message', foreign_key: 'sender_id' has_many :incoming_messages, class_name: 'message', foreign_key: 'recipient_id' has_many :sent_invitations, class_name: 

c++ - NS-3 with DCE: How to get input at runtime working with my binaries -

i'm using ns-3 direct code execution, working on ubuntu, , after while, got work, thing is: have 4 nodes each 1 binary run, , of binaries take input me @ runtime, via std::cin. (they send messages other nodes based on input). need working inside ns-3-environment , couldn't figure out how. so far, if start simulation , gets point node application starts waiting input (in endless loop), whole thing blocks, doesn't start other applications, never stops simulation. if curiously type , hit enter, says "relocation error: elf-cache/0/libgcc_s.so.1: symbol dl_iterate_phdr, version glibc_2.2.5 not defined in file 0001.so.6 link time reference" , gives me exit code 127. so, naturally find out how runtime input in ns3, can't find material on this. so, found solution file input finally. maybe it's useful someone. std::ifstream config_doc("path/here/file.txt", std::ifstream::binary); worked me - if make sure path starts @ designated fold

selenium - putty and browser automation as single script -

i have given scenario of automating putty , website form. putty - need run list of commands in linux , extract ip @ end. , have open ip in web browser. web browser - in web browser need fill form. (i use selenium fill form). here want know, can automate both putty , selenium (to fill web form) single script ?? or other alternative can used automate both putty , web browser form filling..?

mongodb - mongod command crashes with message -

i have installed mongodb 3.0.4 . when execute command "mongod" crashes message "mongod.exe has stopped working". here problem details problem event name: appcrash application name: mongod.exe application version: 0.0.0.0 application timestamp: 557ef9c9 fault module name: msvcr120.dll fault module version: 12.0.21005.1 fault module timestamp: 524f83ff exception code: c000001d exception offset: 0000000000092bc3 os version: 6.1.7600.2.0.0.256.48 locale id: 1033 additional information 1: fd3b additional information 2: fd3bb24d4274b34ca613c6f4e63ceb13 additional information 3: 3204 additional information 4: 3204b56578b4c221b1569b71b387eb68 i using windows 7 64 bit operating system. why problem ??? thanks in advance. i facing exact issue current version 3.0.6 of mongodb. uninstalled , installed 2.6.11 verson. , worked! information using win 7 os 64 bit.

scala - overloading a function for a bunch of types -

suppose define arithmetic operators functional types () => int , () => double etc in following manner def + (a : () => int, b : () => int) = new (() => int) { def apply() = a() + b() } is there way avoid boiler plate code in defining similar functions possible argument type combinations? these types can built-in ones ( int , long , double ), user-defined ones (like currency , quantity etc), , option[t] t can before mentioned types. def + (a : () => option[int], b : () => double) = new (() => option[double]) { // specific code factored out def apply() = a() map { _ + b() } } you can create trait instances define concrete implementation of operations particular type. require trait implicit parameter operations , invoke these concrete implementations. for example, check sources of scala.math.numeric .

node.js - Chrome automatically changed DOM, or different from what cheerio gets -

so writing web scraping application using cheerio.js . things going until noticed cheerio $('tbody tr') return nothing, while when open same website in chrome, jquery $('tbody tr') return rows in table body. in cheerio 's body, there no tbody. structure <table><theader></theader><tr></tr><tr></tr></table> . did chrome make change? did cheerio passed html response incorrectly? following 3 html code snippets same when rendered html browser, yet original code different. no thead no tbody in source code <table><tr><td>row1</td></tr><tr><td>row2</td></tr></table> no tbody in source code <table><thead></thead><tr><td>row1</td></tr><tr><td>row2</td></tr></table> tbody , no thead in source code <table><tbody><tr><td>r

css - JQuery Script to change href not working -

i want change css file radio options can't make script work. inserted code test won't work either. using bootstrap framework , works fine, css files work too. my html file: <!doctype html> <html> <head> <link id="estilos" rel="stylesheet" type="text/css" href="./bootstrapcolorschemes/hefestus.css" > <title>spider magic</title> </head> <body> <div class="container"> <form class="form-horizontal" id="myform"> <div class="radio-inline"> <label><input type="radio" name="optradio" value="./bootstrapcolorschemes/adventuetime1.css">at1</label> </div> <div class="radio-inline"> <label><input type="radio" name="optradio" value="./bootstrapcolorsch

debugging - Inherent flaw to my process of android coding -

so used creating python-ish scripts have lots of functions , these functions reference each other of time. seems natural way things me (i more of math person cs person). however, have taken interest in android programming , want create quote generator. essentially have no idea wrong code love pointers wrong , how can better @ android programming. working through big nerd ranch guide android programming , understand book. this mainactivity.java package com.example.alex.donaldtrump; import android.app.activity; import android.media.mediaplayer; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.button; import android.widget.imagebutton; import android.widget.textview; import java.util.random; public class mainactivity extends activity { button generate_button; textview textview; quote_generation quote_generation= new quote_generation(); string quote_gen = quote_generation.ret

android - Are dimen values cached? -

is there performance gain on doing following: final int pixels = getresources.getdimensionpixelsize(r.dimen.pixels); (customview view: views) { view.setpixelvalue(pixels); } vs. for (customview view: views) { view.setpixelvalue(getresources.getdimensionpixelsize(r.dimen.pixels)); } or dimens values cached / bytecode optimised / other optimisation makes redundant? looking @ resources.getdimentionpixelsize() , deeper till assetmanager.loadresourcevalue() native it's impossible say. however, resources.getdimentionpixelsize() source it's possible following: public int getdimensionpixelsize(int id) throws notfoundexception { synchronized (maccesslock) { typedvalue value = mtmpvalue; if (value == null) { mtmpvalue = value = new typedvalue(); } getvalue(id, value, true); if (value.type == typedvalue.type_dimension) { return typedvalue.complextodimensionpixelsize( v

jQuery to scroll to bottom of page -

so, have 2 div s occupies equal amount of height of page (each height=50%). <div class="first" id="first" style="height:50%;"> first content </div> <div class="second" id="second" style="height:50%; display:none;"> second content </div> <script> jquery("#first").click(function () { jquery('#second').show(); }); </script> as can see, second part shows when first div clicked. how can make page (mobile mostly), scrolls down the bottom of page? thanks!! what need show div hiding , animate html body div's location. here jsfiddle : https://jsfiddle.net/cxjwh79v/1/ jquery $(function () { $("#first").on('click', function () { $('#second').show(); $('html, body').animate({ scrolltop: $("#second").offset().top }, 2500); // change 2500 va

ios - How can I remove the parentheses from the last item in NSArray -

i creating array .txt file looks this: bears;wins;24;losses;15 lions;wins;34;losses;10 etc. when array each line with: nsarray *myarray = [content componentsseparatedbystring:@"\n"]; i array this: ("bears;wins;24;losses;15 ", "lions;wins;34;losses;10 ") when parse out semicolon this: (bears, wins, 24, losses, "15 " ), ( lions, wins, 34, losses, "10 ") the problem when want move objects make look/print this: lions,34,10,wins,losses the output instead coming out this: lions,34 ,10,wins,losses how can fix keep on 1 line? the problem when separating line with: nsarray *arr = [content componentsseparatedbystring:@"\n"]; i fixed separating line with: nsarray *arr = [content componentsseparatedbystring:@"\r\n"];

jquery - PhpFox - Link share doesn't work -

on website have strange problem. after add link share , click attach there show loading gif , after few seconds ends without content. i checked ajax request send ajax.php return nothing checked server fopen , curl on , have no idea causes problem. i tried change ajax timeout setting's doesn't change request still return's nothing thanks or tip.

How to escape closed bracket "]" in regex in R -

i'm trying use gsub in r replace bunch of weird characters in strings i'm processing. works, except whenever throw in "]" makes whole thing nothing. i'm using \\ gsub("[\\?\\*\\]]", "", name) it's still not working. here's actual example: name <- "r u still down? [remember me]" what want is: names "r u still down remember me" when do: names <- gsub("[\\(\\)\\*\\$\\+\\?'\\[]", "", name) semi-works , "r u still down remember me]" but when do: names <- gsub("[\\(\\)\\*\\$\\+\\?'\\[\\]]", "", name) nothing happens. (i.e. "r u still down? [remember me]" ) any ideas? i've tried switching around order of things, etc. can't seem figure out. just enable perl=true parameter. > gsub("[?\\]\\[*]", "", name, perl=t) [1] "r u still down remember me" and escape needed

javascript - One Page website hashbang navigation scrolling -

i planning seo optimisation 1 page website. have 1 difficult thing do, scrolling feature working hashbang. when click on url navigation, there smooth scroll section on page. <ul class="navigation" id="menu"> <li> <a href="#personal-profile">personal details</a> </li> <li> <a href="#work-experience">experience</a> </li> <li> <a href="#education">education</a> </li> <li> <a href="#skills">skills</a> </li> <li> <a href="#contact">contact</a> </li> </ul> and function use smooth scrolling: function handlesmoothscrolling() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && locatio

Grails: Where is [domainClassName]instance defined and how is it use? -

i'm new in grails , trying understand existing code. i focused on 1 module first, name of domain class employee , try understand crud. found lots of employeeinstance?.userlastmodified of , wondering how employeeinstance defined. automatic if create employee domain class, have employeeinstance? how work , question mark for? thank you. you've seen employeeinstance in gsp or in controller. defined in controller method. may see controller this: class employeecontroller { def show(long id) { def employee = employee.get(id) [employeeinstance: employee] } } and corresponding gsp page named grails-app/employee/show.gsp uses employeeinstance. with groovy null-safe operator can code this: def date = employeeinstance?.userlastmodified instead of this: def date = null if(employeeinstance != null) date = employeeinstance?.userlastmodified because if employeeinstance null, date variable set null. i hope you're reading grails d

objective c - What is the best way to load static objects in an iOS app? -

i have list of 100 address. want use clgeocoder class , geocodeaddressdictionary or geocodeaddressstring methods list of clplacemarks each address. don't want app every time starts (as addresses never change , requires internet). how can statically store list of 100 clplacemark objects loaded each time app launches? i suggest: store list in app bundle .plist file or json file can parsed on launch static nsdictionary or instance variable of singleton object. first serialise 100 addresses json file. can try use online tools like: http://www.objgen.com/json once have text json file drag file project in xcode. can parse using: nserror *error; nsstring *filepath = [[nsbundle mainbundle] pathforresource:@"addresses" oftype:@"json"]; nsurl *localfileurl = [nsurl fileurlwithpath:filepath]; nsdata *contentoflocalfile = [nsdata datawithcontentsofurl:localfileurl]; nsdictionary *addresses = [nsjsonserialization jsonobjectwithdata:contentoflocalf

ios - textFieldShouldEndEditing malfunction? -

i implemented method send number of alert views user when unwarranted character, or taken username inputed in textfields: func textfieldshouldendediting(textfield: uitextfield) -> bool { let acceptedchars = nscharacterset(charactersinstring: "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234567890_") var istaken: bool = false c in usernametxt.text.utf16 { if !acceptedchars.characterismember(c) { let myalert = sclalertview().showerror("woah there", subtitle: "username can contain uppercase & lowercase letters a-z,numbers 0-9, or special character(s) _", closebuttontitle: "got it") myalert.alertview.contentview.backgroundcolor = uicolor(red:1.0, green:0.18, blue:0.18, alpha:1.0) myalert.alertview.circlebg.backgroundcolor = uicolor(red:1.0, green:0.18, blue:0.18, alpha:1.0) myalert.alertview.labeltitle.textcolor = uicolor.whitecolor() myalert.alert

python - Unable to decode HTML page with urllib.request -

i've wrote following piece of code searches url , saves html text file. however, have 2 issues most importantly, not save € , £ in html this. decoding issue i've tried fix, far without success the following code not replace "\n" in html "". isn't important me, curious why not working any ideas? import urllib.request while true: # infinite loop urllib.request.urlopen('website_url') f: fdecoded = f.read().decode('utf-8') data = str(fdecoded .read()).replace('\n', '') # not seem work? myfile = open("testfile.txt", "r+") myfile.write(data) print ('----------------') when - fdecoded = f.read().decode('utf-8') fdecoded of type str , reading byte string request , decoding str using utf-8 encoding. then after cannot call - str(fdecoded .read()).replace('\n', '') str has no method read() , not need convert str

Create an array that holds struct objects C++ -

i novice programmer , creating program holds several objects of struct type. program needs accept user input don't know how it. first, here's code i'm using define struct: struct apartment{ int number; string owner; string condition; }ap; and here's code i'm using ask user input: cout << "enter apartment number: " << endl; cin >> ap.number; cout << "enter name of owner: " << endl; cin >> ap.owner; cout << "enter condition: " << endl; cin >> ap.condition; apartment building[50] = { ap.number, ap.owner, ap.condition}; the last line of code how trying save object in array, bu don't know if works. later need print objects, nice if helped me too. using visual studio 2013 compiler, in case makes difference. struct apartment{ int number; string owner; string condition; }ap; void addapartment(vector<apartment> &vtnew) {

asp.net mvc - Multiple Attributes Html.BeginForm MVC id and enctype as part of file upload -

as part of file upload (asp.net mvc3) adding id , enctype attributes html.beginform return httppostedfilebase null model: public class profilemodel { [uihint("upload")] public httppostedfilebase imageupload { get; set; } }` profileform.cshtml @using (html.beginform("update", "profile", new { profileid = viewbag.profileid }, formmethod.post, new { @enctype = "multipart/form-data", @id = "profileform" })) { <div> @html.labelfor(model => model.imageupload) @html.textboxfor(model => model.imageupload, new { type = "file" }) </div> <div class='buttons'> <input type="submit" value='save' /> </div> } controller public upload(profilemodel viewmodel) { if (viewmodel.imageupload != null && viewmodel.imageupload.contentlength > 0) { var uploaddir = "~/uploads"; var imagepath = path.combin

Event not being added to Calendar on some Android phones -

i using below code add events calendar on android public void addevent(string datetime) { string eventdate; { simpledateformat formatter = new simpledateformat("yyyy/mm/dd hh:mm"); final calendar cal = calendar.getinstance(); try { cal.settime(formatter.parse(datetime)); eventdate = cal.get(calendar.year)+"/"+cal.get(calendar.month)+"/"+cal.get(calendar.day_of_month)+" "+cal.get(calendar.hour_of_day)+":"+cal.get(calendar.minute); //log.e("event date ", eventdate); } catch (exception e) { log.e("catch ", "",e); } contentvalues event = new contentvalues(); event.put("calendar_id", 3); event.put("_id", eventid); event.put("title", mytitle); event.put("description", mydescription); event.put("eventtimezone&quo

ruby - 403 Forbidden on Rails app w/ Nginx, Passenger, unix -

hi having 403 error despite following steps here 403 forbidden on rails app w/ nginx, passenger my app folder permissions namei -l /home/ubuntu/resume_consumer/current/public f: /home/ubuntu/resume_consumer/current/public drwxr-xr-x root root / drwxr-xr-x root root home drwxr-xr-x ubuntu ubuntu ubuntu drwxrwxr-x ubuntu ubuntu resume_consumer lrwxrwxrwx ubuntu ubuntu current -> /home/ubuntu/resume_consumer/releases/20150815211156 drwxr-xr-x root root / drwxr-xr-x root root home drwxr-xr-x ubuntu ubuntu ubuntu drwxrwxr-x ubuntu ubuntu resume_consumer drwxrwxr-x ubuntu ubuntu releases drwxrwxr-x ubuntu ubuntu 20150815211156 drwxrwxr-x ubuntu ubuntu public the nginx app running nobody ps waux | grep nginx root 12005 0.0 0.0 42480 900 ? ss jul28 0:00 nginx: master process /opt/nginx/sbin/nginx nobody 12006 0.0 0.1 42804 2016 ? s jul28 0:00 nginx: worker process my nginx config looks follows #user nobod

upload multiple files with html5 multiple attribute - spring mvc -

i trying upload multiple files using html5 attribute multiple. link provide me start. however, facing problem not able read multipartfile in controller. here pojo class public class fileproduct { private string name; private list<multipartfile> images; } my controller public string processnewlisting(model model , @modelattribute fileproduct product , httpservletrequest request ) { list<multipartfile> files = product.getimages(); list<string> filenames = new arraylist<string>(); log.info("files legnth: " + files.size()); log.info("name: " + product.getname()); } and if form: <form:form commandname="product" action="${newlistingform }" method="post" enctype="multipart/form-data"> <form:input path="name" type="text"/> <form:input path=&

postgresql - Difference between INSERT and COPY -

as per documentation, loading large number of rows using copy faster using insert, if prepare used , multiple insertions batched single transaction. why copy faster insert (multiple insertion batched single transaction) ? quite number of reasons, actually, main ones are: typically, client applications wait confirmation of 1 insert 's success before sending next. there's round-trip delay each insert , scheduling delays, etc. (pgjdbc supports pipelineing insert s in batches, i'm not aware of other clients do). each insert has go through whole executor. use of prepared statement bypasses need run parser, rewriter , planner, there's still executor state set , tear down each row. copy setup once, , has extremely low overhead each row, no triggers involved. the first point significant. it's network round-trips , rescheduling delays.

asp.net - How to Upload Video in database using C#.net in Visual studio 2008 -

i have below code upload video files database when upload video , click on upload button webpage go offline , data not store data base happening don't know. my database table is create table [dbo].[tblvideos]( [id] [int] identity(1,1) not null, [video_name] [varbinary](50) null, [name] [varchar](50) null, [contenttype] [varbinary](50) null, [data] [varbinary](max) null ) on [primary] my aspx code <table style="margin-left:150px; height:546px"> <tr class="tr"> <td colspan="3"> <asp:label id="label1" runat="server" font-size="15pt" forecolor="#0099ff" text="add new video"></asp:label> &nbsp;<br /> <asp:label id="label2" runat="server" font-names="ms reference sans serif" font-size="7pt" text="make sure video in mp

vim - Why don't my cinoptions work? -

i running vim 7.3 on debian wheezy i686 x86. there no ~/.vimrc, /etc/vim/vimrc. i have set cinoptions=l0:s=sl1b1 i can verify ':verbose set cinoptions?' that cinoptions set string above /etc/vim/vimrc. my switch/case indent still 8 shiftwidths. what trying achieve: switch (foo) { case 0: bar(); break; what instead: switch (foo) { case 0: // blargh! why doesn't vim respect cinoptions? this because 'shiftwidth' set 8 (or maybe higher). try following see if addresses behavior: set shiftwidth=2 tabstop=2

tableview - What is the best way to pass data in a hierarchical structure? Swift -

Image
so working on app has several tableviews take detailview , detailview can either take mapview or webview, here example of mean: instead of making several detail groups (detail,web,map), make tableviews, take same detailview , put information there because there going lot of rows information in wouldn't possible. not of issue right now, think not doing things should. pass information way: in "prepareforsegue" funcion, tableview detailview use "if indexpath.row == 0", pass information according row selected, have integer variable set number of row clicked on tableview , too, passed detailview in detailview know website pass webview or location mapview, more spots added tableview, have add more "ifs" , not sure if right approach or there simpler way this. you should have class encapsulates information relates single table row / detail view. let's call model . in table view controller have array of model s, e.g. var models = [model](