Posts

Showing posts from January, 2012

slice - Splice list of date objects in Python -

is there simple way splice list of date objects: spliced = sorteddates[startdate:enddate] print spliced or requires enumeration? example : sorteddates = [july 1 2012, july 2 2012, july 3 2012, july 4, 2012] spliced = sorteddates[july 2 2012:july 4 2012] assuming have list sorteddates contains datetime object, , 2 datetime mind , maxd objects define boundaries: filtered = [d d in sorteddates if mind < d < maxd] or, more efficient since takes advantage of sorted nature of list use binary search: from bisect import bisect_left, bisect_right filtered = sorteddates[bisect_right(sorteddates, mind):bisect_left(sorteddates, maxd)]

tabcontrol - Multiple Listviews on tab2 control -

here have problem multiple listview controls on tab2 control. in gui, have tab2 control 3 of tabs each have 1 listview control. my problem when use lv_gettext() , can't find way of distinguishing listview fetch from. to compound problem, there no way lv_add() distinguish between listviews either. normally, have distinguish between gui windows mygui:default there doesn't appear option listview controls. how can this? actually, there way specify listview. it mentions in docs, too. basically, change default listview. can't direct functions particular listview, if change default listview, can operate on it. once changed, subsequent commands operate on new default. you change this: gui, listview, listviewname or this, if need distinguish between gui windows: gui, 3:listview, listviewname here sample. paste script file , run see work. basic methodology #singleinstance,force gosub, showgui return showgui: gui, mainui:new,

linux - rpmbuild outputting to /root/rpmbuild directory -

i have build rpm package drivers. need build rpm .tar.gz archive. tar ball contains .spec file. have set rpmbuild environment described here: http://wiki.centos.org/howtos/setuprpmbuildenvironment my directory structure thus: /home/rpmbuild /home/rpmbuild/build /home/rpmbuild/rpms /home/rpmbuild/sources /home/rpmbuild/specs /home/rpmbuild/srpms the .tar.gz file contains specfile , placed in /home/rpmbuild/sources if navigate directory , run following, rpm package built correctly, placed in /root/rpmbuild/rpms instead of /home/rpmbuild/rpms (where expected be). sudo rpmbuild -ta driver.tar.gz i assume because ran rpmbuild sudo. thinking of correctly? there way direct build in /home/rpmbuild instead? i know bad practice use rpmbuild root, if don't run root run many errors (not having permissions access directories owned root - /tmp/orbit-root). seems more difficult change permissions of each of these directories change them back. is correct way go this? app

data structures - Order of steps in Kosaraju's algorithm -

the wikipedia summary of kosaraju-sharir algorithm follows: let g directed graph , s empty stack. while s not contain vertices. choose arbitrary vertex v not in s. perform depth-first search starting @ v. each time depth-first search finishes expanding vertex u, push u onto s. reverse directions of arcs obtain transpose graph. while s nonempty: pop top vertex v s. perform depth-first search starting @ v in transpose graph. the set of visited vertices give connected component containing v; record , remove these vertices graph g , stack s. equivalently, breadth-first search (bfs) can used instead of depth-first search. but in textbook - sedgewick's algorithms (fourth edition) - describes steps of algorithm follows: given digraph g, compute reverse post-order of reverse digraph. g r run standard dfs on g, consider unmarked vertices in order computed instead of standard numerial order the set of vertices... th

Migrating from SQL Server 2005 to SQL Server 2008 : forced to use schema name before table name -

i have 2 big programs connect sql server 2005 database. now migrate new server sql server 2008.. programs don't work anymore when connected new server, cause in queries in programs table names used, , not dbo tables.. sql server 2008 doesn't recognise them, unless use schema name before table name... it very difficult me change queries in 2 programs add schema name before tables names. i read in forum if specify default schema problem solved.. haven't been solved though. the solution seems working when changed schema of table dbo.. not sure if action ok or cause other problems related modification? is there better solution? will changing schema of tables cause me other kind of problems? many in advance default schemea work you. issue approach? change schema name cause big issue , not advisable. , how schema name change?(just think). you set default schema 1 procedure first , check, if ok. change whole database schema. https://dba.stackexcha

recurrence - finding the rth term of a sequence -

