Posts

Showing posts from June, 2011

vb.net - mySQL, default current timestamp not working -

im writing program in vb keep track of money code below how i'm trying create database: create table h ( amount decimal(9, 2), reason varchar(50), comment varchar(50), list varchar(max), dateoftrans timestamp default current_timestamp ) however when run error sql execution error. executed sql statement: create table h ( amount decimal(9, 2), reason varchar(50), comment varchar(50), list varchar(max), dateoftrans timestamp default current_timestamp ) error source: .net sgiclient data provider error message: defaults cannot created on columns of data type timestamp. table 'h', column 'dateoftrans'. not create constraint. see previous errors. i using postgres while , thought mysql updated making timestamps searched online , couldn't find anything. tried using datetime default now() saying now() isnt valid function im @ complete loss , appreciated

Database and iOS application -

i new ios development, , hoping of can answer questions. 1)how ios app interact database? 2)how app retrieve/update data in/from server? same concept web servers? 3)can use web server backend server of app? i grateful if can provide quick , easy example. (sigh.) go onto ray wenderlich's website, buy ios apprentice tutorials, come here if - after learning basics - still have questions. http://www.raywenderlich.com/store/ios-apprentice there's whole load of excellent tutorials out there, answer 3 of questions. even have tutorial, showing how data json web service iphone app. iphone app using web services did research, or follow walkthroughs, before asking question ?

java - How to POST parameters and body in HttpURLConnection -

how do both @ same time? the parameters query string parameters. body json. connection.setrequestproperty("content-type", "application/json"); connection.setrequestproperty("accept", "application/json"); connection.setdooutput(true); connection.getoutputstream().write(parameters); connection.getoutputstream().write(sqldatabase.tostring().getbytes("utf-8")); sqldatabase jsonobject, while parameters byte[]; obviously, depends on server interpreting post request. seems me want treat data html form includes file. such form posts data multipart/form-data body. each parameter, whether query parameter or file data, separate part in multipart body. html 4 spec , rfc 2388 describe in detail. creating multipart body can done javamail library: list<bodypart> partlist = new arraylist<>(); parameterlist dispositionparams = new parameterlist(); (string queryparam : parameters.split("&")) ...

sorting - How to use awk to sum multiple columns (but not all) and sort by the summed values -

i hope can solve problem awk and/or sort: i have 19-column tab-delim file formatted so: (where line beginning 'gene' header) gene -100 -75 -50 -25 0 25 50 75 100 -100 -75 -50 -25 0 25 50 75 100 mll 0 0 0 2 5 2 0 0 1 0 0 4 8 5 5 4 0 1 mll2 0 0 0 7 10 7 0 0 1 0 0 0 7 10 7 0 0 1 i sum columns 2-10, , sort rows summed value, give output so: gene -100 -75 -50 -25 0 25 50 75 100 -100 -75 -50 -25 0 25 50 75 100 mll2 0 0 0 7 10 7 0 0 1 0 0 0 7 10 7 0 0 1 mll 0 0 0 2 5 2 0 0 1 0 0 4 8 5 5 4 0 1 i know if can make 20th column sum value need, can use sort finish job: sort -nk20 file.txt thanks in advance! two step solution this sums columns , prints sum 20th column: $ awk 'nr==1{print $0,0;next;} {s=0; (i=2;i<=nf;i++) s+=$i; print $0,s;}' file gene -100 -75 -50 -25 0 25 50 75 100 -100 -75 -50 -25 0 25 50 75 100 ...

c++ - Wrapping chars in caesar cipher encode -

