Posts

Showing posts from June, 2011

javascript - How does minus integer work in Date? -

how javascript date interpret milisecond integers? var d = new date(-1724115600000); //this gives me date in past, want console.log(d); var d = new date(1724115600000); console.log(d); (we had bug - sign not getting through. dont understand significance of -) the date object constructor can take variety of inputs , when called in fashion it's using integer value one: integer value representing number of milliseconds since 1 january 1970 00:00:00 utc (unix epoch). negative values give dates before unix epoch, positive values dates after epoch.

c# - When parsing datetime into month day with English culture, it is still parsed in Turkish language -

here code. still incorrect results string srregisterdate = "25.07.2009 00:00:00" cultureinfo culture = new cultureinfo("en-us"); srregisterdate = string.format("{0:dddd, mmmm d, yyyy}", convert.todatetime(srregisterdate), culture); the result cumartesi, temmuz 25, 2009 instead should saturday, july 25, 2009 how can fix error? c#.net v4.5.2 the issue because of ignored culture value in string.format , not converting string datetime . you need: srregisterdate = string.format(culture, "{0:dddd, mmmm d, yyyy}", convert.todatetime(srregisterdate)); your current call string.format utalizes overload string.format method (string, object[]) , culture passed in parameter treated simple object parameter passed place holder. since there no place holder, don't see getting ignored. if want have culture utilized in string.format have use overload : format(iformatprovider, string, object) or string.format method (iforma

devise - Filter chain halted as :require_no_authentication rendered or redirected rails 4 -

in ability.rb : def initialize(user) user ||= user.new if user.role? :agent can :manage, servicerequest elsif user.role? :punching_team can :manage, srdocument end in service_request_controller : load_and_authorize_resource in sr_documents_controller : load_and_authorize_resource in application_controller : rescue_from cancan::accessdenied |exception| redirect_to root_url, :alert => exception.message end in routes: devise_scope :user root to: "devise/sessions#new" end in log: redirected http://localhost:3000/ filter chain halted :require_no_authentication rendered or redirected i using cancan gem in application.i want set authorization in such way if user 'agent' he/she should access servicerequest model , 'punching_team' type he/she should access srdocument model.but when login agent, getting infinite loop.which gives me errors `filter chain halted :require_no_authentication rendered or redirected.please m

javascript - read selected variable and then send back from table to controller -