the question give possible formula rth term. i'm able solve 2 questions rest can't seems of different way or weird.as i'm studying alevels think there's common rule or maybe easy way solve sequence related problems.i never understood sequence enough-it's hard me. 6 18 54 162 i'm able solve 2*3^r 4 7 12 19 by r^2+3 but 4 12 24 40 60 i'm trying many ways can't find answer.i think there's common rule solving these not marks there should solved in easy way i'm not getting how to.please help here's formula in r sequence: g <- function(n) 6*n + 2*n^2 + 4 g(0:4) [1] 4 12 24 40 60 here 1 way solve relation. first, recognize quadratic difference arithmetic sequence (linear). then note g(x + 1) = g(x) + 8 + 4x . represent g(x) = a*x^2 + b*x + c . then: g(x+1) = a(x+1)^2 + b(x+1) + c = g(x) + 8 + 4x = a*x^2 + b*x + c + 8 * 4x ax^2 + 2ax + + b*x + b + c = a*x^2 + b*x + c + 8 + 4x thus

ms word - N page break object after running add_break method fails -

i'm having problem python-docx library. i'm following page's example doesn't seem work. can provide assistance? >>> all_runs[0] <docx.text.run object @ 0x7f49b899c5d0> >>> play=all_runs[0] >>> play.add_break(wd_break.page) >>> play.breaks traceback (most recent call last): file "<stdin>", line 1, in <module> attributeerror: 'run' object has no attribute 'breaks' that page part of design documentation, not as-built documentation (notice title 'candidate' protocol). there no breaks property implemented on run yet. if can bit you're trying accomplish may able help.

How to escape html tags ? in json retrived from php in phonegap android -

i creating app in i'm using php in server side.when ajax call made calling php retrieve data table issue table contains html & special characters tags error in ajax : 05-31 00:59:07.670: d/cordovalog(872): server not responding... please try again: syntaxerror: unexpected token < 05-31 00:59:07.670: i/chromium(872): [info:console(342)] "server not responding... please try again: syntaxerror: unexpected token <", source: file:///android_asset/www/home.html (342) can tell how solve issue. in advance. you may use escapehtml returns html escaped representation of given plain text. more info see @ escapehtml or may use textutils.htmlencode("your json tag") encode html. edit using phonegap may use htmlencoding php htmlentities($str, ent_quotes); for more information see @ htmlentities in php to encode html in php , decode in app,you may refer link using php’s json encode , decode functions handle data sent , app

jquery - IE9 Form submits after mutiple click -

i have simple html form not submitting in ie9. works in chrome, ff, , ie10. steps : click on "add files" button add multiple files. follow step 1 , step 2 (twice) click submit if click "submit" load same page. it's working on chrome, ff , ie10. in ie9 need click "submit" button multiple times based on how many times clicked "add files" button. anyone can me identify wrong ? here form: demo link code: form: <form id="edit-object-form" name="multipleupload" class="main-form" action="" method="post" enctype="multipart/form-data" > <input type="button" id="add-file-field" name="add" value="add files" /> <div id="inputswrapper"></div> <input type="submit" class="regular-btn-red submit_button" value="submit query" id="su

Same xml load on multiple button click in Android -

i have multiple button in main activity, , on every button click same xml loaded "test.xml" dynamic data. "test.xml" loaded on every click contain 5 more buttons , every click of "test.xml" buttons again want load same xml,i.e, "test.xml" different data. how acheive task. main.xml is- <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/idc_leftlayout" > <button android:id="@+id/idc_game1" android:layout_width="120dp" android:layout_height="40dp" android:background="@drawable/g1" android:layout_margintop="20dp" android:onclick="stratgame1" /> <button android:id="@+id/idc_game2" android:layout_width="120dp" android:layout_height="40dp" android:background="@drawable/g2" android

php - Magento fatal error with IWD Onepage Checkout -

i using magento 1 page checkout quick checkout process. it throwing fatal error upon adding product cart. in j2t ajax , in header cart area showing fatal error after reloading page error gone , product added shopping cart. in php error log shows following error php fatal error: call member function addlink() on non-object in /home/public_html/app/code/community/iwd/opc/block/links.php on line 17 on line 17 $parentblock->addlink($text, 'onepage', $text, true, array('_secure'=>true), 60, null, 'class="top-link-checkout"'); i've tried disable ajax cart , compilation disabled still throwing error. any idea why showing error? thank in advance :) i solved issue myself. anyway. if have issue. here solution it go to: /magento folder/app/code/community/iwd/opc/block/links.php find: if (mage::helper('opc')->isenable()){ $parentblock->addlink($text, 'onepage', $text, true, array(&

linux - stream output of a command continuously run in php -