can please explain me how wrapping of chars between a-to-z , a-to-z happening in caesar shift code? k %= 26; for(int = 0; < n; i++){ int c = s[i]; if(c >= 'a' && c <= 'z'){ c += k; if( c > 'z'){ c = 96 + (c % 122); // wrapping z a? } } else if(c >= 'a' && c <= 'z'){ c += k; if(c > 'z'){ c = 64 + (c % 90); } } cout << (char)c; } k amount of shift , c char of string s. is there better way same? lets make couple changes code , easier see going on for(int = 0; < n; i++){ int c = s[i]; if(c >= 'a' && c <= 'z'){ c += k; if( c > 'z'){ c = 'a' + (c % 'z') - 1; // wrapping z a? } } else if(c >= 'a' && c <= 'z'){ c += k; if(c > ...

c# - How can I submit a Sharepoint page and retain its state (prevent it from re-initializing)? -

i have sharepoint web page starts off question user; once answer it, rest of page created. when user submits page via "save" button, page reverts initial (almost blank) state. i'm trying work around - want page return former, pre-submit, glory. i ran problems previously-created elements not wanting re-created due new instances having same ids previous instances (a "primary key violation" reckon). so after posting situation here , thought had come solution when added code make each id unique, based on when instantiation takes place: ckbximinsider.id = getyyyymmddhourminsecms() + "ckbxucscfacultystafforstudent"; // making ids unique, when same elements created multiple times (such before , after form submission) private string getyyyymmddhourminsecms() { datetime dt = datetime.now; string dateyyyymmdd = dt.tostring("yyyymmdd"); int hour = dt.hour; int min = dt.minute; int sec = dt.second; int millisec = dt.m...

shell - How to check array doesn't contain line in bash scripting -

i reading data file line line , storing array, can access later array compare other files data. now, input file has redundancy, how add unique lines array. need check while adding array itself? below code using read data file: while read line //how check array contains line??? <code adding array> done <"$file" you can use associative array this: declare -a ulines while ifs= read -r line; [[ ! ${ulines["$line"]} ]] && echo "$line" && ulines["$line"]=1 done < "$file" this print unique lines on stdout preserving original order in input file.

amazon web services - Using AWS Autoscaling as dispatcher -

i have been given business logic of a customer makes request services through third party gateway gui ec2 instance processing time (15hr) data retrieval currently implemented statically giving each user ec2 instance use handle requests. (this instance creates sub instances parallel process data). what should happen each request, ec2 instance fired off automatically. in long term, thinking should done using swf (given use of sub processes), however, wondered if quick , dirty solution, using autoscaling correct settings worthwhile pursuing. any thoughts? you can "trick" autoscalling spin instances based on metrics: http://docs.aws.amazon.com/autoscaling/latest/developerguide/policy_creating.html so on each request, keep track/increments metric. decrement metric when process completes. drive autoscalling group on metric. use step adjustments control number of instances: http://docs.aws.amazon.com/autoscaling/latest/developerguide/as-scale-based-on-...

How can I replace html elements with php? -

i have website in use html, i'd add 1 location edit things nav , footer. instantly updated across whole site. so, example, i'd put: <nav> <div class="nav-wrapper"> <a href="#" class="brand-logo">logo</a> <ul id="nav-mobile" class="right hide-on-med-and-down"> <li><a href="sass.html">sass</a></li> <li><a href="badges.html">components</a></li> <li><a href="collapsible.html">javascript</a></li> </ul> </div> </nav> into <?php echo $nav;?> any appreciated! =) add html want show file. eg: add menu.html <nav> <div class="nav-wrapper"> <a href="#" class="brand-logo">logo</a> <ul id="nav-mobile" c...

c++ - Mutual update between two classes of same superclass -

i have opengl application 2 main parts (viewers), main loop follows: int main(int argc, char* argv[]) { gp::viewers::patternviewer pviewer; gp::viewers::meshviewer mviewer; while (!pviewer.shouldclose() && !mviewer.shouldclose()) { pviewer.makecurrent(); pviewer.mainloop(); pviewer.swap(); mviewer.makecurrent(); mviewer.mainloop(); mviewer.swap(); glfwwaitevents(); } glfwterminate(); return 0; } it happens user interaction 1 viewer should propagate change other viewer. gut instinct says update loop follows: int main(int argc, char* argv[]) { gp::viewers::patternviewer pviewer; gp::viewers::meshviewer mviewer; while (!pviewer.shouldclose() && !mviewer.shouldclose()) { pviewer.makecurrent(); pviewer.mainloop(); pviewer.swap(); mviewer.makecurrent(); mviewer.mainloop(); mviewer.swap(); // update here ...

powerquery - Comments in Power Query Formula (M) Language -

is there way comment m code / comment out lines or blocks of code? it seems should easy enough find, reality every website has "comments" section, has made hard search for. m supports 2 different types of comments: single line comments can started // you can comment out multiple lines or comment out text in middle of line using /* */ (e.g. = 1 + /* comment */ 2 ) comments might seem disappear in formula bar if @ end of line, still there. can verify looking @ code in advanced editor.

c# - Accessing another project's settings file -

is there way access settings file different project? example, have solution contains 2 projects (lets call them proj1 , proj2). want access application settings of proj2 program.cs in proj1. possible? option : parse values out of other assembly's configuration file (where settings stored) option b : create public class in proj2 exposes necessary values settings static properties, reference assembly in proj1 , consume values class. option c : if want expose settings, can modify access of settings class internal public . i'm sure there other ways well.

hibernate - How to avoid LazyInitializationException when using WebSockets in Spring? -

any advices how avoid infamous lazyinitializationexception in following setup (working spring , hibernate) : @messagemapping("/activate/foo") @sendtouser("/queue/result") public result doit(integer fooid) { foo foo = fooservice.load(fooid); // via hibernate result = ... // accessing foo outside hibernate transaction // therefore lazyinitializationexception thrown return result; } what do? annotate doit() @transactional? calculate result inside method annotated @transactional? manually doing stuff opensessioninviewfilter doing servlet requests? utilizing type of "ready use" filters or interceptors websockets in spring (which one, how, examples?) tomcat websocket filter? right i'm voting 3, looks uncool... ;-)

html - Bootstrap menu always collapsed issue -

i facing issue in making bootstrap menu collpased default working fine till 991px need thing done till max-width of 1400px. appreciated. http://www.theo2.co.in/fashionongo/ i'm not sure how theme built try this: in custom css file add media query like: @media (max-width: 2000px) { .navbar-header { float: none; } .navbar-left,.navbar-right { float: none !important; } .navbar-toggle { display: block; } .navbar-collapse { border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-collapse.collapse { display: none!important; } .navbar-nav { float: none!important; margin-top: 7.5px; } .navbar-nav>li { float: none; } .navbar-nav>li>a { padding-top: 10px; padding-bottom: 10px; } .collapse.in{ display:block !important; } } they key code 2000px part. if screen size gets on 2000px menu open. try , see if work on site ...

css - What is the proper syntax for child selectors with Sass? -

i converting current css file scss. should mention first time attempting use sass, , things going far. have question when comes child selectors sass. have following code: .ticker-basic.holiday2013 { background-color:#e4242b !important; color:#ffffff; text-decoration:none; font-weight:normal; font-size:14px; font-family: 'helveticaneuew01-85heav', helvetica, arial, sans-serif; letter-spacing: -1px; text-transform: lowercase; p { text-transform: capitalize; } p > { color:#ffffff; text-decoration: underline; font-weight:normal; font-size:10px; } } am able nest child tag in above p tag? such this: p { text-transform: capitalize; > { color:#ffffff; text-decoration: underline; font-weight:normal; font-size:10px; } } p { > { ... } } would apply on direct sibling anchors of paragr...

javascript - Showing how many form checkboxes are checked in document itself -

i have coded asp page using example here shows how many checked boxes there in form in pop-up alert box. problem have many boxes on form takes forever select box, close alert, check box, close alert… change or replace code show number of checked boxes in document's html instead of alert, updating count boxes checked or unchecked. here script used count boxes , show alert: <script language="javascript"> function checktotalcheckedboxes() { var checklength = 0; var boxes = document.getelementbyid("yyy").getelementsbytagname("input"); (var = 0; < boxes.length; i++) { boxes[i].checked ? checklength++ : null; } alert (checklength + " boxes checked." ); } </script> i have "select all" script works great selecting boxes @ once. problem "select all" box stays checked once used, if of boxes de-selected. need modify script uncheck "select all" box user clicks it...

python - Addition to INSTALLED_APPS creating problems -

i've done: pip install django-oauth-toolkit python-social-auth, when add following installed_apps, , doing python manage.py makemigrations installed_apps = ( ... 'social.apps.django_app.default', 'oauth2_provider', ) its showing me following errors: traceback (most recent call last): file "manage.py", line 10, in <module> execute_from_command_line(sys.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **options.__dict__) file "/usr/local/lib/python2.7/dist-packages/django/core/manageme...

html - Is there a way to change the color of an HTML5 textbox watermark? -

this question has answer here: change html5 input's placeholder color css 23 answers if have html5 text box follows <form> <input type="text" name="mytextbox" placeholder"mytextbox"/> </form> is there way using html or css change color of placeholder/watermark default light gray? see this answer . long story short, need use css selectors apply rules each browser, handles process differently. input.mytextbox::-webkit-input-placeholder { /* webkit browsers */ color: red; } input.mytextbox:-moz-placeholder { /* mozilla firefox 4 18 */ color: red; opacity: 1; } input.mytextbox::-moz-placeholder { /* mozilla firefox 19+ */ color: red; opacity: 1; } input.mytextbox:-ms-input-placeholder { /* internet explorer 10+ */ color: red; } <input class="m...

mysql - fetch records from a table to which it is having similar ids -

i have 2 tables like uid name 11 cadman 12 clive 13 coleman 14 chester and second table like id pa1 pa2 pa3 pa4 4800 11 12 11 14 4801 11 12 13 14 4802 11 12 12 4973 12 13 14 6882 12 12 13 14 6883 11 12 14 6884 11 13 13 14 6885 11 13 13 14 i display names instead of ids can 1 me in query in advance create / populate create table nt ( -- name table uid int auto_increment primary key, name varchar(100) not null ); create table ( -- id table (sorry creativity @ low) id int primary key, pa1 int not null, pa2 int not null, pa3 int not null, pa4 int not null, -- in constraining kinda mood: constraint fk_pa1_nt foreign key (pa1) references nt(uid), constraint fk_pa2_nt foreign key (pa2) references nt(uid), constraint fk_pa3_nt foreign key (pa3) references nt(uid), constraint fk_pa4_nt foreign key (pa4) references nt(uid) ); insert nt (n...

php - Getting a results of DB query basing on rows number by function -

this long. i'm making class data teams - 5 steam users basing on 32bit steamids stored in database - 1 row = 1 team. want 1 result, when specify teamid , rows, when it's not defined(or when equals 'all'). , here starts problem, 'cause specified team gives return, can't rows, gives null when var_dump ed. have created method: public static function basedata($teamid = null){ if(!empty($teamid)){ if(is_numeric($teamid)){ db::getinstance()->get('', 'o90eprrzc3v8', ['53qwi8md3rm7', '=', $teamid]); } elseif($teamid == 'all'){ db::getinstance()->getordered('', 'o90eprrzc3v8', '53qwi8md3rm7', 'asc'); } return db::getinstance()->results(); } return false; } where db class' methods use in team class looks this: public function bquery($sql, $params = array()){ ...

excel - Subtotal formula with unknown amount of rows in a column when the range is based on a text in another column -

i have subtotal column starts in cell i11 don't know amount of rows change each time. @ end of column multiply functions based on subtotal. i trying create macro count amount of rows starting @ i11 , go until value in column f equals "value of work done" this have far: sub total_amount() 'new_entry macro dim ppc1 worksheet dim rowno integer rowno = activecell.row if ppc1.range("f11:f").value = "value of work done" range("i" & rows.count).end(xlup) .offset(1).formula = "=sum(i11:" & .address(0, 0) & ")" end end if end sub the answer still comes @ end of column instead of beside "value of work done" sub total_amount() 'new_entry macro dim ws excel.worksheet dim lrow long dim llast long set ws = worksheets("ppc 1") row = 11 while lrow <= ws.usedrange.rows.count if ws.range("f" & lrow).value = "value of work done...

c# - How to get multiple most commons values from array and add them to another? -

i have array this: [2 1 2 4 3 3 1] i'm using this... var query = array.groupby(item => item) .orderbydescending(g => g.count()) .select(g => g.key) .first(); .. first common value (in case : 2) what if want multiple values (in case: 2,3,1) ? i need add values temporary array check if temparray.count > 1. if groups tied top count, this: var tmp = array .groupby(item => item) .orderbydescending(g => g.count()) .select(g => new { item = g.key , count = g.count() }).tolist(); var res = tmp .takewhile(p => p.count == tmp[0].count) .select(p => p.item) .tolist(); note check tmp list count non-zero unnecessary, because way takewhile condition executed when there @ least single item in temporary list. in other words, when tmp empty, lambda condition p => p.count == tmp[0].count never reached, , out-of-range exception never thrown.

elixir - How to handle success/error flash messages from Rethinkdb in Phoenix -

i'm trying success or insuccess of query rethinkdb in phoenix framework through flash message. don't know correct signature retrieve result message rethinkdb in code block. def index(conn, _params) #query creates table in database table_create("contenttext") |> basedados.database.run # list elements of table database q = table("contenttext") |> basedados.database.run #run query through database |> io.inspect conn |> put_flash(:error, "some message") |> put_flash(:info, "another message") |> render "index.html", contenttext: q #render users searched on users template end edit: okay found out there supposed errors field along lines of: %rethinkdb.record{data: %{"deleted" => 0, "errors" => 0, "generated_keys" => ["15cc4e19-fc72-4c19-b3a5-47141b6a63e0"], "inserted" => 1, "replaced" =...

android - Google Analytics V4 Not showing data -

i did example hello world android app in manifest <?xml version="1.0"?> <!-- google analytics required permissions --> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <!-- optional permission reliable local dispatching on non-google play devices --> <uses-permission android:name="android.permission.wake_lock" /> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/theme.appcompat" android:name=".myapp"> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> <activity android:name=".mainactivity" android:label="@str...

OpenGL selected depth testing -

i'd implement opengl scene (opengl es 2.0) in depth testing enabled between selected triangles. to more specific: suppose have 4 triangles render. depth testing should enabled between triangles 1 , 2 , between triangles 3 , 4 , neither between triangles 1 , 3 nor triangles 2 , 4 . in other words: possible enable depth testing within 2 pairs of triangles not between them (to improve performance when rendering sequence of 2 pairs can calculated more on software level? according opengl.org faq (see bottom of page - 12.080), scene can divided regions purpose, description doesn't go enough detail me comprehend how achieved. a couple of possibilities come mind. clear depth buffer multiple times per frame the easiest approach clear depth buffer after rendered 1 group of objects. case in question: glclear(gl_color_buffer_bit | gl_depth_buffer_bit); // draw triangle 1. // draw triangle 2. glclear(gl_depth_buffer_bit); // draw triangle 3. // draw triangle 4....

android - SecurityException thrown when calling WifiManager startScan -

i'm using pendingintent launched alarmmanager (with setrepeating ) start wifi scans (using intentservice ) every few minutes. on devices , in cases, there no problem that. however, on several devices following error (couldn't reproduce error on test device. crash log user's device): java.lang.runtimeexception: unable start service com.myapp.android.service.myservice@44a9701 intent { act=com.myapp.android.action_perform_wifi_scan flg=0x4 cmp=com.myapp/com.mayapp.android.service.myservice (has extras) }: java.lang.securityexception: permission denial: broadcast android asks run user -1 calling user 0; requires android.permission.interact_across_users_full or android.permission.interact_across_users @ android.app.activitythread.handleserviceargs(activitythread.java:3021) @ android.app.activitythread.-wrap17(activitythread.java) @ android.app.activitythread$h.handlemessage(activitythread.java:1443) @ android.os.handler.dispatchmessage(handler...

sql - MySQL user activity across time starting with last week -

i have user activity data datetime | user | action -------------------------- t1 | u1 | t2 | u1 | b t3 | u2 | t4 | u1 | c t1 | u2 | t1 | u2 | d aggregated output should follows t1 | u1 | 1 t1 | u2 | 2 .... if today july 22,2015 need create buckets following jul 15,2015 12 noon - jul 16,2015 12 noon , corresponding counts jul 16,2015 12 noon - jul 17,2015 12 noon jul 17,2015 12 noon - jul 18,2015 12 noon jul 18,2015 12 noon - jul 19,2015 12 noon.... how can that? if i'm understanding question correctly trying count of user actions per day. to accomplish going use group in conjunction aggregate function: count select date("datetime"), "user", count("action") tablename date("datetime") > curdate() group date("datetime"), user if want offset 12 hours you'll need som date math. date function docs writing pho...

Count same values in column SQL Server -

i trying count same values in column , want return count there off. | item | count | +-------+-------+ | green | 1 | | green | 2 | | green | 3 | | red | 1 | | red | 2 | i tried row_number() on (order item) row but counts each line 1 - 1000 how accomplish this? you'll want include partition by clause row_number function. makes row_number restart 1 each new type of item. row_number() on (partition item order item) row this give result like: item row green 1 green 2 green 3 red 1 red 2

java - unable to create the profile com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; -

im making simple database ,so here database schema: create database studentapp_db ; create table students_info ( regno int(10) not null, firstname varchar (50) , middlename varchar (50), lastname varchar (50), primary key(regno) ) ; create table gaurdian_info ( regno int(10) not null, gfirstname varchar (50) , gmiddlename varchar (50), glastname varchar (50), primary key(regno) ) ; create table students_otherinfo ( regno int(10) not null, isadmin varchar (1) , passowrd varchar (50), primary key(regno) ) ; now, i'm inserting values run configuration that's giving me kind of errors; unable create profile com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: have error in sql syntax; check manual corresponds mysql server version right syntax use near '10,'aayush','kumar','na')' @ line 1 @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl....

database - Excel file to mysql -

i creating web application collect specific data users. want user uploads excel file containing data on web page created , excel file stores data on mysql database. possible?how? it's possible. i convert excel file csv file, or make user upload csv file instead. excel has feature build in. then in mysql can turn csv file tmp table ease: load data low_priority local infile 'c:\\users\\desktop\\nameoffile.csv' replace table `tmp_table` character set latin1 fields terminated ';' lines terminated '\r\n'; after transfer data tmp table tables you'd , delete temporary table.

jquery - validation if value is empty or zero ('0'), but what if it's "0.0" -

i encountered problem today when working on validating form. user has input price in price field. if input 0 (for reason) or leave empty, following code catches this: var pricevar = $("#price").val(); if (pricevar == '' || pricevar == '0') { var errormessage = 'product price empty or zero. please enter above.'; $("#errordiv").html(errormessage).slidedown(); return false; } else { return false; } my input field follows: <input type="text" name="price" id="price" placeholder="0.00"> however, if (again, reason) user enters 0.00 isn't detected , form gets submitted. have tried null , empty nothing working. know how detect 0.00 empty number, 0.01 (or great) not? you can use parsefloat() convert variable string float, , should working. if (parsefloat(pricevar) == 0) { // code }

mongodb - Covered queries and find all (no filter) -

i not sure if possible, i'm curious. have region collection purpose of being loaded web dropdown. not big thing there. { _id:"some numeric id", name:"region name", } and having index created db.regions.createindex({name:1}) i tried both db.regions.find({},{_id:0}).sort(name:1) , without sort. using explain shows totaldocsexamined greater zero, means not covered query if understood concept. for covered query, have explicitly list each of covered fields in projection: db.regions.find({}, {_id:0, name: 1}).sort(name:1) if exclude _id , you're telling mongodb include all fields besides _id . know docs have name field, mongodb doesn't have explicit.

html - How do I adjust the grid gutter on MDL as that of foundation or bootstrap? -

Image
how set gutter width of material design lite's grid system, with mdl, basic grid. <div class="demo-grid-ruler mdl-grid container"> <div class="mdl-cell mdl-cell--1-col fl-10">1</div> <div class="mdl-cell mdl-cell--1-col fl-11">2</div> <div class="mdl-cell mdl-cell--1-col fl-12">3</div> <div class="mdl-cell mdl-cell--1-col fl-13">4</div> <div class="mdl-cell mdl-cell--1-col fl-14">5</div> <div class="mdl-cell mdl-cell--1-col fl-15">6</div> <div class="mdl-cell mdl-cell--1-col fl-16">7</div> <div class="mdl-cell mdl-cell--1-col fl-17">8</div> <div class="mdl-cell mdl-cell--1-col fl-18">9</div> <div class="mdl-cell mdl-cell--1-col fl-19">10</div> <div class="mdl-cell mdl-cell--1-col fl-20">11</div> ...

xcode - iOS memory management with ARC -

let's i'm working on app large number of views , have problems understanding memory management when uiviewcontroller segues uiviewcontroller. which of following object should release in viewdiddisappear: ? @property (weak, nonatomic) iboutlet uiimageview *background; @property (strong,nonatomic) uilabel *playerlevel; - (void)viewdidload { [super viewdidload]; map = [[mapview alloc]init]; [self.view addsubview:map]; } is correct way ? - (void)viewdiddisappear:(bool)animated { [super viewdiddisappear:yes]; [_background removefromsupeview]; [self.playerlevel removefromsupeview]; [map removefromsupeview]; _background = nil; self.playerlevel = nil; map = nil; } you don't need anything. arc implement dealloc method you, call releases retained properties. i recommend read memory management documentation apple, understand arc doing, including understanding how retain cycles can avoided. https://developer.apple...

cordova - Downloaded videos from server and save locally through my phonegap app -

how can videos downloaded in users phone through phonegap app , videos on server. can 1 show me way how it. i think should use file transfer plugin download kinds (video, image, pdf, etc,...). can find file transfer plugin at file transfer plugin note need use file plugin access file path or create new folder or whatever need.

internet explorer - How to redirect IE in php without die()? -

i'm working on site whith external webshop this: $webshopurl = "webshop.com/something/?id=" . $transaction_id; //and other parameters header ( "connection: close" ); header ( "location: " . $webshopurl ); header ( "content-length: " . $length ); $response= getresponse($transaction id /*and other stuff*/); getresponse() contains lopp keeps polling webshop see how transaction went, , reacts accordingly if transaction finished, or exits timeout after 10 minutes. on browser works fine, browser goes webshop, user buys , once transaction on polling loop gets info , whatever does. ie won't redirect until php stops running, loop can't possibly handle webshop transactions. tried manually entering webshop url browser, , worked fine. didn't write system, maintain it, i'd rather refrain complete overhaul of system. edit: tried using javascript , and html meta redirect, work after php stopped running the direct answer qu...

hadoop - Determining Bucketing Configuration on Hive Table -

i curious if provide little more clarification on how configure bucketing property on hive table. see helps joins , believe read put on column use join. wrong. curious how determine number of buckets choose. if give brief explanation , documentation on how determine of these things great. thanks in advance assistance. craig the following few suggestions considered while designing buckets. buckets created on critical columns , single column or set of columns, implies these columns primary columns various join conditions , concept of bucketing hash these set of columns , store in such way accessible hdfs faster.thus retrieving speed fast.its advised not use join columns critical , think improve performance. the number of buckets in exponents of 2. number of buckets determine number of reducers run , determines final number files in data stored. number of buckets has designed keeping in mind size of data handling , there keeping in mind of avoiding large number o...

datetime - python how to sum together all values within a time interval in datetime64? -

i have pandas dataframe looks like: payment_method dcash_t3m dcash_t3m_3d paypal unknown combined day_name 2013-08-27 0 0 0 1 1 2013-08-28 0 0 0 4 4 2013-08-29 0 0 0 17 17 2013-08-30 0 0 0 4 4 2013-09-02 0 0 0 3 3 2013-09-03 0 0 0 1 1 2013-09-04 0 0 0 3 3 2013-09-05 0 0 0 1 1 2013-09-06 0 0 0 5 5 2013-09-09 0 0 0 2 2 2013-09-10 0 0 0 5 5 2013-09-11 0 0 0 18 18 2013-...

php - Header 404 vs Header 400: url parsing error -

i'm writing own little php framework. want write semantic be, , i'm stacked. i've got url parsing class . parse whole url (scheme, subdomain, domain, resource , query). next router class decides url . if there resources corresponding url "renders" it, if not render 404, if resource forbidden renders 403, etc... problem: let's site under: http://en.mysite.com . lets pages asd , &*% not exist. i've got 2 url's: http://en.mysite.com/asd http://en.mysite.com/&*%($^&# of course both sites doesn't exists. should headers like? i'm predicting that: http://en.mysite.com/asd // header 404 page not found http://en.mysite.com/&*% // header 400 bad request however (based on our guru site): http://stackoverflow.com/<< // header 404 http://stackoverflow.com/&;: // header 404 http://stackoverflow.com/&*%($%5e&# // header 400 (which btw not styled...) https://www.google.com/%&*...

c# - Winforms app controls change size on production PC -

i'm developing small winforms app internal use. dev pc runs windows 7 of other team members (i.e. users of app) running windows 8.1. winforms controls render differently in windows 8.1 , causes problems such buttons cutting off text due size differences. is there way see how app render in windows 8.1 on windows 7 dev pc? note i'm talking regular winforms app, not metro style app. i'm developing in c# using visual studio professional 2013 edit note have tried using https://github.com/viperneo/winforms-modernui , similar behaviour. have datetimepicker next button , make height's same. on windows 7 dev pc looks correct. when run on windows 8 "production" pc button height shorter datetimepicker , things become misaligned in general , controls start partially overlap. screen resolutions of 2 pcs same check see dpi setting all/each of users using. windows forms render differently each dpi scaling setting regardless if windows 7 or windows 8...

c++ - The right way to use != in a While loop ?...Or ..? -

i'm beginner in c++ , while making code create tictactoe game got stuck @ while statement push game keep going until winning conditions fulfilled : while(((table[0][0]!='x')&&(table[1][1]!='x')&&(table[2][2]!='x'))) this diagonal condition (putting conditions give eyesore...). problem not working if conditions fulfilled (i'm sure because use cout @ end), when change && || condition work ! thought maybe because of != affect ?? edit: minimal example (i removed floating point !) : #include <iostream> using namespace std; int main() { int taillex(3),tailley(3); //the size of table. char table[taillex][tailley]; //tictactoe table. table[0][0]='n'; table[0][1]='n'; table[0][2]='n'; table[1][0]='n'; table[1][1]='n'; //randomly filling array avoid error table[1][2]='n'; table[2][0]='n'; table[2][1]='n'; t...