Posts

Showing posts from September, 2015

c - Making file wrap around when using fwrite -

c - Making file wrap around when using fwrite - i using embedded scheme running linux.i utilize ramdisk filesystem on embedded target. application captures real-time info , standard c "fwrite" file in ramdisk fs.as there limited amount of memory , set max size file , cause fwrite wrap around circular buffer. there way in manner transparent application ? prefer application remain unchanged when migrate filesystem on storage device (esata) having much larger capacity. there's no built in method of achieving this. the best alternative write little wrapper function takes care of file write while maintaining count of number of bytes written. once has reached maximum size set should phone call rewind() (or fseek() etc.) go start of file. it might easier utilize mmap() memory map file , treat circular buffer. 1 time again need implement wrapping yourself. c linux embedded ramdisk

objective c - Should NSWindowController always be the superclass of a window controller? -

objective c - Should NSWindowController always be the superclass of a window controller? - when reading apple's cocoa tutorial, window controller regular class , while understand fine suppose, wouldn't improve subclass nswindowcontroller? if right, nswindowcontroller convenience class has lot of functionality required window controller implemented, right? is there reason why not utilize class? you don't have to. i've implemented controllers window inherited nsobject , if didn't need added functionality of nswindowcontroller . objective-c cocoa nswindowcontroller

flex - Is it possible that zipping an swf file results in a bigger file? -

flex - Is it possible that zipping an swf file results in a bigger file? - when gzip swf file, size goes 1,21 mb 1,86 mb... so, question bit answered myself. real question how possible? guess, colleague of mine said, swf binary , can't compressed anymore. conclusions zipping swf files shouldn't done. swf encoded, , encoding includes compression. it's possible if intend compress compressed file, compression result in bigger file. happens when seek zip jpeg or png file, example. what colleague said not true though. there lot of binary files can compressed. example, bmp files. flex flash gzip

jquery ui checkbox and php problem -

jquery ui checkbox and php problem - so have list of checkboxes gets added dynamically - trying style them using jquery ui checkbox. problem can styled one. there ways create workaround dynamic id's on input tags , labels each input tag via jquery ? here syntax trying: <div id="format"> <input id="check_<?php echo $category['category_id']; ?>" type="checkbox" name="selected[]" value="<?php echo $category['category_id']; ?>" /><label for="check_<?php echo $category['category_id']; ?>">d</label> </div> jquery code: $(function() { $( "#check" ).button(); $( "#format" ).buttonset(); }); thanks! try once: $("input[id^='check_'] > label[for^='check_']").css('color', '#f3f3f3'); php jquery user-interface checkbox

Delphi DeHL Deserialize XML File in newer class? -

Delphi DeHL Deserialize XML File in newer class? - i utilize dehl serilize xml , class in delphi , if add together property class , seek deserialize xml file. have error : ‘deserializing « \tapp\fobject\test » failed. serializer reported it’s missing or other entity read!’. i understand quite problem there way set default value instead of error ? alex reply me : you should able — annotating “part2″ field [xmlnullable]. tell xml serializer set “part2″ field nil if not have xml node. note while possible it’s not recommended. deserialized content should serialized original types otherwise “bad things” may happen. i inquire question long time ago on site not able find inquire question : http://alex.ciobanu.org/?p=285#comments xml delphi xml-serialization delphi-2010 dehl

python - How to print query output in Html using google app engine -

python - How to print query output in Html using google app engine - entity kind :football entity key :ag9kzxz-ywnxdwl0d29ybgryfqsscezvb3riywxsgicagica8iskda id : 5681726336532480 email (string) manutd@gmail.com identity (string) manchester united this info in datastore. want search details based on input(emailid) . so, if input email detail, want fetch corresponding club name , print on html page. have written next code class searchapp(webapp2.requesthandler): def get(self): #self.response.out.write(que) name=self.request.get('last_name') player_key=football.query() #qry=football.key(5891733057437696) qry=player_key.filter(football.email==name) #for qry2 in qry: self.response.out.write('<b>%s</b> wrote:' % qry.identity()) from understood, qry object, need utilize loop , print result in qry2.email , qry2.identity . reason, not able hence commented part. need know how fetch d...

css - Owl Carousel Auto Width with margin not working -

css - Owl Carousel Auto Width with margin not working - i have fixed height on images , need maintain image in proportion screen width gets smaller. #owl-demo .item img { display: block; width: auto; height: 300px } this works fine until need set margin in between images. #owl-demo .item { margin:0 10px 0 10px; } the margin won't show , images side side still. margin show if set width: 100% #owl-demo .item img { display: block; width: 100%; height: 300px } but image no longer in proportion. i tried owl's own demo , case. if inspect 1 of images , alter code @ top width: auto see margin no longer works. need remove max-width: 100% img tag bootstrap also. http://owlgraphic.com/owlcarousel/demos/images.html looks you're using version 1.3.x try upgrading version 2 , you'll fine. css owl-carousel

c++ - Makefile to move programs to specific directory -