i having table data database called through codeigniter controller.what want read selected value within table send controller , use values retrieve new records db , load them on again page. my controller: <?php if (!defined('basepath')) exit('no direct script access allowed'); class dashboard1 extends ci_controller { public function __construct() { parent::__construct(); $this->load->library('form_validation'); $this->load->model('dash_match_model'); $this->session->keep_flashdata('supplier_id'); $this->load->helper('url'); $this->load->database(); } public function index() { $arr['page']='dash1'; $arr['present_all_suppliers'] = $this->dash_match_model->dash_present_all_suppliers(); $arr['suppliercompany'] = ""; $this->load->view(&

ios - How to do in-memory and on disk data caching in watchkit extension? -

i have ios app sends data in key value pairs watchkit extension, want cache key value pairs both in memory , on disk @ watchkit extension. best way this? because you're using key/value pairs, seems straightforward keep data in nsdictionary while in-memory. persist dictionary disk: [mydictionary writetofile:@"myfile" atomically:yes]; to load dictionary disk: nsmutabledictionary *mydictionary = [nsmutabledictionary dictionarywithcontentsoffile:@"myfile"]; for it's worth, nsarray supports same functionality.

java - getting an ad response. ErrorCode: 0 -

Image
this first time setting , writing android app, , first time setting ad, i've been googling , testing 2 days still can't seem make ad appear , still gives me error "there problem getting ad response. errorcode: 0". i've followed guide @ here below below, please :( mainactivity.java package com.example.lechoonh.admob; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import com.google.android.gms.ads.adrequest; import com.google.android.gms.ads.adview; public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); adview madview = (adview) findviewbyid(r.id.adview); adrequest adrequest = new adrequest.builder() .addtestdevice("dae102189e22517b3a0c8a79337b74a2") .build(); madview.loadad(adrequest); } bui

wso2esb - How to send multipart/form-data message to http endpoint from WSO2 ESB proxy -

i need build message in proxy on wso2 esb 4.8.1 messagetype="multipart/form-data" , send http endpoint. somethin this: post /cgi-bin/maillist.cgi http/1.0 content-type: multipart/form-data; boundary=---------------------------7cd1d6371ec cache-control: no-cache content-length: 25852 -----------------------------7cd1d6371ec content-disposition: form-data; name="realname" steve johnson -----------------------------7cd1d6371ec content-disposition: form-data; name="email" steevo@idocs.com could give me examlpe or link solution? you can set message type property follows. <property name="messagetype" value="multipart/form-data" scope="axis2"/> so invoke multipart/form-data formatter , send out multipart/ form-data message.

c++ - Pattern for choosing behaviour based on the types present in a collection derived objects -

i have collection of objects represents model of system. each of these objects derives base class represents abstract "component". able @ system , choose behaviours based on components present , in order. for sake of argument, let's call base class component , actual components inputfilter , outputfilter , processor . systems can deal ones processor , 1 or both filters. actual system has more types , more complex interaction between them, think now. i can see 2 "simple" ways handle situation marshalcomponentsettings() function takes 1 of collections , works out how efficiently set each node. may require modifying inputs in ways or splitting them differently, it's not quite simple implementing virtual handlesettings() function per component. the first report enumerated type each class using pure virtual function , use work out do, dynamic_cast 'ing needed access component specific options. enum comptype { input_filter, output_fil

excel - Formatter parameter passes as null -

i trying export table data excel sheet. works ok without formatter. have format cells before converting table excel. i'm debugging code. formatter function's parameter passes null value. here code: var oexport = new sap.ui.core.util.export({ exporttype: new sap.ui.core.util.exporttypecsv({ separatorchar: ";" }), models: this.getview().getmodel(), rows: { path: "/faaliyetservisiset" }, columns: [{ name: "kişi", template: { content: "{klnad}" } }, { name: "faaliyet", template: { content: "{falyt}" } }, { name: "süre", template: { content: { parts: ["sure"], formatter: function(ovalue) { // ovalue null that's problem !!!!!!! ovalue = ovalue + 2; return ovalue; } } } }, { name: "proje", template:

spring - Empty request body gives 400 error -

my spring controller method looks this: @requestmapping(method=requestmethod.put, value="/items/{itemname}") public responseentity<?> updateitem(@pathvariable string itemname, @requestbody byte[] data) { // code saves item } this works fine except when try put zero-length item, http error: 400 bad request . in case method never invoked. expecting method should invoked "data" parameter set zero-length array. can make request mapping work when content-length 0? i using spring framework version 4.1.5.release. setting new byte[0] not send content on request body. if set spring mvc logs trace should see message saying required request body content missing root cause of 400 bad request to support case should make @requestbody optional @requestmapping(method=requestmethod.put, value="/items/{itemname}") public responseentity<?> updateitem(@pathvariable string itemname, @requestbody(required = false) byte[] data) { /

php - Object of class stdClass could not be converted to string - laravel -

i following this documentation to implement export excel in laravel 4 project. so trying generate excel file array this: //$results taken db query $data = array(); foreach ($results $result) { $result->filed1 = 'some modification'; $result->filed2 = 'some modification2'; $data[] = $result; } excel::create('filename', function($excel) use($data) { $excel->sheet('sheetname', function($sheet) use($data) { $sheet->fromarray($data); }); })->export('xls'); but raises exception: object of class stdclass not converted string what doing wrong ? update: tried this: $data = get_object_vars($data); which results in: get_object_vars() expects parameter 1 object, array given this: $data = (array)$data; results in initial error. $data indeed array, it's made of objects. convert content array before creating it: $data = array(); foreach ($results $result) { $result->

mysql - Sphinx indexer «No error» error -

i have 25gb tsv file , trying import command: d:\sphinx\bin>indexer.exe -c d:\sphinx\sphinx.conf products --rotate it works time, shows error error: index 'products': source 'products_tsv': read error 'no error' (line=4595827, pos=908, docid=4595827). but record @ line 4595827 have no problems. have 2 questions: what's causes problem? does indexer have flags ignoring errors? lost lot of time on checking datafile , found lot of hidden symbols such sym ( \u001a ), null ( \0000 ) , more of them, turns sphinx crazy. simply(if «simply» can said 25gb file) replaced sym ' , removed others. moved forward , faced issue, question .

python - solving autonomous ODE -

i trying solve autonomous ode system using scipy ode. code has no syntax mistake cannot give correct answer. gives, /users/daoyuan/library/enthought/canopy_64bit/user/lib/python2.7/site-packages/scipy/integrate/_ode.py:741: userwarning: vode: illegal input detected. (see printed message. 'unexpected istate=%s' % istate)) here code from numpy import* scipy.integrate import ode def autonomous_function(y,t): y1=y[0] y2=y[1] dy1=y1**2*y2-4*y1+1 dy2=3*y1-y1**2*y2 return [y1,y2] t0=0 y10=0 y20=0 t_final=1 dt=1/10 solver=ode(autonomous_function) solver.set_integrator('vode') solver.set_initial_value([y10,y20],t0) y_result=[] t_output=[] y_result.append([y10,y20]) t_output.append(t0) while solver.successful() , solver.t<t_final: solver.integrate(solver.t+dt) y_result.append(solver.y) t_output.append(t_output) y_result=array(y_result) t_output=array(t_output) y_result

php - Ajax image upload 403 error -

i have summernote implemented on site , trying use ajax call handle image upload. code using have taken stackoverflow post , works other people , have changed urls. following error: get http://intranet-dev/dev/rehan/projecttracker/%3cbr%20/%3e%3cb%3eparse%20err…te_doc_upload_post.php%3c/b%3e%20on%20line%20%3cb%3e23%3c/b%3e%3cbr%20/%3e 403 (forbidden) summernote uses this: onimageupload: function(files, editor, weleditable) { sendfile(files[0], editor, weleditable); } and sendfile function makes ajax call: function sendfile(file, editor, weleditable) { data = new formdata(); data.append("file", file); $.ajax({ data: data, type: "post", //url: "/dev/rehan/projecttracker/form_summernote_doc_upload_post.php", url: "form_summernote_doc_upload_post.php", cache: false, contenttype: false,

php - pdftk Error: Failed to open PDF file: -

i using pdftk library extract form fields pdf .everything running fine except 1 issue got pdf file pdf file link . causes error given bellow error: failed open pdf file: http://www.uscis.gov/sites/default/files/files/form/i-9.pdf done. input errors, no output created. command root@ri8-ms-7788:/home/ri-8# pdftk http://192.168.1.43/form/i-9.pdf dump_data_fields the same command working other forms . attempt1 i have tried encrypt pdf unsafe version produce same error . here command pdftk http://192.168.1.43/forms/i-9.pdf input_pw foopass output /var/www/forms/un-i-9.pdf update this full function handle public function formanalysis($pdfname) { $pdffile=yii::app()->getbaseurl(true).'/uploads/forms/'.$pdfname; exec("pdftk ".$pdffile." dump_data_fields 2>&1", $output,$retval); //got error pdf if these secure if(strpos($output[0],'error') !== false) { $unsafepd

ios - swift - Unit test CoreData (+ MagicalRecord) model triggers EXC_BAD_ACCESS -

i need unit test ( xctest ) of methods include reference coredata models. the following line execute correctly : var airport: anyobject! = airport.mr_createentity() (lldb) po airport <airport: 0x7fcf54216940> (entity: airport; id: 0x7fcf54216a20 <x-coredata:///airport/t1d3d08da-70f9-4da0-9487-bd6047ee93692> ; data: { open = nil; shortname = nil; visible = nil; }) whereas following line triggers exc_bad_access : var airport2: airport = airport.mr_createentity() as! airport (lldb) po airport2 error: execution interrupted, reason: exc_bad_access (code=1, address=0x0). process has been returned state before expression evaluation. no sign of error principal target. configuration : model objects in both targets, class prefixed @objc(mymodel) , no namespace in class' models in xcdatamodel any idea what's going on here ? right, have gotten bottom of , not pretty. there radar issue appears bug swift compiler not recognizing managedobj

ssl - How to disable SSLv3.0 and use TLS1.0 in Gunicorn -

i running django 1.7 gunicorn. able use https using gunicorn passing certificate , key file parameter. when validate server geotrust ssl tools, says fine except - this server may vulnerable: sslv3 enabled disable sslv3 , use tls 1.0 or higher. i new , not able understand how this. related machine or related gunicorn?

c# 4.0 - problems downloading signed pdf files c# -

i have signed pdf adobe signature done. problem starts when want download document. via webmethod bytes of signed file. until here there no problems. if try save file in server, when open file correct. if try download when open signature wrong. this error in adobe reader: "the scope of signed data defined range of unexpected bytes. details: range of bytes of signature invalid" this way download file: httpcontext.current.response.contenttype = "application/pdf"; httpcontext.current.response.addheader("content-disposition", "attachment;filename= factura.pdf"); httpcontext.current.response.addheader("content-length", newstream.length.tostring()); httpcontext.current.response.buffer = true; httpcontext.current.response.bufferoutput = true; httpcontext.current.response.clear(); httpcontext.current.response.outputstream.write(newstream.getbuffer(), 0, newstream.getbuffer().length); httpcontext.current.response.outputstre

jquery - how to add the top three elements in array and delete the previous results in javascript -

what need i need store top 3 element in array . and remove previous top first 3 element array. when 4 th elements adds in array 1 deleted , whn 5 th adds 2 deleted. max array limit 3. like arr[1,2,3]; when 4 th element inserted delete arr[1] index , on. and store array in cookie js code var cookie_event_id=document.getelementbyid("eventid").value; var e = $(window).height(); var arr=[]; if (cookie.get("event_id")) { var t=cookie_event_id; var t = cookie.get("event_id"); console.log(arr.tostring()); arr.push(cookie_event_id); arr.shift(); alert(cookie_event_id); var = new date; i.setdate(i.getfullyear() ), document.cookie = "event_id =" + cookie_event_id + ";expires=" + i.toutcstring() + ";domain=.10times.com;path=/" } else { var t=cookie_event_id; var = new date; i.setdate(i.getfullyear() ), document.cookie = "event_id =" + t + ";ex

c++ - socket migration from boost::asio::io_service to another epoll loop -

i've boost asio socket. after handshaking phase on over custom protocol. want take out socket's native handle io_service , put in own epoll based loop running on different thread. so after reading last message of handshaking phase not invoking boost::asio::async_read . taking native handle , adding own epoll loop. but on client side broken pipe error. i've tried delay client before tries write, when delay several seconds gets broken pipe. in delayed time there supposed reader on server side, epoll loop. void hc::common::connection::handle_read(hc::common::connection::state s, const boost::system::error_code& error, std::size_t bytes){ hook_read(error, bytes); if(!error){ switch(s){ case header: _packet.parse_header(); ............ break; case body: bool keep_reading = available(); // virtual << here returns false overridden method _packet.clear(); if(keep_reading){ boost:

php - Modify how Function takes and queries DB? -

the following here current function: public function get($table, $where) { if (count($where) === 3) { $operators = array( '=', '>', '<', '>=', '<=' ); $field = $where[0]; $operator = $where[1]; $value = $where[2]; if (in_array($operator, $operators)) { $sql = "select * {$table} {$field} {$operator} ?"; if (!$this->query($sql, array( $value ))->error()) { return $this; } } } return false; } i modify function allow more variables in sql eg: select * table id=2 , field2 = 'test'; currently takes query this: get('table', array('field', '=', 'a')); i want modify take query this: get('table', array('field1', '=', 'a' , 

c# - Change directory path of GridView -

i have website , on 1 of pages have several gridviews . have requirement each gridview show different files different directory. can files , view them in gridview can't seem figure out how go changing directory path each grid. have far public class filedetails { public string filename { get; set; } public string fullpath { get; set; } } string[] filepaths = directory.getfiles(server.mappath("~/document/generic/")); list<filedetails> files = new list<filedetails>(); foreach(string filepath in filepaths) { string filename = path.getfilenamewithoutextension(filepath); files.add(new filedetails() { filename = filename, fullpath = filepath, }); } gridview1.datasource = files; gridview1.databind(); how implement above code change directory path gridview2, gridview3 , gridview4 . thanks in advance , support you can create method accepts string argument directory name

javascript - Express adds first part of URL to injections if you use 2 level URLs? -

i using node.js + express. when have 1-level url like: /estonia all of scripts , styles loaded correctly if have 2-level url like: /estonia/tallinn scripts , styles injections failing because adds /estonia path: before: http://localhost:5050/js/config.js after: http://localhost:5050/estonia/js/config.js here routes.js file: app.get('*', function(req, res) { var url = req.url.slice(1); var urlparamsarray = url.split("/"); if ( countries[urlparamsarray[0]] && (urlparamsarray.length===1 || cities[urlparamsarray[1]]) ) { res.sendfile(config.root_path +'/'+ config.public_path+'/index.html'); } else { res.status(404).sendfile(config.root_path + '/'+ config.public_path+'/404.html'); } }); here express.js file: app.set('view engine', 'ejs'); app.use(function (req, res, next) { res.header('access-control-allow-origin', '*'); res.header

java - Jetty9 - Jetty is not running from a separate {jetty.base} -

i see following warning while starting jetty9 server service. have no idea this. warn:oejs.homebasewarning:main: instance of jetty not running separate {jetty.base} directory, not recommended. see documentation @ http://www.eclipse.org/jetty/documentation/current/startup.html jetty recommends run instances of jetty not jetty.home distribution folder directly jetty.base folder should defined separatedly 1. see chapter declaring jetty base here: http://www.eclipse.org/jetty/documentation/current/startup-base-and-home.html the jetty distribution's start.jar component manages behavior of separation. the jetty start.jar , xml files assume both ${jetty.home} , ${jetty.base} defined when starting jetty. you can opt manually define ${jetty.home} , ${jetty.base} directories, such this: [jetty-distribution-9.3.7.v20160115]$ pwd /home/user/jetty-distribution-9.3.7.v20160115 [jetty-distribution-9.3.7.v20160115]$ java -jar start.jar \ j

python - How to add new objects to nested dictionary? -

given below object, how add new city "losangeles" in "california"? given country, state, city , attributes city, how can update object? (i pretty new python) myplaces = { "unitedstates": { "california": { "sanfrancisco": { "description": "tech heaven", "population": 1234, "keyplaces": ["someplace1", "someplace2"] } } }, "india": { "karnataka": { "bangalore": { "description": "it hub of india", "population": 12345, "keyplaces": ["jpnagar", "brigade"] }, "mysore": { "description": "hostoric place", "population": 12345, "keyplaces": ["mysorepalace"] } } } } i tried adding elem

c# - Unable to get data from a particular WCF Service Operation which is sending files in response -

i have wcf service many methods, 2 of transferring files. 1 working correct, sends 3 files byte array in single row. other 1 sending list of database rows, each row has 1 docx file in it. when wcf client invokes operation, runs on server side , rows fetched database, after sends response, client receives following exception: an error occurred while receiving http response http://localhost/service/service.svc . due service endpoint binding not using http protocol. due http request context being aborted server (possibly due service shutting down). see server l ogs more details. underlying connection closed: unexpected error occurred on receive. the minimal code listed below: [datacontract] public class document { [datamember] public int id { get; set; } [datamember] public string name { get; set; } [datamember] public byte[] file { get; set; } [datamember] public int schemaid { get; set; } [foreignkey("schemaid"

SSIS - Fuzzy Grouping Column increment -

i tried using fuzzy grouping column , added other columns pass through value of column pass through inhibited gets incremented. have any1 faced issue???? i have found solution. issue in version sql server 2008 r2 , not replicating in sql server 2012

PHP Loading data from mysql according to time -

i creating social networking website using php , mysql. facing problem in loading posts of friends , current user, , arranging them according recent. here program, know not method manage code. <?php if(isset($_cookie["uid"])) { include("includes/functions.php"); include("includes/config.php"); $uid=$_cookie["uid"]; $posts=array(); $friends=array(); $sql="select * posts uid='$uid'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $posts[]=[$row["pid"],$row["uid"],$row["post"],$row["time"]]; } } $sql="select * friends uid1='$uid' or uid2='$uid' , status='1'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { if($uid1==$uid){$friends[]=

javascript - Hide "No data available in table" message when data is present -

this table , data list using json , populate table, <table id="tblclaimsearch" class="display responsive nowrap" cellspacing="0" width="100%"> <thead> <tr> <th><input type="checkbox" id="chkboxclaimheader" name="chkboxclaimheader" value="false"></th> <th>claim #</th> <th>client name</th> <th>amount</th> <th>deduction</th> <th>type</th> <th>status</th> </tr> </thead> <tbody> </tbody> </table> my jquery has json result, result , append rows table body based on data, $(document).ready(function () { $.ajax({ url: '@url.action("claimresulttest", "claims")', data: { seacrhclaimnumber: claimnumb

Performance tuning an update statement in SQL SERVER -

i have 2 update statements. when executed both taking more 12hrs ssis. indexes on tables disabled before executing update statements. need improve performance. need suggestions: 1) first update statement update db1.table1 set db1.table1.col1 = db2.table2.col1 db1.table1, db2.table2 db1.table1.col2 = db2.table2.col2 2) second update statement update table1 set table1.col3 = 0 table1 table1.col3 null can update in batches improving performance of 1st update statement? see having default on col3 sufficient instead of running second update. not sure if effects insert queries. table having lot of data. not sure of altering table include default value on column table having lot of data. please provide suggestions performance tune above statements. please note not having proper permissions on db verify execution plan. first, know update taking longer. but, indexes not enemy when doing updates. the first update: update t1 set t1.col1 = t2.col2 db1.table1 t

In Java Jframe open another JFrame but JFrame show nothing -

i java program eclipse window builder, there got 2 class login.java menu.java so when username , password matched , login.java close , menu.java open in code, try using if(true) { menu menu = new menu(); menu.setvisible(true); login.dispose(); } else { joptionpane.showmessagedialog(null, "wrong username or password", "message", joptionpane.information_message); } and run login.java, menu.java show, in mini size , when expand it, menu.java nothing contain. i watched video tutorial on youtube, teach in way when try not working, hope can , thank lot. menu menu= new menu(); menu.frame.setvisible(true);

user controls - WPF Caliburn Micro: Exchanging UserControls in a Window dynamically using ContentControl -

this question related add usercontrol caliburm micro dynamically . have read other related threads before open new thread, still don't understand , find no solution. please accept apology if of take duplicate. i have window (mainview) contains "main" grid (aka layoutroot) 2 columns. on left column there 2 buttons: "display view 1" , "display view 2". if user click "display view 1", "display1view" (is usercontrol contains textblock text "view 1") should shown on right column, replace current one. if user click "display view 2", "display2view" (is usercontrol contains textblock text "view 2") should shown on right column, replace current one. my sample code contains following views , viewmodels: mainview.xaml , mainviewmodel.cs display1view.xaml , display1viewmodel.cs display2view.xaml , display2viewmodel.cs in sample code contentcontrol doesn't recognize usercontrol.

java - cannot find symbol error while using jframe -

this question has answer here: what “cannot find symbol” compilation error mean? 6 answers i have class called validation looks this: package information; public class validation { public static boolean emptystring(string s) { if (s == null || s.isempty()) { return true; } else { return false; } } } this jframe class: private void jbutton1actionperformed(java.awt.event.actionevent evt) { if (validation.emptystring(jtextfield1.gettext()) || validation.emptystring(jtextfield2.gettext())) { joptionpane.showmessagedialog(null, "don't leave fields empty"); } else { if (testaadmin(jtextfield1.gettext(), jtextfield2.gettext())) { basen basenframe = new basen(); basenframe.setvisible(true); this.dispose(); } else {

go - How to traverse through XML data in Golang? -

i have used xml.unmarshal method struct object has it's own limitations. need way can descendants of particular type inside node without specifying exact xpath. for example, have xml data of following format: <content> <p>this content area</p> <animal> <p>this id dog</p> <dog> <p>tommy</p> </dog> </animal> <birds> <p>this birds</p> <p>this birds</p> </birds> <animal> <p>this animals</p> </animal> </content> now want traverse through above xml , process each node , it's children in order. problem structure not fixed , order of elements may change. need way can traverse like while(content.nextnode()) { switch(type of node) { //process node or traverse child node deeper } } you can vanilla encoding/xml using recursive struct , si

html - Calculated Grid Width changes after Browser Zoom -

Image
i've built own grid system worked fine... until now. can see in screenshots below, chrome changes fixed border , content sizes weird floating values. does know why happens or can explain me how prevent it? before zoom: after zoom: cheers! i can't give specific answer since question not involve detailed information self-built grid system. nevertheless sounds problem sub-pixel rendering (see https://trac.webkit.org/wiki/layoutunit ) have had several problems that.

android - Loading AutoParallaxBackground Andengine Texture -

i'm rookie in andengine . working simple andengine game project , want load parallax background . follow step nicolas gramlich shows in parallax background example . got problem after running code saw black screen blinking colors i think problem buildabletextureatlas , parallaxtexture here code resourcemanager class public itiledtextureregion playertiledtextureregion; public itiledtextureregion enemytiledtextureregion; public itextureregion platformtextureregion; public itextureregion cloudonetextureregion; public itextureregion cloudtwotextureregion; public itextureregion cloudthreetextureregion; private buildablebitmaptextureatlas gametextureatlas; public bitmaptextureatlas mautoparallaxbackgroundtexture; public itextureregion mparallaxlayerback; public itextureregion mparallaxlayermid; public itextureregion mparallaxlayerfront; //sounds sound soundfall; sound soundjump; //music music music; //font font scorefont; here loadresource () method public void

Is there a CSS parent selector? -

how select <li> element direct parent of anchor element? in example css this: li < a.active { property: value; } obviously there ways of doing javascript i'm hoping there sort of workaround exists native css level 2. the menu trying style being spewed out cms can't move active element <li> element... (unless theme menu creation module i'd rather not do). any ideas? there no way select parent of element in css. if there way it, in either of current css selectors specs: selectors level 3 spec css 2.1 selectors spec in meantime, you'll have resort javascript if need select parent element. the selectors level 4 working draft includes :has() pseudo-class works same jquery implementation . of april 2017, this still not supported browser . using :has() original question solved this: li:has(> a.active) { /* styles apply li tag */ }

after failed attempt to install HAM for android studio, getting compile error in android studio -

i have failed install ham software android studio. gave error alert saying vt-x should enabled. after compilation in android studio started givng problem. log compiling follows: com.android.ide.common.internal.loggederrorexception: failed run command: d:\androidnewsetup\newsdk\build-tools\20.0.0\dx.bat --dex --no-optimize --output d:\mari\marriott code base\may12\android-dev\app\build\intermediates\dex\uat\debug d:\mari\marriott code base\may12\android-dev\app\build\intermediates\classes\uat\debug d:\mari\marriott code base\may12\android-dev\app\build\intermediates\pre-dexed\uat\debug\internal_impl-21.0.3-5eb35d3ffd9a9241c5b094f0bf2272ac102305b0.jar d:\mari\marriott code base\may12\android-dev\app\build\intermediates\pre-dexed\uat\debug\ensightenaspect-client-c8e967b342d1ed907a85146c22c1fb8be74f2433.jar d:\mari\marriott code base\may12\android-dev\app\build\intermediates\pre-dexed\uat\debug\javax.inject-1-da2f0738adb03c6d7edd76e41d1c341bfc32030d.jar d:\mari\marriott code

java - SQLite UNION not performing when one resultset is empty -

i have union in sqlite select data 3 rtree's create table monsters (id int primary key, x int, y int, z int, name text, health int, strength int, regen int, weapon int); create table animals (id int primary key, x int, y int, z int, name text, health int,species int, speed int, drops int, speech int); create table players (id int primary key, x int, y int, z int, name text, health int,uuid text, stamina int, level int); create virtual table rtreeone using rtree(id, startx,endx,starty,endy,startz,endz); create virtual table rtreetwo using rtree(id, startx,endx,starty,endy,startz,endz); create virtual table rtreethree using rtree(id, startx,endx,starty,endy,startz,endz); create trigger updateone after insert on monsters each row begin insert rtreeone (id, startx,endx,starty,endy,startz,endz) values (new.id, new.x, new.x, new.y, new.y, new.z,new.z);end; create trigger updatetwo after insert on animals each row begin insert rtreeone (id, startx,endx,starty,endy,startz,endz) val

amazon web services - How do I set an elasticache redis cluster as a slave? -

according elasticache manual, slaveof command restricted aws cache nodes. is there anyway set existing elasticache node slave can migrate existing redis cluster on aws? as you've spotted, elasticache doesn't support slaveof command can't add elasticache node existing cluster , promote primary node/switch off existing cluster. instead, migrate redis cluster should create snapshot using either bgsave or save produce .rdb snapshot file. you should upload snapshot file s3 , allow elasticache access file: to grant elasticache read access snapshot copied amazon s3 sign in aws management console , open amazon s3 console @ https://console.aws.amazon.com/s3/ . click buckets, , click name of amazon s3 bucket contains .rdb file. click name of folder contains .rdb file. click name of .rdb file, click actions drop-down menu, , select properties. click permissions, , click add more permissions. in grantee box, type email address:

XCode's #pragma - mark for Atom editor? -

is there xcode's "pragma mark" atom editor? it great. thank helping. eric this best package find far: https://atom.io/packages/comment-anchors

jquery - Refresh selected option -

i have select tag, jquery works fine except @ loading. @ loading option should hidden visible. if click on select option won't available because 1 hidden (then if select else becomes hidden) not @ loading, why? edit: checked, every option visibility hidden @ beginning, have no idea why i have work fine after loading: function nextvisibleoption() { function nextvisibleoption() { $j("#list_departement option").each(function() { if($j(this).is("option:visible")) { $j("#list_departement").val($j(this).val()); return false; } return; }); } and called @ beginning of script when page load: $j("#liste_pays_selected img").each(function() { var id_pays = $j(this).data("id_pays"); $j("#lst_pays option[value=" + id_pays + "]").hide(); }); nextvisibleoption(); strangely every option considered not visible because script not entering inside

.net - How to make ServiceStak service internal access only -

i want make services access internal only. there way global set restrictattribute affect services ? the easiest way restrict services use globalrequestfilter , e.g: globalrequestfilters.add((req, res, dto) => { if ((requestattributes.internalnetworkaccess & req.requestattributes) == 0) { res.statuscode = (int)httpstatuscode.forbidden; res.statusdescription = "external requests forbidden"; res.endrequest(); } });

java - Intercept static method with aspectJ -

this question has answer here: how intercept static methods in spring? 1 answer i'm using spring , trying write sample application aspectj. need learn how intercept static method calls. in example i'm trying intercept main method follows: spring configuration file: <aop:aspectj-autoproxy /> <!-- aspect --> <bean id="logaspect" class="com.package.aspect" /> the main method: public class app { public static void main(string[] args) throws exception { applicationcontext appcontext = new classpathxmlapplicationcontext("spring-customer.xml"); system.out.println("str"); } } the asspect itself: @aspect public class aspect { @around("execution(*app.main(..))") public void logaround(proceedingjoinpoint joinpoint) throws throwable { system.out.prin