i running simple command { ./a.out < in; } &> output.txt using exec , want output what's coming in output.txt through ajax request continuously . also want way turn off output buffering.i tried flush() , ob functions didn't succedded.in /etc/php5/apache2/php.ini php.ini value of output_buffering = 4096 error in log file is: [sat may 31 15:48:26.853420 2014] [mpm_prefork:notice] [pid 1277] ah00169: caught sigterm, shutting down [sat may 31 17:23:30.461926 2014] [mpm_prefork:notice] [pid 1270] ah00163: apache/2.4.7 (ubuntu) php/5.5.9-1ubuntu4 configured -- resuming normal operations [sat may 31 17:23:30.484232 2014] [core:notice] [pid 1270] ah00094: command line: '/usr/sbin/apache2' .when change off , restart apache2 server fails restart. p.s. using lamp server.

java - Weighted Randomized Ordering -

the problem: i have items have weights. higher weight, greater chance have item go first. need have clean, simple way of doing based on core java (no 3rd party libs, jars, etc.). i've done 2 items, summing weights randomly pick number using math.random() within range. simple. items greater 2, can either more samples in same range chancing misses, or can recompute sum of weights of remaining items , select again (recursive approach). think there might out there can can faster/cleaner. code used on , over, i'm looking effective solution. in essence, randomized weight permutations. some examples: a has weight of 1, b has weight of 99. if ran simulation this, expect ba 99% of time , ab 1% of time. a has weight of 10, b has weight of 10, , c has weight of 80. if ran simulations this, expect c first item in ordering 80% of time, in cases, a , b have equal chance of being next character. any or pointers in right direction appreciated. extra details: fo

warnings - ProGuard - unexpectedly contains class -

while i'm trying obfuscate simple dataloader.class file in proguard error: reading program directory [c:\users\uzytkownik\documents\netbeansprojects\protest\build\classes\files\dataloader.class] warning: class [dataloader.class] unexpectedly contains class [files.dataloader] warning: there 1 classes in incorrectly named files. should make sure file names correspond class names. directory hierarchies must correspond package hierarchies. (http://proguard.sourceforge.net/manual/troubleshooting.html#unexpectedclass) if don't mind mentioned classes not being written out, try luck using '-ignorewarnings' option. please correct above warnings first. here project: http://www49.zippyshare.com/v/14668241/file.html i grateful help. with options -injars , -libraryjars , should specify proper base directory (or jar) of classes, classpath. in case: classes , not classes\files\dataloader.class . see proguard manual >

javascript - Bootstrap navbar hide the portion of pages after clicking on sidebar nav-list -

i tried used sidebar (affix , scrollspy) navigate contents of page. however, every time click 1 link of sidebar, header of corresponding section hidden in top fixed navbar contents of section shown (no header of section). know how fix this? code below , demo here . thank you. <body data-spy="scroll" data-target="#affixsidebar" style="padding-top: 60px"> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="#"><i class="fa fa-cloud"></i><i&g

ruby - Rails / MongoDB: Variable to address object-attribute not translating -

in class aleshot have dynamic mongoid-attributes. in order index them, collect attributes in array called "dynamos". when want list these (see code below) get: undefined method 'dyn_f' #<aleshot:0x007f8f7ab18328> ideas why dyn_f-variable isn't translated correctly? <% @ale_shots.each |ale_shot| %> <tr> <td><%= ale_shot.name %></td> <% dynamos.each |dyn_f| %> <td><%= ale_shot.dyn_f %></td> <% end %> </tr> <% end %> that because dyn_f not defined field in model. access this ale_shot['dyn_f']

Google Custom Search How to Index Directory and All Sub Directories? -

i have added sitemap google webmaster tool single entry of http://mydomain/myforum.php at www.google.com/cse tried index both specific urls , urls in sitemap still google won't traverse , index links @ myforum.php. how google traverse , index links @ myforum.php?

java - Hough circle detection accuracy very low -

Image
i trying detect circular shape image appears have definition. realize part of circle missing i've read hough transform doesn't seem should cause problem i'm experiencing. input: output: code: // read image mat src = highgui.imread("input.png"); // convert gray mat src_gray = new mat(); imgproc.cvtcolor(src, src_gray, imgproc.color_bgr2gray); // reduce noise avoid false circle detection //imgproc.gaussianblur( src_gray, src_gray, new size(9, 9), 2, 2 ); mat circles = new mat(); /// apply hough transform find circles imgproc.houghcircles(src_gray, circles, imgproc.cv_hough_gradient, 1, 1, 160, 25, 0, 0); // draw circles detected for( int = 0; < circles.cols(); i++ ) { double[] vcircle = circles.get(0, i); point center = new point(vcircle[0], vcircle[1]); int radius = (int) math.round(vcircle[2]); // circle center core.circle(src, center, 3, new scalar(0, 255, 0), -1, 8, 0); // circle outline core.circle(src, center,