c++ - Makefile to move programs to specific directory - i have makefile didn't write, , i'm not @ bash scripting , makefiles in general, forgive me lack of knowledge beforehand; as title states want move executables when compiled ../bin/ folder. effort @ (shamelessy copied post here on so) given below (i.e. tried making phony install should move files, alas doesnt." cxx = g++ cc = g++ # define preprocessor, compiler, , linker flags. uncomment # lines # if utilize clang++ , wish utilize libc++ instead of libstd++. cppflags = -std=c++11 -i.. cxxflags = -g -o2 -wall -w -pedantic-errors cxxflags += -wmissing-braces -wparentheses -wold-style-cast cxxflags += -std=c++11 ldflags = -g -l.. mv = mv prog_path = ../bin/ #cppflags += -stdlib=libc++ #cxxflags += -stdlib=libc++ #ldflags += -stdlib=libc++ # libraries #ldlibs = -lclientserver # targets progs = myserver myclient libclientserver.a all: $(progs) # targets rely on implicit rules compiling , linking ...

mysql - Good algorithm for searching DB for a given string -

mysql - Good algorithm for searching DB for a given string - i'm working on web app (php + mysql) user can search other users inputting search string. i need match user's input string 2 columns (username , fullname) of 'user' table in db , homecoming relevant (20 or 50) matches. optimally, need take consideration misspellings. how can approach this? i'm not looking reinvent wheel here. you may using mysql total text search: please have @ this, this, this articles. i want explain boolean total text search; advise please go through full text search using query expansion also. let's @ illustration table given on dev.mysql.com: mysql> select * articles; +----+-----------------------+------------------------------------------+ | id | title | body | +----+-----------------------+------------------------------------------+ | 1 | postgresql tutorial | dbms stands database ... ...

tfs - In Microsoft Test Manager, is there a way to assign multiple roles to a single machine in an environment? -

tfs - In Microsoft Test Manager, is there a way to assign multiple roles to a single machine in an environment? - we're setting lab managed environments using tfs 2012 lab management @ company. in microsoft test manager, need define environments in tests can run. in each environment, must have 1 or more machines specified run tests. each machine can assigned role within environment. there way assign multiple roles single machine within environment ? e.g. i'd able define multiple ui test runs, have single machine perform multiple roles within our application ecosystem. it not possible assign multiple roles same machine. folks create role means 2 together. tfs tfs2012 test-environments lab-management

events - How to use generic collections with typed parameters in a generic map with wildcards (Java) -

events - How to use generic collections with typed parameters in a generic map with wildcards (Java) - this question related how create , fire collection of consumers<t> in java event listener pattern. trying utilize collection of events help batch operations up, far can't seem come right configuration of generic definitions work. here code far. private concurrenthashmap<class<? extends event>, concurrentlinkedqueue<consumer<collection<? extends event>>>> listeners; public <t extends event> void listen(class<t> clazz, consumer<collection<t>> consumer){ concurrentlinkedqueue<consumer<collection<t>>> consumers = listeners.get(clazz); if (consumers == null) { consumers = new concurrentlinkedqueue<>(); listeners.put(clazz, consumers); // complains consumers not type collection<? extends event> } consumers.add(consumer); } public <t extends event>...

python - Flask routes and views -

python - Flask routes and views - basically i'm trying create view lets user update password. code below. @app.route('/update_login_info/<password>',methods=['get','post']) def update_login_info(password): form = forms.updateloginform() if form.validate_on_submit(): try: query=models.user.update(password=models.generate_password_hash(form.new_password.data),) query.execute() flash("login info updated","success") homecoming redirect(url_for('login')) except: flash("error updating login info","error") homecoming redirect(url_for('login')) homecoming render_template('update_login_info.html',form=form) every time route flask throws 404 , cannot work out why. when user clicks on link in email route looks http://chdbfiletransferapp/update_login_info/$2a$12$hdjjbouwalvtujrlkhiryejdmo3nws0haq94/6i/du8ia...

ecmascript 6 - Is ES6 class extend fully equivalent to Object.assign based extending of an object? -

ecmascript 6 - Is ES6 class extend fully equivalent to Object.assign based extending of an object? - in other words these 2 different blocks of code equivalent? es6 class extend based class kid extends parent { // define subclass } var myinstance = new child(); object.assign based var myinstance = object.assign(new parent(), { // define subclass } in particular utilize case trying extend (facebook's) flux dispatcher. in examples utilize object.assign. es6 class extend, worried there subtle differences between 2 should stick object.assign. no, code blocks not equivalent in class inheritance new constructor makes objects having features parent class. extending objects via object.assign illustration of mixins. add together properties 1 instance not alter future children. unlike kid classes, instance after extension still have constructor property pointing parent . means can't recognize extended kid among non-extended, because have sam...

java - How do I know if mappers(or reducers) are running in parallel in Hadoop? -

java - How do I know if mappers(or reducers) are running in parallel in Hadoop? - i running mapreduce jobs on hadoop - 2.3.0 cluster 8 slave nodes, jobs taking longer expected time execute. how test whether map(or reduce) tasks running in parallel? and properties have modified in configuration files mappers(in case 8 of them) run in parallel. you should check in hadoop cluster web interface. go url track job status, line looks one: 15/04/11 17:29:07 info mapreduce.job: url track job: http://hadoopsrv:60540/proxy/application_1428349332728_0303/ this web page displays job status (succeeded/failed...), time each task complete, number of map/reduce tasks , status, logs, etc... java hadoop parallel-processing mapreduce

postgresql - Database indexable or serial overlapping possible? -

postgresql - Database indexable or serial overlapping possible? - im creating database in postgresql id of primary key serial, , im doing same within sql server, id identity(automatically adds integer id). question now, possible database create 2 id's same value, if added same time? or database sort out , give them different id's anyways? hope guys understand im trying ask, help or input highly appreciated, thanks! that not possible. if possible serial feature totally unusable. note, values can skipped or out of chronological (wall-clock) order. database postgresql

ios - How to import framework in swift? -

ios - How to import framework in swift? - what proper way of importing scheme framework in swift? there 2 ways know of, think. 1) target->build phases->link binary libraries -> + button -> add together framework. adds framework , shows graphically in navigator. 2) import framework in bridging-header.h in case of storekit framework example, method 1) add together through xcode ui. in method 2) type in import <storekit/storekit.h> in bridging-header.h which 1 of these right in swift? if correctly don't have separate build target framework (you built xcode 5) , included framework project's build target. the part of documentation you're referring frameworks within different targets. since framework in project's target part of documentation doesn't apply here. in case can't import of framework in swift file. that's why error message "no such module myframework". myframework no module -- part of project...

