Posts

Showing posts from May, 2014

sql: how to select all records with field set to 0 and set the value of that field to one -

is possible in 1 sql statement? pointer nice sql tutorial on subject appreciated. know can use command select * mytab myfield = 0 , use server script go through result , update myfield of result rows. wouldn't work? update mytab set myfield=1 myfield=0 edited add: if interested in sql tutorials, lightweight 1 has nice feature of allowing edit , run sql commands in webpage see how work w3schools here: http://www.w3schools.com/sql/

javascript - Onclick of Checkbox,place the checked value into a textbox and delete the unchecked value from textbox -

my code: <!doctype html> <meta charset="utf-8"> <html> <head> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <script type="text/javascript" src="http://cdn.datatables.net/1.10.9/js/jquery.datatables.min.js"></script> <script type="text/javascript" src="https://raw.githubusercontent.com/mpryvkin/plugins/master/pagination/simple_numbers_no_ellipses.js"></script> <link rel='stylesheet' href='style.css'> <link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.9/css/jquery.datatables.min.css"> </head> <body> <div> <form action="/home/divya/html_docs/click.html" method="pos...

angularjs - How to generate an HTML table from the following Hierachical Json? -

Image
i have got json this, can find complete json in plunker "name": "total", "imageurl": "", "type": "total", "children": [ { "name": "motor car", "imageurl": "", "type": "motor car", "children": [ { "name": "private", "imageurl": "", "type": "private", "size": 9221 }, { "imageurl": "", "type": "hiring", "name": "hiring", ...

java - Unable to configure resource mapping in spring framework 4.2.1 release -

i tried develop web project using spring framework 4.2.1 release raised error in resource mapping. can't find mapped resources(image,css,javascript, etc.) -myservices-servlet.xml <context:annotation-config/> <context:component-scan base-package="com.mv.services"/> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix" value="/web-inf/views/pages/" /> <property name="suffix" value=".jsp" /> </bean> <bean id="tilesviewresolver" class="org.springframework.web.servlet.view.urlbasedviewresolver"> <property name="viewclass" value="org.springframework.web.servlet.view.tiles3.tilesview" /> <property name="order" value="1"/> </bean> <bean id="tilesconfigurer" class="org.springframe...

gridview - yii dataprovider returns error 500 -

i tried defining dataprovider cgridview in yii getting error 500: trying property of non-object the following model , view/admin.php code snippets model.php: public function search2() { $sql='select family_tree.tree_creator_id, c.user_fullname, family_tree.tree_user1_id, a.user_fullname, family_tree.tree_user2_id,b.user_fullname, family_tree.tree_type, family_tree.tree_type_name family_tree join user on a.user_id=family_tree.tree_user1_id join user b on b.user_id=family_tree.tree_user2_id join user c on c.user_id=family_tree.tree_creator_id '; if($this->tree_creator_id!=null) { $sql.="where family_tree.tree_creator_id='$this->tree_creator_id'"; } $a= yii::app()->db->createcommand($sql) ->queryall(); return new carraydataprovider($a, array( 'id'=>'family-tree', 'keyfield'=>'tree_id')); } admin.php: ...

performance - How to fill redis with redis-cli with dummy data of size weigh hundreds of MB? -

i getting hand dirty redis monitoring. far came metrics useful monitor redis: memory_used through put latency connections replication i newbie on this. trying fill redis redis-cli dummy data as: in `seq 10000000`; redis-cli set users:app "{id: '$i', name: 'name$i', address: 'address$i' }" ; done doesn't scale need fillup redis-db fast enough... also need regarding latency , throught put monitoring. know mean, don't know how measure them... eyes don't see rellated on output redis-cli info thanks, support/guidence :d to "fill fast", follow instructions in documentation mass insert - gist using --pipe directive on pre-prepared data file.

How to create a cocos2d-x's PhysicsBody that does not rotate -

i'm using cocos2dx write simple game. wanted use cocos2dx's physics engine don't need object rotate it's initial direction. turns out can't find way it. tried put static physics body , attaching other bodies physicsjoinmotor or physicsjointgear o avail. ideas on how accomplish this? body->setrotationenable(true);

json - Python and Pandas: UnicodeDecodeError: 'ascii' codec can't decode byte -

after using pandas read json object pandas.dataframe , want print first year in each pandas row. eg: if have 2013-2014(2015) , want print 2013 full code (here) x = '{"0":"1985\\u2013present","1":"1985\\u2013present",......}' = pd.read_json(x, typ='series') i, row in a.iteritems(): print row.split('-')[0].split('—')[0].split('(')[0] the following error occurs: --------------------------------------------------------------------------- unicodedecodeerror traceback (most recent call last) <ipython-input-1333-d8ef23860c53> in <module>() 1 i, row in a.iteritems(): ----> 2 print row.split('-')[0].split('—')[0].split('(')[0] unicodedecodeerror: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128) why happening? how can fix problem? your json data strings unicode string, can see ...

javascript - How to do parallel Ajax request with jQuery for Posting and Commenting Mechanism -

i using asp.net mvc, trying make post , comment mechanism,i can comment , post , add them database in different tables, can take comment database index.cshtml page ajax request via jquery. have try take post , post's comment simultaneously, have created paralel() function given below not have idea how take comment , post simultaneously in function. me? thanks. getposts(): function getposts() { var tosend = new object(); if (timestamoflastpost == null) { tosend.timestampfrom = 4294967295;//max_int } else { tosend.timestampfrom = timestamoflastpost; } tosend.numberofposts = 2; $.ajax({ url: '/home/getposts', type: 'post', contenttype: 'application/json', data: json.stringify(tosend), datatype: "json", async:true, success:function (data) { $.each(data.postlist, fun...

c# - Understanding list of objects based View syntax ASP.NET MVC -

hi created view using visual studio template should display list of objects. here syntax visual studio generated: @model ienumerable<testmvcapplication.models.product> @{ viewbag.title = "index"; } <h2>index</h2> <p> @html.actionlink("create new", "create") </p> <table> <tr> <th> @html.displaynamefor(model => model.name) </th> <th> @html.displaynamefor(model => model.available) </th> <th> @html.displaynamefor(model => model.price) </th> <th></th> </tr> @foreach (var item in model) { <tr> <td> @html.displayfor(modelitem => item.name) </td> <td> @html.displayfor(modelitem => item.available) </td> <td> @html.displayfor(m...

c# - How to map property of type `Object` with different datatypes to a corresponding classtype? -

i have 2 classes: public class a{ [system.xml.serialization.xmlelementattribute("type1", typeof(xmlitemtype1), isnullable=true)] [system.xml.serialization.xmlelementattribute("type2", typeof(xmlitemtype2), isnullable=true)] public object item { get; set; } } public class b{ public object item { get; set; } } mapping created follows: automapper.mapper.createmap<a, b>() .formember(domainobject => domainobject.item , metadata => metadata.mapfrom(xmlobject => xmlobject.item )); automapper.mapper.createmap<xmlitemtype1, xmlobjecttype1>(); automapper.mapper.createmap<xmlitemtype2, xmlobjecttype2>(); automapper.mapper.map<a, b>(data); but output property of b class item of type xmlitemtype1 instead of xmlobjecttype1 . how can make sure after mapping item of type xmlobjecttype1 or xmlobjecttype2 ?

c# - Notifications for tracked changes in EntityFrameworks DbContext -

i building data entry app using entity framework user can fill out forms , save or cancel. want save button enabled when there actual data can saved database. i know dbcontext.changetracker. not able find possibility notification form context whenever there changes. of couse track manually, tedious , error prone. update app winforms application question: how can notification dbcontext when "is dirty/has changes"? update 2 maybe can clarify question: this don't want: using(var ctx = new dbcontext()) { var foo = new fooentity(); ctx.add(foo); raisecontextisdirty(); //<-- don't want this, should automatic //..... ctx.savechanges(); raisecontextisclean(); //<-- don't want this, should automatic } what looking this: using(var ctx = new dbcontext()) { ctx.changetracker.ondirtychanged += contextdirtychanged; var foo = new fooentity(); ctx.add(foo); //<- fires ondirtychanged //..... ctx.savechanges(); //<- ...

codeigniter - I want to call controller using javascript -

here, using codeigniter. want call controller method using javascript view called. want call view method after 1 second. want call popup dashboard, called using controller. dashboard "user_view.php" . view of "user_home.php", want call "break_alert.php". here code: controller: function alert_breaktime() { $this->load->view('break_alert'); } view: user_view.php: <script type="text/javascript"> var timer = settimeout(function() { alert('adsfadf'); window.location.href = "<?php echo site_url('welcome/alert_breaktime');?> },1000); </script> break_alert.php: <script src="<?=base_url()?>resource/js/jquery-2.1.1.min.js"></script> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class=...

java - Move files to a nas with javacode and rename my files -

good morning guys, i'm french dont have beautiful english ^^ problem in code, want move files nas path("\nas-tps\commun-tps") it's not correct netbeans tells me wrong (in class parcourir.java jfilechooser) how can put path ? my class parcourir: package ged; import java.io.file; import java.io.ioexception; import javax.swing.jfilechooser; /** * * @author evan */ public class parcourir { public void enregistrer() throws ioexception { jfilechooser newdestination = new jfilechooser(); newdestination.setcurrentdirectory(new file("\\nas-tps\commun-tps"));//chemin newdestination.setacceptallfilefilterused(false); newdestination.setfileselectionmode(jfilechooser.directories_only); newdestination.setmultiselectionenabled(false); newdestination.showopendialog(null); int des...

php - Magento: add block with child blocks to cms_index_index -

maybe i'm going wrong way, i'm quite new magento , don't know better. i'm trying add block front page, believe cms_index_index (is correct?). works: <cms_index_index> <reference name="content"> <block type="core/template" name="start_recs" as="start_recs" template="path/to/recommendations.phtml"></block> </reference> </cms_index_index> but in recommendations.phtml, want reference block, addtocart_special.phtml. did in other catalog blocks , worked fine, somehow cannot make work in cms_index_index. tried this: <cms_index_index> <reference name="content"> <block type="core/template" name="start_recs" as="start_recs" template="path/to/recommendations.phtml"> <action method="setblockid"><block_id>start-recs</block_id></action> ...

c# - Open .net windows form after event finishes -

i'm having windows mobile ce application written in c# .net cf. consider have 2 forms in application: list of objects (has listview) details page (should appear when selected in previous listview) currently i'm attaching callback listview's selectedindexchanged event, , open new form there. new form opens okay (in midde of event callback), when close form( this.close() ), list page isn't clickable first time, after first click ui interactable again. also the listviewitem clicked @ first step doesn't selected(blue background). here's short (12s) video showing problem: http://take.ms/urkme see video, after coming details screen, refresh button doesn't click on first click.. i'm showing details form so: private void listview_selectedindexchanged(object sender, eventargs e) { (new formdetails()).showdialog(); } is there way show details form after event finishes, or doing wrong? ps! tried same button , it's click event,...

node.js - react native init error stay in node postinstally -

i fllowed steps refer offical articles,but there wrong this this walk through creating new react native project in /users/meyou/object/hello utf-8-validate@1.2.1 install /users/meyou/object/hello/node_modules/react-native/node_modules/ws/node_modules/utf-8-validate node-gyp rebuild cxx(target) release/obj.target/validation/src/validation.o solink_module(target) release/validation.node bufferutil@1.2.1 install /users/meyou/object/hello/node_modules/react-native/node_modules/ws/node_modules/bufferutil node-gyp rebuild cxx(target) release/obj.target/bufferutil/src/bufferutil.o solink_module(target) release/bufferutil.node spawn-sync@1.0.13 postinstall /users/meyou/object/hello/node_modules/react-native/node_modules/yeoman-generator/node_modules/cross-spawn/node_modules/spawn-sync node postinstall | the cursor lling bling whole day

php - How to only shown one table after clicking search button? -

Image
i have 2 tables when search member name. link : i wanted search result shown after search. my code: <div id = "subtitle"> view members </div> <div id = "searchbox"> <form method="post"> <center><input type="text" maxlength="100" required placeholder="enter full name" name ="search" autocomplete="off" value=""> <input type="submit" name="btn" value="search now!"></p></center> </form> </div> <?php if(isset($_post["btn"])) { $search = $_post["search"]; $sql = "select * member member_name '$search%' "; $result = mysqli_query($conn,$sql); $rowcount = mysqli_num_rows($result); if($rowcount==0) ...

c# - Passing Parameters in URL containing special characters using javascript -

this question has answer here: encode url in javascript? 12 answers hi trying call action result in controller containing parameters, whenever 1 of these parameter contains # sign(special character) string parameters not include # sing in parameter , next parameters set null. following java script through calling action result. <script type="text/javascript"> $(document).ready(function () { $('#btnexport').unbind().click(function () { var url = @url.content("~/bankstatement/exportbankstatementsummary") + "?legalname=" + '@viewbag.legalname' + "&dba=" + '@viewbag.dba' + "&contactperson=" + '@viewbag.contactperson' + "&address=" + '@v...

unity3d - Get Texture2D of gameObject -

i'm having problem getting texture2d of gameobject. my gameobject has sprite renderer contains texture type of advance read/write enabled checked. here code: spriterenderer go; void start () { go = getcomponent<spriterenderer> (); } void update () { print (go.material.maintexture.height); } i want display height, feel once can whatever want every pixel of it. instead of taking texture material, remember spriterenderer component, therefore has sprite on it, not regular texture, try taking texture2d directly sprite. print(go.sprite.texture.height); also if not work you, tell getting easier understand problem.

java - jOOQ: Allowed-Character constraints? -

i considering moving hibernate jooq can't find e.g. how have pattern-constraints on string in hibernate: @notempty(message = "firstname cannot empty") @pattern(regexp = "^[a-za-z0-9_]*$", message = "first name can contain characters.") private string firstname; how in jooq? the "jooq way" the "jooq way" such validation create either: a check constraint in database. a trigger in database. a domain in database. after all, if want ensure data integrity, database such constraints , integrity checks belong (possibly in addition functionally equivalent client-side validation). imagine batch job, perl script, or jdbc statement bypasses jsr-303 validation. you'll find corrupt data in no time. if want implement client-side validation, can still use jsr-303 on dtos, interact ui, instance. have perform validation before passing data jooq storage ( as artbristol explained ). using converter you could, how...

c# - Error: 'Flow': member names cannot be the same as their enclosing type -

using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace cofbalu { class strongno { static int factorial(int rem) { if (rem == 1) return 1; else return factorial(rem - 1) * rem; } static int strongno(int n) { int rem=0,strong=0; while (n > 0) { strong = strong + factorial(rem = n % 10); n = n / 10; } return strong; } static void main() { console.write("enter no: "); int n = int.parse(console.readline()); if (strongno(n) == n) console.write("yes, "+n+" strong no."); else console.write("no, " + n + " not strong no."); console.readline(); } } } your method static int strongno(int n) having same name class name. , method name have name of class called constructor. , constructors not have return type. so can try rename function this: static int strongnumber(int n)

javascript - Spring MVC Sending Model data from View to Controller without having a form -

i got 2 pages 1 displays data , other serves edit page of fields. display model data in first view. if user clicks edit button, other view takes control. here problem: hence dont need form element in first displayer page, can not pass model data second view (editter page). there efficient way of passing data view controller without adding form element? spring mvc pass same object between controller the best rated answer in thread might give clue.

php - Calling a form through another form (button) -

i'm trying add db info through form called after pressing button part of form. more exactly, after pressing button, form printed, this: <?php if(isset($_post['x'])) { if(isset($_post['submit'])) { $msg=mysqli_real_escape_string($_post['msg']); mysqli_query($conn, "insert user_posts (msg) values ('$msg')"); } ?> <form method="post"> <textarea name="msg" cols="100" rows="10"></textarea> <input type="submit" name="submit" value="submit"/> </form> <?php } ?> <form method="post"> <button type="submit" name="x">press this!</button> </form> after press post['x'], form textarea appears intended, if press "post[submit]", page shows first button , can't figure why no info added db. don...

java - Menu accelerator SWT.ALT+SWT.ARROW is not triggered -

i'm using swt 4.4.2 (win32) build graphical user interface simple mp3 player application. in swt tree show folders , files play. want change volume of playing file clicking menu item , pressing alt+arrow_up , alt+arrow_down . so have these components: tree = new tree(shell, swt.border | swt.full_selection | swt.single | swt.v_scroll); tree.setlinesvisible(true); tree.setlocation(10, 10); tree.setsize(240, 440); audioloudermenu = new menuitem(audiovolumemenu, swt.push); audioloudermenu.setaccelerator(swt.alt | swt.arrow_up); audioloudermenu.settext("louder"); audioloudermenu.addlistener(swt.selection, audiovolumemenuhandler); audioquietermenu = new menuitem(audiovolumemenu, swt.push); audioquietermenu.setaccelerator(swt.alt | swt.arrow_down); audioquietermenu.settext("quieter"); audioquietermenu.addlistener(swt.selection, audiovolumemenuhandler); the problem if tree view has focus , press alt+arrow_down entry in tree selected , not shortcut of men...

Getting control back to a procedure in SQL Server -

i have procedure calls etl. there way can control procedure once etl finishes run? there way can control procedure in between etl runs? thanks! i suggest create job. , this x step procedure x+1 step ssis x+2 step next things. because can exec job sql, , can controll steps. another solution think exec bat file ssis exec command in it. another solution use "traffic light" store exec etl , after wait ssis (the ssis before finish, set flag on table)

ios - Make image the same as camera view -

i using uiimagepickercontroller taking photo. full size photo using method var cameraaspectratio : cgfloat = 4.0 / 3.0; var imagewidth = floorf(float(screensize.width * cameraaspectratio)); var data = float(screensize.height)/imagewidth var scale = cgfloat(ceilf((data * 10.0) / 10.0)) cameraviewtransform = cgaffinetransformmakescale(scale, scale) but after capturing image, view saw in camera layer different photo(photo takes more view in, bigger) i want make photo, , output photo same scale , view, using whole fullscreen overlay. can advice some? i took link in 1 of project: uiimagepickercontroller doesn't fill screen hope helps.

playframework 2.0 - Play sbt Hibernate -

i have play application in sbt project , integrated hibernate validator gives me huge load of debug logging. want change log level. project has typical play/sbt architecture : project ---app ---conf ---project ---target ---test ---build.sbt i checked hibernate dependencies seems use log4j. nows file have create , put ? in debug logs seems meta-inf/validation.xml if tells something. in config file specify log level hibernate. f.e. in application.conf file logger.org.hibernate=error or specify package f.e. logger.org.hibernate.<pack_level_1><.pack_level_2><.classname>=error logger.org.hibernate.validator=error

c# - How to display output in the same culture that was entered using "double.Parse(str, CultureInfo.InvariantCulture);"? -

i'm pretty new c# , .net , programming on windows in general. here code: using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using system.globalization; namespace myapp { class program { static void main(string[] args) { string linebreak = "\r\n"; string str = console.readline(); double number = double.parse(str, cultureinfo.invariantculture); console.writeline("you've entered: " + number + linebreak + "variable type:" +number.gettype()); console.writeline("press key exit . . ."); console.read(); } } } if enter double "32,45" (notice there comma separator), output this: you've entered: 32,45 variable type: system.double but when enter double variable "32.45" (notice, there dot instead of comma), output this: you've entered...

swift2 - reflect property value on swift 2.0 -

how can fetch property value on swift 2.0? on swift 1.0, can mirror value value property, cannot find api this. new mirror type on swift 2.0 has few api. there other way achieve this? this usage of reflection swift 2. let mirror = mirror(reflecting: obj) child in mirror.children { guard let key = child.label else { continue } let value = child.value // use value or key here }

c++ - Access violation in MiniDumpWriteDump when invoked out-of-process -

the documentation of minidumpwritedump function states minidumpwritedump should called separate process if @ possible, rather within target process being dumped. so wrote small mfc crash handler program that. followed advice in this answer hans passant, i.e. passing value of exception pointer crashing program crash handler program though exception pointer not valid in context of crash handler program. works when run tests in debug build, when switch release build crash handler program crashes, access violation occurs inside minidumpwritedump function. i stumped. why should work in debug builds, not in release builds? it's maddening because access violations indicators accessing invalid pointers, , exception pointer receiving in crash handler program indeed invalid - on other hand told should not matter, minidumpwritedump interpreting pointer in context of crashing process (from pointer originated). any ideas doing wrong? on sidenote: in answer, hans proposes ...

c++ - epoll_wait() in a thread after close() -

i have main thread , worker thread. worker thread's code looks this: thread = ::std::thread([this]() { struct epoll_event events[50]; (;;) { if (int const n = epoll_wait(efd, events, 50, -1)) { //... i hoping close(efd) in main thread cause worker thread's epoll_wait() call return, doesn't happen. can exit worker thread's infinite loop? your best bet use explicit signal (by mean, signal in ordinary sense; not posix signal) main thread epoll worker thread. the technique of using pipe purpose tried , true, there better options: check out eventfd . use it, create eventfd file descriptor , add epoll set. signal main thread writing 8-byte value (a value of 1 fine). when worker thread sees event on eventfd, knows has been signalled , should act accordingly. the main advantage on using pipe requires single file descriptor, , don't have worry possibility of blocking when write pipe.

ios - duplicate library issue in XCode -

i have been facing issue in project when build project. i integrated third party framework contains same jsonmodel library have used in project. causes duplicity when project build. is there way solve without removing jsonmodel project. note: have not defined -all_load flag in 'other linker flags' in build settings. any appreciable.

css - Button shakes on hover -

i'm having trouble while hovering buttons. seem shake when mouse not entirely on button. i've made jsfiddle can see mean: http://jsfiddle.net/h93jkxck/ i've tried give min-height it's still shaking. its because change position on hover, not hovered anymore... , looks "shaking" try this: .btn-social{ color: #000; margin-top:0em; position: relative; padding-left: .75em; padding-right: .75em; font-size: .85em; } .hover-helper:hover{ padding-top: 1em; } div{ float:left; } <div class="hover-helper"><button class='btn-social'>facebook</button></div> <div class="hover-helper"><button class='btn-social'>google</button></div>

batch file - Missing url parameters values after running powershell script as scheduled task -

i have powershell script gets name of computer string , processes running on json array, creates parameters variables, makes web request url , has 2 parameters sent through post method shown below: $comp_id = (get-wmiobject win32_operatingsystem) | select-object csname | format-table -hidetableheaders | out-string $processes = get-process | where-object {$_.starttime -ne $null -and $_.mainwindowtitle.length -gt 10} | select-object id,description,fileversion,mainwindowtitle,starttime| convertto-json # create parameters variables $param1= @{id=$comp_id} $param2 = @{data=$processes} #the variable $process json array string $bothparams = $param1+$param2 invoke-webrequest -uri http://my.webserver.comp:8080/galileo/peeker -method post-body $bothparams everything ok when run script directly i.e both parameter values accesible servlet. i want run script scheduled task i've created batch script file calls powershell script. problem when script runs scheduled task, second par...

Memory efficient datastructure for hashmap (c++) -

the scenario kind of simple. i value, in range between 0 , 2^x (x~27) . use value key hashmap. in hashmap store index (source of value). x may greater 27, have use memory efficient data structure. first tried unordered_multimap, there big overhead, disqualifying it. tried unordered_map of vectors. increasing number of vectors in map, overhead big. thought of using 2d array reallocating dynamic size. learned here on stackoverflow calling 2^27 times "malloc()" creates overhead, tried this: uint64_t length = (uint64_t) pow(2.0,27); uint64_t ** hashmap; hashmap = (uint64_t **) malloc(sizeof * hashmap * length); uint64_t * values = (uint64_t *) malloc(sizeof * values * 3 * length); for(int = 0;i<length;i++) hashmap[i] = values + 3 * i; //destroys whole datastructure hashmap[0] = (uint64_t *) realloc(hashmap[0],sizeof*hashmap[0]*4); i allocate 3 * siezof * values keep track of actual length , maximal length of bucket. comment says reallocating destroys whole...

javascript - jQuery button to send parameters not direct to correct URL -

i have following button call method , send parameters method <input type="button" id="report" data-baseurl="@url.action("reportexport", "home")" value="generate report" class="btn btn-success submit" /> this script $('#report').click(function () { // build url var reporturl = $(this).data('baseurl') + '?id=' + "pdf" + '&type=' + $('#type').val() + '&category=' + $('#category').val() + '&country=' + $('#country').val() + '&subsidary=' + $('#subsidary').val() + '&datehere=' + $('#date').val(); // redirect location.href = reporturl; }); this controller class public actionresult reportexport(string id, string type, string category, string country, string subsidary, string datehere) { ............. } but once click button directing url...

android - How to change font size by adb command -

how change device font size using adb. tried below command. wanted change supported small, medium, huge font "adb shell wm size 720*1200" try this: adb shell wm density 300

javascript - Properly formatting date for display in firefox -

i have date $scope.newd = '2015-08-11 12:36:33.649'; coming backend json. in ui want display 11/08/2015. i using date.parse($scope.newd) convert , format. not work in ff. how do this? for cross-browser compatibility, date string converted "-" "/" removing time, $scope.olddate = '2015-08-11 12:36:33.649'; $scope.newd= $filter('date')(new date($scope.olddate.split(" ")[0].replace(/-/g,"/")), 'dd/mm/yyyy'); refer link : http://dygraphs.com/date-formats.html

windows - Batch script which moves ".log" files into a new folder based on date -

batch script move .log files of month new folder move d:\source\log\*.log* d:\destination\log\backup here sample move files older n days or dd/mm/yyyy . but have check in forfiles /? if date format regional. in case it's dd/mm/yyyy the following batch match every *.log older 30/08/2015 every 30/08/2015, 29/08/2015, 28/08/2015......01/01/1970 matched. @echo off set "source=d:\interfaces\clarity_transaction_interface\log" set "destination=d:\interfaces\clarity_transaction_interface\log\backup" forfiles /d -30/08/2015 /p "%source%" /m *.log /c "cmd /c echo move @path \"%destination%\"" exit /b

Facing Error while applying excel formula in Macro -

i have below type of values in column j in excel <a href="http://twitter.com" rel="nofollow">twitter web client</a> and, have used formula =right(left(j2,len(j2)-4),len(left(j2,len(j2)-4))find(">",left(j2,len(j2)-4),2)) to value "twitter web client. when tried apply macro using below code in not getting value. me in code applying formula in entire range of 'q' column referencing 'j' column sub enter_formula() range("q2").formula = "=right(left(j2,len(j2)-4),len(left(j2,len(j2)-4))-find(" > ",left(j2,len(j2)-4),2))" end sub you try this lastrow = activesheet.usedrange.rows.count msgbox lastrow 'this give user range value used enter formulaa in rows range("q2:q" & lastrow).formula = "=left(right(rc[-7],len(rc[-7])-find("">"",rc[-7],2)),len(right(rc[-7],len(rc[-7])-find("">"",rc[-7],2)))-4)...

android - Importing external jars and Gradle error -

i see many other users have encountered error gradle: error: package <...> not exist , i've tried following various suggestions no avail. appreciated. my project imports conceal jar external library, not sit inside libs . here's tree: ⇒ tree -l 3 . ├── myapplication.iml ├── app │   ├── app.iml │   ├── build │   │   ├── generated │   │   ├── intermediates │   │   ├── outputs │   │   └── tmp │   ├── build.gradle │   ├── libs │   │   └── libs.zip │   ├── proguard-rules.pro │   └── src │   ├── androidtest │   └── main ├── build │   └── intermediates │   └── dex-cache ├── build.gradle ├── gradle │   └── wrapper │   ├── gradle-wrapper.jar │   └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── local.properties └── settings.gradle my app/build.gradle looks below buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.0.0' } } appl...

python - Incorrect number of bindings SQL -

i'm generating n random numbers between 0-100. n relies on amount of rows there in table_1. there's 200 rows. 200 random numbers in list returned. i'm trying insert these 200 numbers list individual rows table_2's random_number column. there no link between random numbers , 3 other columns in table_2. r = [random.randint(0,100) rows in cursor.execute('select * table_1')] r in rows: cursor.execute('update table_2 set random_number = (?)', r) this have. a programmingerror: incorrect number of bindings supplied. current statement uses 1, , there 4 supplied error. i've seen other solutions ad (?, ) doesnt work. i've tried: r = [random.randint(0,100) rows in cursor.execute('select * table_1')] r = str(r) cursor.execute('insert table_2 (random_number) values (?)', [','.join(r)]) which running, nothing being inserted random_number column. i think problem r...

c++ - CreateFileMapping error code 8 -

createfilemapping error code 8.not enough storage available process command. im trying create file mapping 4 gb (0xffffffff) on 64bit win10 visual c++. #define ubs_mem_size 0xffffffff handle hmapobject = createfilemapping(invalid_handle_value, nullptr, page_readwrite, hiword(ubs_mem_size), loword(ubs_mem_size), text("dllmemfilemap")); how can solve "error 8" problem? createfilemapping(..., hiword(ubs_mem_size), loword(ubs_mem_size), ...) the lo/hiword macros generate word, 16-bit value. asking 0xffff0000ffff memory-mapped file. that's 282 terabytes. current x64 processors limited 48-bit vm-address, top out @ 8 terabytes. yes, error 8 (error_not_enough_memory) entirely expected. don't use macros. can use large_integer alternative: large_integer size; size.quadpart = ubs_mem_size; handle hmapobject = createfilemapping(..., size.highpart, size.lowpart, ...);

android - OutOfMemoryException issue using Picasso -

our application image resource heavy. don't have provision of sending images depending on device resolution server. images sent server of high resolution (around 900 x 900). have few queries : 1) image downloaded , stored in file disk cache of same size original size in server. 2) once image saved in file disk cache, how image processed bring in in-memory cache. bitmap image stored in in-memory cache transformed lower resolution depending on device resolution? 3) if target image height , width not known how can scale down bitmap image per device resolution? per our requirement, not possible give fixed width , height imageview. there resize(int, int) method problem is, can't change image height , width in cases. ideally, there should solution downscale image size % (lets 20%). crash not occur depends of memory. you can use android:largeheap="true" request larger heap size, not work on pre honeycomb devices. on pre 2.3 devices, can use vmruntime clas...

node.js - Should dependencies be installed with bower or broccoli in ember app? -

i'm new js package managers , build tools seems bit confusing me. i've set new ember app , want add dependencies (foundation) in recommended/conventional way. there seem 2 ways of adding project, using bower or broccoli. this page recommends using broccoli: if want use .scss version of foundation, should first configure project use broccoli-sass with: npm install --save-dev broccoli-sass , rename app/styles/app.css app/styles/app.scss. can install foundation using bower with: bower install --save-dev foundation now, inside app/styles/app.scss, can import foundation styles with: @import 'bower_components/foundation/scss/normalize'; @import 'bower_components/foundation/scss/foundation'; whereas this recommends using bower. $> bower install --save bootstrap afterwards add following 2 lines ember-cli-builds.js (or brocfile.js if using older version of ember.js): app.import(app.bowerdirectory + '/bootstrap/dist/js/bootstrap.js'); app.i...

mysql - SUM(quantity) 00:00 - 23.59 Yesterday -

based on how make interval entire day 00:00 - 23.59 ( yesterday ) select sum(quantity) downloads date>=current_date() , date<current_date() + interval '1' day try it- select sum(quantity) downloads date>=concat(subdate(curdate(), interval 1 day),' 00:00:00') , date<= concat(subdate(curdate(), interval 1 day),' 23:59:59') or can use- select sum(quantity) downloads date>=subdate(curdate(), interval 1 day) , date< curdate();

Error: Syntax error, unrecognized expression: javascript:TagPopup_OpenForm( -

i getting error.it running on localhost. error: syntax error, unrecognized expression: javascript:tagpopup_openform("tagpopup_formcontainer1","tagpopup_formcontainerbody1","tagpopup_formcontainerfooter1"); this shortcode function in wordpress plugin $siteurl = "'" . home_url() . "'"; $close = 'javascript:tagpopup_hideform("tagpopup_formcontainer1","tagpopup_formcontainerfooter1");'; $open = 'javascript:tagpopup_openform("tagpopup_formcontainer1","tagpopup_formcontainerbody1","tagpopup_formcontainerfooter1");'; $html = "<a href='" . $open . "'><div class='login-user'>login</div></a>"; $html .= "<div style='display: none;' id='tagpopup_formcontainer1'>"; $html .= "<div id='tagpopup_formcontainerheader'>"; $html .= '<div id="tag...

android - Exception in DrawerLayot component after switching to appCompat and v4 to 23.0.1 -

i working drawer layout , after updating app build version 23.0.1 ,i facing below exception java.lang.nosuchmethoderror: no static method getlayoutdirection(landroid/graphics/drawable/drawable;)i in class landroid/support/v4/graphics/drawable/drawablecompat my drawer layout .xml file below <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include layout="@layout/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" /> <viewstub android:id="@+id/ac...