perl - Repalce IP address in Apache Log -

i have apache logs generated in format: 192.168.1.125 - - [25/may/2014:03:43:10 +0000] "post /myapp/getrequest?ip=88.125.88.88 http/1.1" 200 22 "-" "11.0" i wish swap first ip in files second i.e. swap 192.168.1.125 88.125.88.88. line should this: 88.125.88.88 - - [25/may/2014:03:43:10 +0000] "post /myapp/getrequest?ip=192.168.1.125 http/1.1" 200 22 "-" "11.0" reason being: want use awstats geolocation ip address in first column. way now, ip address of proxy server. customer's ip in part of request url. my system linux machine. not perl or sed, googling, came close to: perl -pe 's/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b -/xxxxxxxxxxx -/' access_log i not sure put xxxxxxxxxxx. ideas how can done? perl -pe's/^(\s+)(\s.*?[?&]ip=)([\d.]*)/$3$2$1/' access_log non-swapping version: perl -pe's/^\s+(\s.*?[?&]ip=([\d.]*))/$2$1/' access_log usage: perl -pe'...'

oracle - calling stored procedure from anonymous block -

i have problem reading result plsql stored procedure written in sql developer on oracle 11gr2 database on local machine. this table: create table my_test_table (employee_id number(6) ,first_name varchar2(20) ,last_name varchar2(25) ,email varchar2(25) ,phone_number varchar2(20)); this procedure declaration: create or replace package test_package procedure test_procedure (i_id in number, o_data out sys_refcursor); end test_package; this body: create or replace package body test_package procedure test_procedure (i_id in number, o_data out sys_refcursor) begin open o_data select employee_id, first_name, last_name, email, phone_number my_test_table employee_id = i_id; close o_data; end test_procedure; end test_package; and anonymous block call: set serveroutput on declare in_id number; my_cursor sys_refcursor; c

mysql - How Make a php array and insert it to db from CSV -

i have need upload data csv.my current code upload data correctly .but have need separate column data repeated suppose my csv column company | area |red show type | red show name | red show price | green show type | green show name | green show price | i want data in different table one table have company | area | these 2 data another table design is: id|show_type|show_name|show_price in csv red show type | red show name | red show price | green show type | green show name | green show price | these column contain same type of data 2 type of show red , green now how can insert data database csv try using explode php method using "|" delimeter. after should sorting code using ifs , elses

Java - what are characters, code points and surrogates? What difference is there between them? -

i'm trying find explanation of terms "character", "code point" , "surrogate", , while these terms aren't limited java, if there language-specific differences i'd explanation relates java. i've found information differences between characters , code points, characters being displayed human users, , code points being value encoding specific character, have no idea surrogates. surrogates, , how different characters , code points? have right definitions characters , code points? in another thread stepping through string array of characters, specific comment prompted question "note technique gives characters, not code points, meaning may surrogates." didn't understand, , rather create long series of comments on 5-year-old question thought best ask clarification in new question. to represent text in computers, have solve 2 things: first, have map symbols numbers, then, have represent sequence of numbers bytes. a

Sqlite slow but barely using machine ressources -

i have 500mb sqlite database of 5 million rows following schema: create table my_table ( id1 varchar(12) not null, id2 varchar(3) not null, date date not null, val1 numeric, val2 numeric, val2 numeric, val4 numeric, val5 integer, primary key (id1, id2, date) ); i trying run: select count(rowid) my_table the query has been running several minutes seems excessive me. aware sqlite not optimized count(*)-type queries. i accept if @ least machine appeared hard @ work. however, cpu load hovers somewhere around 0-1%. "disk delta total bytes" in process explorer 500.000. any idea if can sped up? you should have index fields query on this. create index tags_index on tags(tag); . then, sure query faster. secondly, try normalize table , have test (without having index). compare results.

mysql - having an issue with php dropdown menus -