shell - run a java program -

shell - run a java program - i want run java programme using shell script. java programme in p2 directory , name maxconnect4 , have compiled it, class name maxconnect4. write shell commands this: java p2/maxconnect4 arg1 arg2 arg3 this shell command not work. give error: exception in thread "main" java.lang.noclassdeffounderror: p2/maxconnect however, compile java programme in way: javac p2/*.java, , works. just utilize java -cp p2 maxconnect4 arg1 arg2 arg3 . -cp sets classpath of jvm. edit: assume don't utilize bundle maxconnect4. java shell command

c# - OutOfMemoryException For Maze Solver of Large Dimensions -

c# - OutOfMemoryException For Maze Solver of Large Dimensions - the programme works arrays upto 20x20 larger throws outofmemoryexception. below code: public static point getfinalpath(int x, int y) { queue.enqueue(new point(x,y, null)); while(queue.count>0) { point p = queue.dequeue(); if (arr[p.x,p.y] == 9) { console.writeline("found destination"); homecoming p; } if(isopen(p.x+1,p.y)) { arr[p.x,p.y] = 1; queue.enqueue(new point(p.x+1,p.y, p)); } //similarly other directions } homecoming null; } public int[,] solutionmaze() { point p = getfinalpath(0, 0); while (p.getparent() != null) { solvedarray[p.x, p.y] = 9; p = p.getparent(); } homecoming solveda...

c# - MonoGame Shader - 2MGFX cant compile in SM4 -

c# - MonoGame Shader - 2MGFX cant compile in SM4 - i trying compile 3 .fx custom shader files monogame sample project, tryting running windows phone. the gaussianblur.fx file is: // pixel shader applies 1 dimensional gaussian blur filter. // used twice bloom postprocess, first // blur horizontally, , 1 time again blur vertically. sampler texturesampler : register(s0); #define sample_count 15 float2 sampleoffsets[sample_count]; float sampleweights[sample_count]; float4 pixelshaderfunction(float2 texcoord : texcoord0) : color0 { float4 c = 0; // combine number of weighted image filter taps. (int = 0; < sample_count; i++) { c += tex2d(texturesampler, texcoord + sampleoffsets[i]) * sampleweights[i]; } homecoming c; } technique gaussianblur { pass pass1 { pixelshader = compile ps_4_0_level_9_1 pixelshaderfunction(); } } i trying compile using mg2fx.exe - cloned latest monogame develop repo , built 2mgfx project...

Problems with copying file to System32 folder through a jenkin job? -

Problems with copying file to System32 folder through a jenkin job? - i trying re-create .dll file "c:\tests" "c:\windows\system32" re-create command re-create "c:\tests\windows\test.dll" "c:\windows\system32\test.dll" jenkin job output says file copied , tried printing , checking existence of file in same job , works. but after job completes , when check file in system32 , file doesn't exists. what can issue ?? cleanup settings of jenkins ? or permission issue ? when jenkins executes on filesystem, happens on master or slave node's filesystem, not filesystem of user browing/triggering job. are sure checking existence of file on same node job ran on? jenkins jenkins-plugins jenkins-cli jenkins-scriptler

php - Completing tasks from many queues sequentially -

php - Completing tasks from many queues sequentially - i have php + redis queue. i have 3 queues: create client (queue name = 'create_client'). create task client (queue name = 'create_task'). send created task client (queue name = 'send_task'). i can send tasks queues independently. example, have client , want create task him. set task queue 'create_task', , done. but have next issue: i want 3 tasks successively. first want create client, after creating want create task him , after that, want send task him. question: how may this. i have 1 option: set task in queue 'create_client' additional param such as 'create_task' => true and then, in 'create_client' queue watch: if ($params['create_task']) { queue::put('create_task', $client_id) } i don't want this, don't have thought how otherwise. help me please. give thanks you! php redis queue

javascript - How do you verify input is not null, whitespace or integer? -

javascript - How do you verify input is not null, whitespace or integer? - i have next code verifying text boxes not null, working great. else have add together verify not whitespace or contain integers? function verifydados() { function nullcheck() { var x = $(".dadosdotutor"); var i; (i = 0; < x.length; i++) if (x[i].value === '') { homecoming 0; } } if (nullcheck() === 0) { alert ('você ainda não tenham completado o preenchimento da tabela dados tutor. faz favor, verifique que você respondeu cada pergunta e submeter mais uma vez.'); } note: whitespace issue, tried adapting "str = jquery.trim(str);" type solutions found trying research topic, couldn't them either travel through array, or work unknown reason. thanks help you'll want trim input , check against "" see if it's got stuff in it, utilize string.match(/\d+/g); see if contains number. javascript array...

javascript - How to redirect to a page using PHP in one page website -

javascript - How to redirect to a page using PHP in one page website - i have 1 page webiste www.yahavi.com (all pages in 1 html) in different pages referenced using div id (eg; #home, #contact ). after successful sign want direct user thankyou page id #thanku . how can using php script runs after form submission. home url: www.yahavi.com/#home form @ : www.yahavi.com/#contact thankyou: www.yahavi.com/#thanku i using header (location: /#thanku) in php doesnt work. note: dont want finish new html page reload. you can utilize javascript on php code this: <?php <script> location.href="#thanku" </script> ?> try that. hope helps. update if ajax instead, best. after signup, if user signups successfully, on javascript file can utilize location.href="#thanku". for that, need ajax request in signup form. javascript php jquery html html5

php - How do I shorten the MySQL Connect Time Out - Failover Scenario -

php - How do I shorten the MySQL Connect Time Out - Failover Scenario - i have fail-over scenario in wordpress plugin, php script on web server tries connect backup database if production 1 offline. currently fallback seems take 60 seconds. php default? how set time out 10 seconds? here relevant portion of script... seek { $dbblue = new \pdo('mysql:host='.$samhost.';'.'dbname='.$dbblue, $samuser, $sampass); $dbgreen = new \pdo('mysql:host='.$samhost.';'.'dbname='.$dbgreen, $samuser, $sampass); } grab (\pdoexception $pde) { // fallback database connection $althost = get_option('fallback_host'); $altuser = get_option('fallback_user'); $altpass = get_option('fallback_password'); $dbblue = new \pdo('mysql:host='.$althost.';'.'dbname='.$dbblue, $altuser, $altpass); ...

mysql - How to solve this error SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails -

mysql - How to solve this error SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails - sqlstate[23000]: integrity constraint violation: 1452 cannot add together or update kid row: foreign key constraint fails ( marketplace . mg_nbmp_review , constraint fk__nbmp_vendor foreign key ( vendor_id ) references ('marketplace/vendor') ( vendor_id ) on delete cascade on update cascade), query was: insert mg_nbmp_review ( vendor_id , vendor_name , customer_id , customer_name , customer_email , rating , review_comment , reviewed_date ) values (?, ?, ?, ?, ?, ?, ?, '2015-04-08 11:51:58') <?php $installer = $this; $installer->startsetup(); $installer->run(" drop table if exists {$this->gettable('vendorreview/review')}; create table if not exists {$this->gettable('vendorreview/review')} ( `review_id` int(11) not null auto_increment, `vendor_...

java - How to attach an image file to a randomly rolled number that will display in a JPanel -

java - How to attach an image file to a randomly rolled number that will display in a JPanel - i need create programme randomly roll 5 dice , display faces of these dice in jpanel, yahtzee game. have images of each die face , having problem trying attach randomly rolled number image. instance if random number 1 display die face 1 5 different faces. have below die class, panel class , gamedrive in order. sorry codes copied on , not sure if driver needed solve problem dint know code needed written work. public class die implements comparator { private int face; public die() { super(); face = (int)(math.random() * 6) + 1; } public die(int f){ super(); face = f; } public int getface() { homecoming face; } public void setface(int face) { this.face = face; } @override public string tostring() { homecoming "die [face=" + face + "]"; } @override public...

mysql - Updata detail user PDO -

mysql - Updata detail user PDO - i learning create script pdo registration, login, etc., , alter profile. it not quite work, attaching wrote in class user.php // update user public function update_user($firstname, $lastname, $gender, $user_id){ $this->username = $firstname; $this->location = $lastname; $this->gender = $gender; $this->memberid = $user_id; $query = $this->_db->prepare("update `members` set `username` = ?, `location` = ?, `gender` = ? `memberid` = ?"); $query->bindvalue(1, $this->username, pdo::param_str); $query->bindvalue(2, $this->location, pdo::param_str); $query->bindvalue(3, $this->gender, pdo::param_str); $query->bindvalue(4, $this->memberid, pdo::param_int); try{ $query->execute(); }catch(pdoexception $e){ die($e->getmessage()); } } (i enclose info 1 other function, take @ name...

css - firefox not responding to float with overflow:hidden -

css - firefox not responding to float with overflow:hidden - i have floated image text on right side. want set min-width on text, when browser resized, text squeezes width. after should move under picture. works in chrome not in firefox. not want utilize mediaqueries. firefox works if set width property not want. give thanks help. code <div class="wrapper"> <ul> <li> <div class="image"></div> <div class="info">text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text</div> </li> </ul> </div> css .wrapper { width:100% } .image { height:100px; width:50px; margin:10px; border:1px solid; float:left } .info { min-width:200px; ...

asp.net - Do I have to deploy my site to IIS in order to create user directories? -

asp.net - Do I have to deploy my site to IIS in order to create user directories? - i getting 'system.unauthorizedaccessexception' error when run web application , seek upload file logged in app user . i have controller attempts create directory if 1 doesn't exist logged in users upload. my question is, have deploy project iis in order programmatically create directories? i don't mean iis express. if not, please elaborate on best way allow access. *edited clarification asp.net asp.net-mvc asp.net-mvc-4 iis

watchkit - Apple Watch Simulator Not Showing Images -

watchkit - Apple Watch Simulator Not Showing Images - i'm trying show images simulator won't load images @ all. shows blank space they're supposed be. yes, targets right , have been set watch targets. i've restarted several times , no images work @ all. i have selected copies , targets when moving files project. i have checked build phases/settings , images folder there. i have tried resetting program, resetting ios simulator, reset computer, installed updates, , date still no images showing. missing? at point, there no code, user interface. i did read somewhere mentioned create sure selected image has targets selected... except targets not show on images. you have added total directory. i'm not sure think there bug new version of xcode. that: create grouping in xcode add grouping images want use add images "gold hits watchkit app" target this should prepare problem ;) image watchkit xcode-6.2

java - Authentication with Spring Security + Spring data + MongoDB -

java - Authentication with Spring Security + Spring data + MongoDB - i want utilize spring security mongodb (using spring data) , retrieve users own database spring security. however, can not since userservice type not seem supported. this userservice class: public class userservice { private applicationcontext applicationcontext; private mongooperations mongooperations; public userservice() { applicationcontext = new annotationconfigapplicationcontext(mongoconfig.class); mongooperations = (mongooperations) applicationcontext.getbean("mongotemplate"); } public user find(string username) { homecoming mongooperations.findone(query.query(criteria.where("username").is(username)), user.class); } } and securityconfig class: @configuration @enablewebsecurity public class securityconfig extends websecurityconfigureradapter { @autowired userservice userservice; @autowired public void configa...

simd - Why there is no pmulluw, pslad and pslaw commands in MMX? -

simd - Why there is no pmulluw, pslad and pslaw commands in MMX? - why there no pmulluw, pslad , pslaw commands in mmx? , why there no movb , movw commands? there totally pmulluw , it's called pmullw . since keeps low half, there no difference between signed , unsigned. for related reason, pslad , pslaw pslld , psllw respectively. left shift left shift, signedness doesn't come in picture, shift (assuming shift 1) second-to-highest bit highest, nil else makes sense (the cases in signed-overflows exactly cases in "full result" cannot represented anyway, trying somehow preserve sign useless). right shift has signed , unsigned versions. simd cpu-architecture mmx

html - Div inside div not auto expanding (screenshot) -

html - Div inside div not auto expanding (screenshot) - i need reddish box expand bluish box content, both same size. the reddish box defined as: .leftmenu{ float:left; width:20%; background-image:url(../images/leftmenubg.jpg); background-position:bottom; background-color:#bfdae3; background-repeat:repeat-x; } can't seem work, whatever try! ideas? thanks! simple solution: utilize tables. semantic solution: utilize faux columns. html height css

override - overriding a global function in javascript -

override - overriding a global function in javascript - i trying add together own error handling javascript settimeout function. next code works fine in chrome: var oldsettimeout = window.settimeout; window.settimeout = function settimeout(func, delay) { var args = array.prototype.slice.call(arguments, 0); args[0] = function timeoutfunction() { var timeoutargs = array.prototype.slice.call(arguments, 0); seek { func.apply(this,timeoutargs); } grab (exception) { //do error handling } } homecoming oldsettimeout.apply(this, args); } but in ie7 turns recursive function. reason oldsettimeout gets set new function. any suggestions? side note: yes, need way. using pile of 3rd party libraries of don't deal settimeout well, can't alter calls settimeout. this because you're using named function expressions, incorrectly implemented in ie. removing function names prepare imm...

ajax - yii2 -> Modal Dialog on Gridview's update button does not work after searching or change pagination on gridview -

ajax - yii2 -> Modal Dialog on Gridview's update button does not work after searching or change pagination on gridview - reference yii2 modal dialog on gridview view , update button shows same content both buttons , how implement yii2 modal dialog on gridview view , update button? i got modal dialog clicking update button on gridview right id parameter selected row. when used searching , pagination on gridview problem occurred. modal dialog seem not working anymore modal dialog shown clicking update button id parameter not match selected row. honest, seem gridview not know registerjs anymore. can kindly advise how solve problem? <?php $gridcolumns = [ [ //'class' => 'kartik\grid\editablecolumn', 'attribute' => 'branch_id', 'pagesummary' => true, ], [ 'class' => 'kartik\grid\actioncolumn', 'template' => '{updat...

java - Jackson 2.x annotations not picking up in a separate jar project -

java - Jackson 2.x annotations not picking up in a separate jar project - i have interesting problem: jackson 2.x annotations not picked in separate maven module project on weblogic 12.1.3 bailiwick of jersey 2.17 (jax-rs 2.0). my project construction this: project ear --> domain jar: contains jpa & jackson2 annotated pojos --> war: contains rest api if set jackson-annotated pojos within war, jackson annotations got picked up, , right json output generated. it might possible duplicate question, regarding this: jackson 2 annotations ignored in ejb jar jboss (6.2.0 ga), couldn't create work on weblogic. it doesn't work in separate (domain) jar. i've tried different maven solutions (skinny war, wl-specific classloading), nil seems working. here relevant details might find interesting... domain-jar pom.xml includes following: <dependency> <groupid>org.glassfish.jersey.media</groupid> <arti...

java - How to set TimeOut while HTTP Connection in Android? -

java - How to set TimeOut while HTTP Connection in Android? - hello have code androidhive: it works want install timeout - because if there low connection loading minutes app crashing @ , (asynctask). question: how can install timeout next code? let's shall timeout after 10 seconds? thank u public jsonobject makehttprequest(string url, string method, list<namevaluepair> params) { // making http request seek { // check request method if(method == "post"){ // request method post // defaulthttpclient defaulthttpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(url); httppost.setentity(new urlencodedformentity(params)); httpresponse httpresponse = httpclient.execute(httppost); httpentity httpentity = httpresponse.getentity(); = httpentity.getcontent(); }else if(method == "get"){ ...

wpf - How to detect a drop, regardless of where it occurred? -

wpf - How to detect a drop, regardless of where it occurred? - i creating wpf application drag , drop functionality. when drag initiated, colors of rectangles in window alter white greenish or reddish indicate ones valid drop targets. i want revert colors of rectangles white whenever drop performed, regardless of drop occured. i managed revert colors when drop occured on drop targets. can't find way same thing when drop performed elsewhere. i've tried this, no luck me: private sub meh(sender object, e querycontinuedrageventargs) handles dragsource.querycontinuedrag() if e.action = dragaction.cancel or e.action = dragaction.drop each r rectangle in rectangles.children r.fill = brushes.white next end if end sub i made handler of mouseup event of window it. still no good. can help me out here? wpf vb.net

php - Multiple Where using Querys in Laravel -

php - Multiple Where using Querys in Laravel - i have code : if ($tipo==='d') { $movimentos=movimento::where('tipo',$d)->wherein('destino',$idcontas)->wherebetween('data', [$compdata, carbon::now()])->get(); } elseif ($tipo==='c') { $movimentos=movimento::where('tipo',$d)->wherein('origem',$idcontas)->wherebetween('data', [$compdata, carbon::now()])->get(); } else { $movimentos=movimento::where('tipo',$d)->wherein('origem',$idcontas)->wherein('destino',$idcontas)->wherebetween('data', [$compdata, carbon::now()])->get(); } i've seen lot of posts regarding multiple in laravel not single 1 talking special wheres. code have atm doesnt work if have 1 wherebetween 1 does. can help me making them working fine? php mysql laravel where

javascript - Looping through array and input value into field -

javascript - Looping through array and input value into field - i have general question script automate value inputs & clicking. purpose select site in sites variable/concat ns1 - ns2, click id add_gridvanity place values input field , submit/close repeat process until end of array. can't seem loop running. sorry basic question. sites = ["stonegrillla.com","schoolfoodbloomingroll.com","chapmanpizzeria.net","sushimasu.com","hmsbountyla.com","pailinthaicuisine.net","fullhouseseafood.com","cjssgourmetdelicatessen.com","bullsheadexpress.net","breakingbreadsf.net","lscaffe.net","latortagorda.org","pinecrestdiner.net","sunriserestaurant.net","tressf.net","hanazensf.com","piperade.org","mazzatsf.net","gaylordindia.net","thegrovefillmore.com","itstopscoffeeshop.net"] (i...

powershell - Searching AD Groups attached to specified Server -

powershell - Searching AD Groups attached to specified Server - i'm looking utilize powershell, specify server hostname, , have display advertisement groups have access server. there i'll dig groups getting usernames , storing them in csv file. so far have code dn of server - get-adcomputer hostname | select distinguishedname along having code eventual usernames , store them in csv - $groups= groups $selectgroups=$groups |get-adgroup $selectgroups |get-adgroupmember -recursive | select samaccountname | export-csv -path c:\groups\members.csv -notypeinformation my problem can't figure out how powershell query groups on server specify. possible or have @ way of doing this? thanks. not sure know you're looking for. there's no way tell advertisement groups have been granted access node via ad. thing can on local node advertisement groups, there's lot of places want/need frode f. mentioned already. mutual theme advertisement groups...

WordPress API functions not working at AJAX functions.php call -

WordPress API functions not working at AJAX functions.php call - i trying show subcategories of category in wordpress using ajax: when select main category, there phone call wp ajax , result used in showing subcategories. so far, have client-side code works when not calling wp function (this code in theme page): jquery('#cat-location-main').change(function () { var optionselected = jquery(this).find('option:selected'); var valueselected = optionselected.val(); var textselected = optionselected.text(); console.log(valueselected); jquery.ajax({ type: 'post', url: ajaxurl, data: { action: 'myajax-get-subcat', category: valueselected, // send nonce along request categorynonce: '<?php echo wp_create_nonce( 'myajax-get-subcat-nonce' );?>' }, success: function(data, textstatus, jjqxhr) { console.log(data); }, d...

c - What is the advantage of specifying two types when creating a typedef'd struct? -

c - What is the advantage of specifying two types when creating a typedef'd struct? - example 1: struct t{ int a; }; creates type struct t example 2: typedef struct { int a; } t; creates type t example 3: typedef struct t{ int a; } t; creates both types struct t , t i tend see illustration 3 lot, , i'm not sure why take on illustration 1 or 2. are there advantages gain doing way? are there reasons people compatibility? is advantageous kind of scoping reason? i avoid doing example 3 way, because less maintenance on type, , restricts multiple ways of declaring same thing. however, reconsider it, if there benefits "double naming" technique. i tend see illustration 3 lot, , i'm not sure why take on illustration 1 or 2. are there advantages gain doing way? i hold truth self-evident, namely cumbersome code cumbersome. prefer write t object; instead of struct t object; h...

java - reversing a linked list with the head node -

java - reversing a linked list with the head node - well seems i'm running infinite loop trying reverse list. have random numbers 4,5,6,7 , trying reverse 7,6,5,4. started node @ the head , added end lastly node until final list(ie 7,4 ->7,5,4,) every i've attempted giving me infinite loops. public void reversing() { node<e> = this.head;//set head loo[ node<e> lastly = this.head; node<e> temp = this.head; //not used anymore last=lastnode();//gets lastly item in list while (currently != null) {//loop until not null last.next=currently; currently=currently.next; if(last.info==currently.info){//break out of loop break; } } } you reversing singly linked list. see question shows how reverse singly linked list java i'll re-create in answer: node<e> reversedpart = null; node<e> current = head; while (current != null) { node<e> next = curr...

c# - Order a list with unique rows with a given row as first item, then reorder the list but without the first row -

c# - Order a list with unique rows with a given row as first item, then reorder the list but without the first row - let's have list records in ("germany", "belgium", "netherlands", "spain", "russia", "italy"). and want order list "belgium" on top of list. so when load list combobox "belgium" selectedvalue load. now how order rest of list? this have: "belgium" comes @ top rest not ordered. homecoming enumerable.select(gettable() .orderbydescending(o => o.name == country) .thenby(o => o.name != country), b => new comboboxbase.comboboxliststructguid { id = b.countryid, description = b.country }).tolist(); return enumerable.select(gettable() .orderbydescending(o => o.name == country) .thenby(o => o.name), b => new comboboxbase.comboboxliststructguid { id = b.countryid, desc...

android - how to set BroadCastReceiver for volume keys to open new activity -

android - how to set BroadCastReceiver for volume keys to open new activity - if user presses volume key , down, possible observe in broadcast receiver? i need total code. question have been asked on http://stackoverflow.com not answered properly. i have been searching solution question past 3 weeks unable find proper answer. i want code snipet for: 1) public class mainactivity extends activity {} 2) public class volumekeyreceiver extends broadcastreceiver {} 3) androidmanifest.xml please help!! there not supported broadcast event volume button press (change). there 2 ways hear volume button presses. 1) contentobserver. see how register contentobserver media volume change? 2) onkeyevent. see android - volume buttons used in application if want broadcastreceiver, 1 of 2 above can fire broadcast event - sendbroadcast see http://developer.android.com/reference/android/content/context.html#sendbroadcast(android.content.intent) android

PowerShell how to unsplat -

PowerShell how to unsplat - i know how utilize splatting pass parameters cmdlet. how write cmdlet "unsplat"? want parameters passed function hashtable. for example: function test-unsplat { [cmdletbinding()] param( $parama, $paramb ) # here @{parama = '...', paramb = '...'} } i found reply get-help about_splatting the reply looking $psboundparameters. powershell

what is the use of ngTouch dependency in AngularJS? -

what is the use of ngTouch dependency in AngularJS? - i beginner in angularjs programming,and not able figure out utilize of ngtouch in angularjs? asking question because had made little website, assumed not work fine on tabs without ngtouch module,so used there,but due errors,i removed dependency module, , working expected, , ran lot of issues on android touch device because of ngtouch beingness used.so utilize of ngtouch then? from docs: the ngtouch module provides touch events , other helpers touch-enabled devices. implementation based on jquery mobile touch event handling here good explanation on how works example. angularjs angularjs-ng-touch

mysql - Forming Case statements in SQL -

mysql - Forming Case statements in SQL - i need form case statements next queries: select distinct t iwa b exists ( select * iwa t=320 , art=1234 ) , exists ( select * iwa t=450 , art=1234 , art=b.art ); select t iwa t=320 art=1234; select t iwa t=450 art=1234; t column name, iwa table name , art input. should output above queries checked. i can't understand trying achieve. maybe need this? select t iwa (t=320 , art=1234) or (t=450 , art=1234) mysql sql-server

javascript - Script not working in localhost -

javascript - Script not working in localhost - i found site/tutorial/demo question here on so. very nice , clean code. having problems when running localhost test changes sites. running pretty much exact same code (i have mine in /lib not /js). i've stepped through code in firebug , inspected generated source , adding script tags, breakpoint on loaded function never triggers. to test whether files beingness loaded , not registered, loading jquery , in standard $(document).ready() function have simple alert firebug gives error of $ not defined means while loading.js updates html file, browser (firefox, ie8 exhibits same behaviour) isn't loading files. update: i've enabled net tab. when page hard reloaded (via ctrl+f5) there 9 requests, 8 of 304 , 404 (which phone call load logo.png never copied), rest colorbox css files. none of objects listed js files should loaded via loading.js file beingness loaded. of times in low milliseconds , nil seems out ordinary...

mysql / file hash question -

mysql / file hash question - i'd write script traverses file tree, calculates hash each file, , inserts hash sql table file path, such can query , search files identical. recommended hash function or command tool create hashes extremely unlikely identical different files? b you can utilize md5 hash or sha1 function process_dir($path) { if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (is_dir($path . "/" . $file)) { process_dir($path . "/" . $file); } else { //you can alter md5 sh1 // can set hash database $hash = md5(file_get_contents($path . "/" . $file)); } } } closedir($handle); } } if working in windows alter slashes backslashes. mysql hash duplicates directory

parameters - Passing url to Three20 TTURLMap -

parameters - Passing url to Three20 TTURLMap - i trying pass in url parameter tturlmap this: [map from@"tt://person/(initwithurl:)" toviewcontroller: [personviewcontroller class]]; i have ttstyledtableitemcell links render this: <a href="tt://person/http://persons.url.com/blah">person name</a> but when click on these links link doesn't phone call initwithurl: method in personviewconroller class. i've verified things wired correctly passing in simple string. believe isn't working because parser thinks url part of tturlmap url mapping. there way escape person's feed url (its rest service need utilize pull info in)? many in advance. i think character tturlmap trips on / character, next did trick me. phone call these mike suggests on way in , out of init function + (nsstring *)encodetturl:(nsstring *)str { nsmutablestring *temp = [nsmutablestring stringwithstring:str]; [temp replaceoccurrencesofstrin...

facebook - Graph API PHP SDK - How to get FB.streampublish style box -

facebook - Graph API PHP SDK - How to get FB.streampublish style box - i trying streampublish box facebook's new graph api example. using code not working. help guys! <script> fb.ui( { method: 'stream.publish', message: 'getting educated facebook connect', attachment: { name: 'connect', caption: 'the facebook connect javascript sdk', description: ( 'a little javascript library allows harness ' + 'the powerfulness of facebook, bringing user\'s identity, ' + 'social graph , distribution powerfulness site.' ), href: 'http://github.com/facebook/connect-js' }, action_links: [ { text: 'code', href: 'http://github.com/facebook/connect-js' } ], user_message_prompt: 'share thoughts connect' }, function(response) { if (response && response.post_id) { ale...

html - Add extra INPUT to contact form email PHP -

html - Add extra INPUT to contact form email PHP - i'm using php found sending contact form site. the html looks this: <div id="wrap"> <div id='form_wrap'> <form id="contact-form" action="javascript:alert('success!');"> <p id="formstatus"></p> <input type="text" name="name" value="" id="name" placeholder="voornaam" required/> <input type="text" name="email" value="" id="email" placeholder="e-mail adres" required/> <textarea name="message" value="your message" id="message" placeholder="uw vraag of projectomschrijving" required></textarea> <input type="submit" name ="submit" value="offerte aanvragen" /> </form> ...