so i'm working on project requires users select dropdown menu. using following code can manage slots 1 & 2 display value. inserting other slots value of 0 working, not displaying values. if isn't clear enough please let me know , can try provide more information. code follows; echo' <br/> slot 1 <select name="slot1">'; while($row = mysqli_fetch_array($result) , $i<10) { echo"<option value='"; echo$row['playerid']; // sorry inverted commas trickys echo"'>"; echo $row['name']; echo "</option>"; $i=$i+1; } echo '</select>'; echo' <br/> slot 2 <select name="slot2">'; $i=1; while($row = mysqli_fetch_array($result) , $i<10) { echo"<option value='"; echo$row['playerid']; // sorry inverted commas trickys echo"'>"; echo $row['name']; echo "</option>"; $

vb.net - Creating a self test program with save/import functions (images, description inside) -

Image
i'm trying create program allow me use textboxes input questions , associated answers test myself. mostly, want practice things i've been learning vb.net while taking step forward. here's mockup: any tips on how this? i'm not sure how have textfile save/import work adding comboboxes , making sure correct questions , answers associated 1 another. thinking have sort of check when import save file shows me questions , answers refer 1 another update on form design: some things i'm trying practice: using arrays saving/opening files (text files in this)- in order import program importing program using progress bar having way undo entries randomizing sort order in combo box maintaining references between variables (like answer corresponds question) regardless of sort order or using undo function some posts in stackoverflow i'm thinking of using reference: compare string strings in array best way associate 2 strings of text in vb.net a

share perl module state between tests -

i using test::more , have helper function takes while run. need use in several test scripts. save result of running function, state can accessed scripts. result of calling function not change each test. i have created module this: package helper; our $_global_state = under; sub helper { if ( !defined( $_global_state)) { #insert magic here set _global_state print stderr "inside magic\n"; } return $_global_state; } return 1; however, if call function several test scripts, redoes 'magic' each time. trying avoid if @ possible. can solved using following: save calculated state file. if file isn't last modified in 10 minutes, recalculate value. using storable : use strict; use warnings; use storable; our $state_file = 'global.state'; sub helper { # check see if file last modified in 10 minutes. if (-e $state_file && -m $state_file < 1/24/6) { return retrieve($state_file);

java - Cancel an operation on Toast -

i wrote jsoup html scraping class android project. custom class puts user-inputted zip code constructor, , parse html. works in asynchronous thread main thread. since there no right way deal incorrect zip codes, had check null in particular element, specifically: if(doc.select("div.columns").first().text() == null) { ((activity) context).runonuithread(new runnable() { public void run() { toast toast = toast.maketext(context, r.string.toast_parse_fail, toast.length_long); toast.show(); return; } }); } if particular element null (meaning no such data exists zip code), create toast user. why try wouldn't work in case, because jsoup , java doesn't know whether parse failed or not, since web page still loads fine; only, there no data, crash app nullpointerexception code following it. despite toast except

C struct, function pointer, and header problems (unsure which is the cause) -

so, i'm trying make binary tree program in c , keeps throwing darndest compile errors. whenever change find causing error, changes! have not forgotten include guards, used #pragma once. if place struct in header incompatible types, if put in .c redefinition of pretty_print goes away when rename pretty_print. trim out other functions in bintree.c , header, error changes inttree being undefined. if change inttree int becomes incompatible types. goes away if merge header .c. it's gone. think these might seperate errors , changing error might bad, happening have no idea why. present code demonstrates many of these, whenever try duplicate did throws different error. i'm not frustrated. able post well-formatted question helpful information, have none, despite spending several hours on program. bintree.cxx #include "bintree.h" int add(inttree* root,int key,void* val){ if(!root){ root=malloc(sizeof(inttree)); if(!root){ r

recursion - python recursive iteration exceeding limit for tree implementation -

i'm implementing tree dynamically in python. have defined class below class nodeobject(): def __init__(self,presentnode=none,parent=none): self.currentnode = presentnode self.parentnode = parent self.childs = [] i have function gets possible childs every node pool def findchildren(node, childs):` `# no need write whole function on how gets childs now have recursive function starts head node (no parent) , moves down chain recursively every node (base case being last node having no children) def tree(dad,children): child in children: childobject = nodeobject(child,dad) dad.childs.append(childobject) newchilds = findchildren(child, children) if len(newchilds) == 0: lastchild = nodeobject(newchilds,childobject) childobject.childs.append(lastchild) loopchild = copy.deepcopy(lastchild) while loopchild.parentnode != none: print "last child&qu

javascript - Angular: reference currently instantiated controller -

is there way reference instantiated controller object within controller's definition? i'd $compile modal , bind same controller that's creating modal. here's simplified version of i'd do, this_controller_instance reference controller instance. angular.module('foo') .controller('barcontroller', function($scope, $rootscope){ $scope.openmodal = function(){ var modalel = $('<div class="modal">modal stuff here</div>'); var controller = this_controller_instance; modalel.contents().data('$ngcontrollercontroller', this_controller_instance); $compile(modalel)($scope); $('body').append(modalel); } }); as noted above: the current controller this . solution problem is: angular.module('foo') .controller('barcontroller', function($scope, $rootscope){ var self = this; $scope.openmodal = function(){ var modalel = $('<div class="modal&

Python Error: maximum recursion depth exceeded in comparison in list -

so here construct #list1 , list2 list1 = [(true,), (true,)] list2 = [(true,), (true,)] #transformation list1[0] = list2 list1[1] = list1 list2[0] = list1 list2[1] = list2 which gives: #result #list1 = [ list2 , list1 ] #list2 = [ list1 , list2 ] when run code >>>list2 in list1 true >>>list1 in list1 runtimeerror: maximum recursion depth exceeded in comparison i believe error occurs because getting actual value of list1 comparison results in endless loop. however, list2 not result in error despite being constructed similarly. so question is, why there discrepancy in error? shouldn't "list2 in list1" cause error too? if list = [1,2,3] list.append(list) it doesn't this: list.append([1,2,3]) that'd creating new list. appends "reference" list. because copying things not fundamental types want (php jab removed) so do list.append(4) now: print(list[3][4]) will show 4, 3rd thing (4th start @ zero) li

C++ boost::mpl::type forward declaration -

i have following type: typedef boost::mpl::fold<hostobjecttypes, void, base>::type caclientobject; and need forward decleration of caclientobject. know how achieve it? i'd do struct caclientobject; /* forward */ and later struct caclientobject : boost::mpl::fold<hostobjecttypes, void, base> { };

javascript - How make a login system using ajax without refreshing the page -

i want make login system without refreshing page using button , ajax dont know how it. my problem code wont work if click button. how use ajax communicate myincludes.php if press button login? index.php <html lang="en"> <head> <script type="text/javascript"> $('#login').click(function(){ <?php include_once('myincludes.php'); ?> }); </script> </head> <body> <form method="post"> username: <input type="text" name="user" /><br /> password: <input type="text" name="pass" /><br /> <button type="button" name="login" id="login">login</button> </form> </body> </html> myincludes.php <?php session_start(); include_once('connection.php'); include_once('user.php'); if(isset($_post['submit'])){ $user = $_post['user']; $pass

webhdfs - Hadoop Rest API for upload / download -

i trying perform upload/download file hadoop cluster, using c# app, couldn't find apis upload , download documentation. so can please let me know how upload , download files hadoop using restapis? thanks you can use webhdfs rest api described here http://hadoop.apache.org/docs/r1.0.4/webhdfs.html edit: create , write file step 1: submit http put request without automatically following redirects , without sending file data. curl -i -x put "http://:/webhdfs/v1/?op=create [&overwrite=][&blocksize=][&replication=] [&permission=][&buffersize=]" the request redirected datanode file data written: http/1.1 307 temporary_redirect location: http://:/webhdfs/v1/?op=create... content-length: 0 step 2: submit http put request using url in location header file data written. curl -i -x put -t "http://:/webhdfs/v1/?op=create..." the client receives 201 created respo

Timer in button c# .net -

i have button want timer in it, 30 sec , when elapsed button enable. buttons download files. 1)is ok if in page_load() write timer , start it? 2)how make change on time in button.text? 3)how make when in elapsed button enable? thanks, or is question webforms? can't use .net timer. can use javascript timer. somewhere near bottom of page: <script type="text/javascript"> (function() { var button = document.getelementbyid("the_button_id"); button.disabled = true; settimeout(function() { button.disabled = false; }, 30000); })(); </script>

asp.net mvc - Different Request.Browser values on deployed app -

i'm working on mvc4 application, , 1 of tasks i've had detect browser/device request sent. naturally, used mvc's request.browser object this: var browser = request.browser.browser; var devicemanufacturer = request.browser.mobiledevicemanufacturer.tolower() != "unknown" ? request.browser.mobiledevicemanufacturer : "desktop"; var devicemodel = request.browser.mobiledevicemodel.tolower() != "unknown" ? request.browser.mobiledevicemodel : "desktop"; however, seems when making request localhost ie, correct browser shown in 'browser' property. however, when making request deployed app, instead of saying 'internetexplorer', browser property set 'mozilla'. another issue related devices seem detected iphones , ipads, although our qa told tested kindle fire, android devices well. i'm not sure user-agent in cases update question find out. any appreciated