Posts

Showing posts from June, 2012

Delete to tab boundaries in IntelliJ IDEA 13.1 -

Delete to tab boundaries in IntelliJ IDEA 13.1 - when press tab intellij inserts 2 spaces (which want), when press delete intellij removes 1 space @ time. how create delete tab boundaries instead of 1 @ time? i tried solve problem too, appears not possible @ moment. the closest solution problem smart backspace feature, nowadays in intellij thought 14. according comment in blog post mentioned below seems same functionality planned delete key, not implemented yet. http://blog.jetbrains.com/idea/2014/07/the-backspace-key-gets-smarter-in-intellij-idea-14-eap/ https://youtrack.jetbrains.com/issue/idea-87318 intellij-idea

MySql PHP select count of distinct values from comma separated data (tags) -

MySql PHP select count of distinct values from comma separated data (tags) - how can select count of distinct values info stored comma separated values in mysql? i'll using php output info mysql in end. what's in there, tags each post. in end, i'm trying output info way stackoverflow it's tags, this: tag-name x 5 this how info in table looks (sorry content, it's site recipes). "postid" "tags" "category-code" "1" "pho,pork" "1" "2" "fried-rice,chicken" "1" "3" "fried-rice,pork" "1" "4" "chicken-calzone,chicken" "1" "5" "fettuccine,chicken" "1" "6" "spaghetti,chicken...

r - replace with NA -

r - replace <NA> with NA - i have info frame containing entries; appears these values not treated na since is.na returns false. convert these values na not find way. the 2 classes issue character , factor. should loop on dtaframe , convert "na" values true <na> 's 2 classes: make.true.na <- function(x) if(is.character(x)||is.factor(x)){ is.na(x) <- x=="na"; x} else { x} df[] <- lapply(df, make.true.na) (untested in absence of info example.) utilize of form: df_name[] effort retain construction of original dataframe otherwise lose class attribute. see ujjwal thinks spelling of na has flanking "<>" characters might seek functions more general: make.true.na <- function(x) if(is.character(x)||is.factor(x)){ is.na(x) <- x %in% c("na", "<na>"); x} else { ...

javascript - Tab cursor when character inputed -

javascript - Tab cursor when character inputed - here js fiddle example: http://jsfiddle.net/t3u8q5vr/1/ html: <input type="text" maxlength="1" size="1" /> <input type="text" maxlength="1" size="1" /> <input type="text" maxlength="1" value="e" tabindex="-1" size="1" readonly /> <input type="text" maxlength="1" size="1" /> <input type="text" maxlength="1" value="r" tabindex="-1" size="1" readonly /> <input type="text" maxlength="1" size="1" /> <div> <button class="buttons">á</button> <button class="buttons">é</button> <button class="buttons">í</button> <button class="buttons">ó</button> <button class="buttons">ú...

c# - Can LINQ construct and return a multidimensional array -

c# - Can LINQ construct and return a multidimensional array - yes, know difference between jagged array [][] , multidimensional array [,]. yes, have looked duplicates , found these: how utilize linq on multidimensional array 'unwind' array? convert 2 dimensional array c# linq homecoming multidimensional array linq the lastly 1 of these contains function job. question still: there way (no matter how contorted or contrived) persuade linq build , homecoming result in form of multidimensional array (and not jagged array)? it's not relevant question, problem led here 1 of little jobs looked "made linq", except function needed phone call had been defined multidimensional array parameter. linq code produce reply jagged array took 5 minutes write, , what? did miss something, or there no way linq job? i supposed should say: other writing chunk of code old way , embedding lambda or calling extension method. if linq can neither produce nor consume ...

node.js - MongoDB References how to? -

node.js - MongoDB References how to? - i have 2 collections in mongodb (i utilize node js) first: { _id: "france", color: "red", refid: { "1": "fra1", "2": "fra2"}} second: { _id: "fra1", color: "blue", info : "country"} { _id: "fra2", color: "white", info : "country"} how can display info in illustration console.log show me reference beetwen collections? info displayed in way(when type db.first.find().pretty()): { _id: "france", color: "red", refid: { "1": "fra1", color: "blue", info : "country", "2": "fra2", color: "white", info : "country"} } } node.js mongodb

log4j custom pattern in otroslogviewer -

log4j custom pattern in otroslogviewer - hi tried using otroslogviewer viewing application logs.but everytime seek loading logs otroslogviewer gives error message regarding log4j custom pattern parsing my log4j pattern property log4j.appender.file.layout=org.apache.log4j.patternlayout log4j.appender.file.layout.conversionpattern=%-5p: %d{dd-mmm-yyyy hh:mm:ss,sss}: %c.%m(): %m%n can tell me right pattern format need specify in pattern property file in otroslogviewer if logs looks like: info : 10-oct-2014 11:30:09,178: com.tcs.sgv.acl.service.accesscontrolserviceimpl.getalluserelement(): in global service loggedinpost---100016 info : 10-oct-2014 11:30:09,179: com.tcs.sgv.acl.service.accesscontrolserviceimpl.getalluserelement(): userid...103002 info : 10-oct-2014 11:30:09,180: com.tcs.sgv.acl.service.accesscontrolserviceimpl.getalluserelement(): locale...en_us – you can utilize next log pattern (menu tools-> show log4j pattern parser editor): type=...

Difference between Color and UIColor in Swift? -

Difference between Color and UIColor in Swift? - whats difference between using let magenta = color(red: 1.0, green: 0.0, blue: 1.0) and let magenta = uicolor(red: 1.0, green: 0.0, blue: 1.0, alpha:1.0) ? swift

c# - HttpContext.GetOwinContext().GetUserManager() return null -

c# - HttpContext.GetOwinContext().GetUserManager<AppRoleManager>() return null - i've used asp.net identity 2 creating role result of httpcontext.getowincontext().getusermanager<approlemanager>() null. then couldn't create role. how can solve problem? public class mvccontroller : controller { public mvccontroller() { } public approlemanager rolemanager // returns null ?! { { homecoming httpcontext.getowincontext().getusermanager<approlemanager>(); } } public user currentuser { { string currentuserid = user.identity.getuserid(); user currentuser = datacontextfactory.getdatacontext().users.firstordefault(x => x.id.tostring() == currentuserid); homecoming currentuser; } } public iauthenticationmanager authmanager { { homecoming httpcontext.getowincontext().authentication; ...

Images loaded in ImageView disappear on fragment reLoad -

Images loaded in ImageView disappear on fragment reLoad - i have fragment edit contents. in fragment have imageview displays image picked gallery or photographic camera fragment in turn opens fragment. fragment when goes edit fragment displayed image goes disappear , imageviews goes blank , every thing else (edittext,textviews) remains persistant(filled) note when goes edit fragment oncreateview called not oncreate method illustration when replace fragment fragment , pops previous 1 oncreateview method called first i can't understand happening pls help. android-fragments android-imageview

java - Using Simple language in Camel log -

java - Using Simple language in Camel log - i have problem logging in camel. have log statement this: from(jmsoutboundinendpoint).routeid("outbound") .to(generatelogendpoint("outbound.in")) .process(endpointprocessor) .to(generatelogendpoint("outbound.endpoint.set")) .to(direct_request_outbound) .log(logginglevel.debug, "message body: ${body}"); and in log file can see message body: ${body} instead of actual body of message. i'm doing wrong? grateful help! log(logginglevel.debug, "message body: ${body}") should work properly. please, insert log statement straight after from statement , verify if log correct. java apache apache-camel

sqlite - android sql how to handle large Query 200000 lines database? -

sqlite - android sql how to handle large Query 200000 lines database? - i utilize code give suggestions user when typing. 1 query takes lot of time. there way speed up? string cnql = "select distinct sinhala jgd sinhala '"+gg+"%' limit 0,4"; cursor cg=cn.rawquery(cnql, null); you can create virtual table total text searching on android provides quick way retrieve matching strings. however, require set , maintain separate fts virtual table , populate strings want search. focus total text search, not back upwards 'starts with' type of operator, although can gg + "*" search words prefixed search query. android sqlite

python - How to get the class name of a staticmethod -

python - How to get the class name of a staticmethod - so there static method in base of operations class, , sub classes should utilize it. however, need know sub class calls static method. the code this: class baseclass(): @staticmethod def getname(): #some magic class subclassa(baseclass): pass class subclassb(baseclass): pass subclassa.getname() #hope see 'subclassa' subclassb.getname() #hope see 'subclassb' or, possible? not possible staticmethod . possible, however, classmethod class a(object): @classmethod def f(cls): print cls python static-methods

python - In Odoo / OpenERP 8, How to visible button Attachment for a specific group on a specific model form? -

python - In Odoo / OpenERP 8, How to visible button Attachment for a specific group on a specific model form? - in odoo / openerp 8, how visible button attachment specific grouping on specific model form? much! you can add together groups attribute button in .xml file. like eg: groups="group_eg" python openerp odoo

excel - Get the reference of a cell containing a certain text -

excel - Get the reference of a cell containing a certain text - i have somewhere in worksheet cell containing specific text (for exemple "hello") , want know cell it. want know reference of cell (for exemple "b52"). i tried things index or match formula i'm quite confused how should kind of query. it great if give tips. thank's in advance ! try little macro: sub whereis() dim r range each r in activesheet.usedrange if instr(1, r.text, "hello") > 0 msgbox r.address exit sub end if next r end sub edit#1 here same approach in user defined function (udf) format: public function whereis(rin range, sin string) string whereis = "" dim r range each r in rin if instr(1, r.text, sin) > 0 whereis = r.address(0, 0) exit function end if next r end function and here illustration of utilize in worksheet: edit#2 it po...

Outlook addin delay during load using add-in express -

Outlook addin delay during load using add-in express - i have created outlook addin using add-in express. com addin. there time delay of 35 seconds while custom addin loads outlook's memory, thought might due code inside, when commented code in addinmodule() i.e. constructor, still takes 35 seconds. while tried analyze farther in log file, see, there no log duration, log details below " 00:18:46 3880 4572 'shadow copy' enabled. 00:18:46 3880 4572 creating new application domain. 00:18:46 3880 4572 success. 00:19:21 3880 4572 unwrapping managed class. 00:19:21 3880 4572 success. " help appreciated. the solution seems upgrading .net version. i updated framework 4.5. suggested add-in express. there improvement of around 25 seconds, huge difference. meanwhile on code side, got few lines of code changed ensure loads asynchronously. outlook delay add-in outlook-addin

vagrant - Configuring PHPStorm to accept connections from another domain (AJAX) -

vagrant - Configuring PHPStorm to accept connections from another domain (AJAX) - i'm pulling out hair trying figure out how best setup php storm utilize xdebug in next scenario. have laravel application running on domain laravel.com (this api in making) , website @ website.com. website makes ajax requests of laravel application here want utilize xdebug most. seem missing in setup when browse laravel or website urls straight breakpoints work fantastically. if utilize ajax login form on website hits laravel.com/login not see breakpoint action on laravel controller. need have phpstorm hear connection on domain? there sort of proxy setting need setup. seem going in circles, help appreciated. on vagrant box way. vagrant phpstorm xdebug

swing - Ghost Exceptions: Java exceptions on empty lines -

swing - Ghost Exceptions: Java exceptions on empty lines - well, trying create interface calculator. @ point, have 1 button, greeting label, , label become main line of calculator. when run code, window opens , greeting displayed, button seen. terminal displays: exception in thread "main" java.lang.error: unresolved compilation problem: cannot utilize in static context @ components.interface.buttons(interface.java:45) @ components.interface.main(interface.java:60) the thing is, if there no code on lines 45 , 60, java still throws exception lines. why doing this? code below: package components; import java.awt.event.*; import java.awt.*; import javax.swing.*; public class interface { public static void main(string[] args) { // todo auto-generated method stub jframe frame; jpanel text = new jpanel(); jpanel controlpanel = new jpanel(); jlabel digits = new jlabel(""); frame = new jfram...

JSON Export Type CSV in UI5 - Umlauts -

JSON Export Type CSV in UI5 - Umlauts - i have problem convert umlauts "äöü" in .csv format (output ä=ä, ö=ö, ü=ü). how can convert json table in utf-8 before export info .csv utilize in excel? export info json , next code: var otable= sap.ui.getcore().byid("otable"); var otablejson = otable.getmodel().getproperty("/"); var omodel = new sap.ui.model.json.jsonmodel(); omodel.setdata(otablejson); var oexport = new sap.ui.core.util.export({ exporttype: new sap.ui.core.util.exporttypecsv({ separatorchar: ";", charset: "utf-8", }), models: omodel, rows: { path: "/" }, columns: [ { name: "first name", template: { content: { path: "firstname" } } }, { name: "last name", template: { content: { ...

Android client for SignalR -

Android client for SignalR - i need back upwards in signalr android client. using next client signalr/java-client unable know start :) completed .net self host & working fine. problem android & iphone. can 1 please guide me how start next steps android & iphone. you don't give lot of details, it's hard give concrete answer, since question broad begin with. nonetheless, should have @ official samples java client, started. if have implemented server side yourselves, , know java, should pretty easy figure out code provided in these samples. java client is, in experience, easy use. as ios client, google search came this library. have never used it, , looks it's not getting whole lot of support, give shot. signalr signalr-hub signalr.client

Queries for Android RatingBar customization -

Queries for Android RatingBar customization - i creating screen nutrient review 1 of android application. know android provides default ratingbar control. wanted replace star based rating emoticon [smilies] or other custom images. tried google images specific rating bar , not able find relevant. point me tutorial helps develop emoticon rating system? helpful me if point me websites download icons rating bar in android. how create custom ratings bar in android question should similar you're going for. can icons https://www.iconfinder.com/ sure check license on images though. android android-ui rating

ruby on rails - Why does @user.update_attributes(nil) return true? -

ruby on rails - Why does @user.update_attributes(nil) return true? - i'm writing rails app , i'm trying figure out why passing invalid params update_attributes returns true. valid params homecoming true. for example: @user.update_attributes(params[:user]) => true and @user.update_attributes(params[:whatever]) => true also @user.update_attributes(false) => true @user.update_attributes(nil) => true everything returns true. why? , how check if valid params in update_attributes? update_attributes update attributes passed, , if no attributes passed there's nil update , record may saved. update_attributes homecoming false if record not saved due validation. however, doesn't mean attributes in hash in error... may field set elsewhere made record invalid. # record has validation email address must valid format @user.email = "invalid address" @user.update_attributes(name: "fred") => false # due email...

javascript - Angular extending controllers -

javascript - Angular extending controllers - i have 2 controllers in angular - 'table' , 'studenttable'. the problem $scope in 'table' cannot read info $scope in 'studenttable'. suppose $scope.data2 equal $scope.data clicking button not work. the reason why have 2 controllers have many tables, 'teachertable', 'classroomtable',etc , utilize functions of 'table'. kind of extending 'table'. there way can create works or better? (function () { "use strict"; angular.module("app", []).controller("table", ['$scope', function ($scope) { homecoming $scope.displaydata = function () { homecoming $scope.data2=$scope.data; }; }]) .controller("studenttable", ['$scope', '$http', function ($scope, $http) { homecoming $scope.getdata = function () { $http.post('/api/getuserbyuserid/1', {})....

criteria - Trying to use update query to only update fields that are blank in Microsoft Access -

criteria - Trying to use update query to only update fields that are blank in Microsoft Access - i trying utilize update query update fields 1 table fields if fields in table updating blank. if contain information, not want overwrite existing data e.g field: name table: table 1 update to: [table2.][name] criteria: i unsure of set in criteria. tried, 'is null', "". here example: update mytable set mytable.fieldb = "mynewvalue" (((mytable.fieldb) null)); ms-access criteria

android - funf scheduling and data collection -

android - funf scheduling and data collection - i new android programming , new funf sensor framework. based on illustration give below take on scheduling probe @ specified intervals. sqlite database created empty , dont think info collected @ all. ideas please. public class mainactivity extends activity { private static final string tag = "app"; protected static final string pipeline_name = "default_pipeline"; private funfmanager manager; private pipeline pipeline; private handler handler; private serviceconnection conn = new serviceconnection() { @override public void onservicedisconnected(componentname name) { log.e(tag,"onservicedisconnected"); manager = null; } @override public void onserviceconnected(componentname name, ibinder service) { log.e(tag,"onserviceconnected"); manager = ((funfmanager.localbinder)service).ge...

c# - Managing and Restricting the Number of API Sessions -

c# - Managing and Restricting the Number of API Sessions - i'm working wsdl api has limit of 100 sessions @ time. i'm using c#, means in application can ever have in existence 100 instances of wssession class, otherwise api reject calls. what best way approach this? i'm working in big application nail 100 session limit. don't want throw error when session limit hit, instead i'd rather block until session available. you can route remote calls through single service maintain counter of how many operations taking place @ time when phone call happens. you can utilize semaphore command concurrency on given block. assuming have proxy service created external webservice create service handle calls. i´m assuming using inversion of control, need sure there is single instance of service handling all calls. there alternatives this; moving semaphore out , making singleton or giving semaphore name. service: public class pooledservice { ...

html - How can you style/modify django file fields? -

html - How can you style/modify django file fields? - in django (1.6) project, have form filefield uploading images (it filefield , not imagefield legacy reasons). currently render form field in template doing {{ form.image }} renders label, link image, clearing checkbox , upload button. good, need style separate modules. for url, i'd create render as: <a href="url" class="fancybox" rel="group"> <img src="url" alt="product image" class="img-responsive"> </a> and other parts (buttons, checkbox), want add together css classes them. i looked @ clearablefileinput widged responsible rendering filefield , thinking maybe can accomplish overriding methods, not sure override alter little possible. how can accomplish right way? the widget accepts attrs parameter. it's dictionary passed along attributes on rendered html widget. here docs. here's illustration docs class s...

objective c - Logging off ios app and returning to RootViewController -

objective c - Logging off ios app and returning to RootViewController - i created rootviewcontroller in app delegate so: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; startviewcontroller *viewcontroller = [[startviewcontroller alloc] init]; startnavigationcontroller *navigationcontroller=[[startnavigationcontroller alloc] initwithrootviewcontroller:viewcontroller]; self.window.rootviewcontroller = navigationcontroller; [self.window makekeyandvisible]; } when nail logout button, want send user rootview controller: - (ibaction) logoutbuttonpressed:(uibutton *)sender { [users logout]; [self.navigationcontroller poptorootviewcontrolleranimated:yes]; } this works fine when run on iphone 4s (testing iphone 6 when arrives), if leave user logged in more day , click logout button, screen slides black. w...

how to set View height in tablelayout in android? -

how to set View height in tablelayout in android? - i have problem want set view in table layout , manage height not able set height. taking bydefault height. note:- view in reddish color please give me thought this. /* code */ tablelayout.addview(tablerow); view lineview = new view(this); lineview.setlayoutparams(new tablelayout.layoutparams(layoutparams.wrap_content, layoutparams.wrap_content, 1f)); //lineview.setpadding(0, 1, 0, 0); //lineview.setminimumheight(1); lineview.setbackgroundresource(r.drawable.red); tablelayout.addview(lineview); final viewgroup.marginlayoutparams lpt =(marginlayoutparams)lineview.getlayoutparams(); lpt.setmargins(lpt.leftmargin,lpt.topmargin,lpt.rightmargin,lpt.bottommargin=2); /* , layout */ "thanks" you need set width , height of view in line... lineview.setlayoutparams(new tablelayout.layoutparams(layoutparams.wrap_content, layoutparams.wrap_content, 1f)); you giving hei...

java - Find the k smallest integer in an array -

java - Find the k smallest integer in an array - here code, works finding 1-7 smallest integers, 8 , 9. returns null when find 8 smallest integer in array. can help me problem? using quicksort here. much! update: have figured out problem, array in main function. after alter next look, int[] arr = {2, 3, 1, 7, 5, 6, 20, 8, 4, 9}; and if(front>=end) homecoming input; it works now! import java.util.arrays; import java.io.*; class quicksort{ public static void main(string[] args){ int[] arr = new int[9]; arr[0] = 7; arr[1] = 2; arr[2] = 4; arr[3] = 8; arr[4] = 3; arr[5] = 5; arr[6] = 1; arr[7] = 0; arr[8] = 10; system.out.println((arrays.tostring(findksamllest(arr,8)))); } public static int partition(int[] input, int front, int end){ int pivot = input[front]; while(front < end){ while(input[front]<pivot) front++; while(input[end]>pivot) end--; swap(inpu...

python - How to handle form.non_field_errors and form.errors? -

python - How to handle form.non_field_errors and form.errors? - i need display non_field_errors , field errors in different styles. did below {% if form.non_field_errors %} <div class="alert alert-danger" role="alert"> {{ form.non_field_errors }} </div> {% endif %} {% if form.errors %} <div class="alert alert-info" role="alert"> {% field in form %} {% if field.errors %} {{ field.errors| striptags }} {% endif %} {% endfor %} </div> {% endif %} but when there non field error without field errors, both sections displayed. how can display non field error section if there no field errors? your if status {% if form.errors %} triggered when there form errors, including non field errors. maybe can convert sec block loop , place if status within: {% field in form %} {% if field.errors %} <div class="alert alert-info"...

tsql - SQL Server: Can Merge Insert Conditionally or Update a Source Table? -

tsql - SQL Server: Can Merge Insert Conditionally or Update a Source Table? - i using sql server 2008 , synchronizing info between 2 tables this: merge stock target using stockhistory source on target.srno = source.srno when matched # update record target table when not matched # insert record target table when not matched source # update source table - current record question 1: insert record conditionally "when not matched then" fire. e.g. in case source table column refsrno_stockcompany null should not insert in target. question 2: in case target table "stock" not matched source "when not matched source then" fire , should update source table --> issoldout = 'yes'. kindly suggest how can accomplish this. thanks for question 1: add together and status when not matched clause: when not matched , source.[refsrno_stockcompany] not null # insert record ...

javascript - Advanced structuring: Surrounding ngRepeated items Angular.js -

javascript - Advanced structuring: Surrounding ngRepeated items Angular.js - you have array of objects you're iterating over, how surround every (x) elements (element)? if goal is: to have (element) surrounding every 4 ng-repeated elements? surrounding ng-repeated-elem ng-repeated-elem ng-repeated-elem ng-repeated-elem / surrounding ng-repeated-elem ng-repeated-elem ng-repeated-elem ng-repeated-elem / to have (element) surrounding every 2 groups of 4 ng-repeated elements complicated surrounding ng-repeated-elem ng-repeated-elem ng-repeated-elem ng-repeated-elem / surrounding ng-repeated-elem ng-repeated-elem ng-repeated-elem ng-repeated-elem / / complicated surrounding ng-repeated-elem ng-repeated-elem ng-repeated-elem ng-repeated-elem / surrounding ng-repeated-elem ng-repeated-elem ng-repeated-elem ng-repeated-elem / / normal usage of ng-repeat: <div ng-contr...

swift - Floats SpriteKit -

swift - Floats SpriteKit - why spritekit utilize floats position though there can't decimal point in pixels? i building game in spritekit , wondering whether should create character position in ints optimize not sure whether there performance improvements. is worth converting character positions ints optimize? in general, it's simpler utilize floats integers when dealing graphics above bit-twiddling level. note core graphics uses floats coordinates. the reason it's simpler want things scale (by non-integer factor) , rotate coordinates, images, paths, etc. if utilize integers, rounding errors accumulate noticeable amount quickly. if utilize floats, rounding errors take much longer become noticeable - don't become noticeable @ all. also consider sknode has xscale , yscale properties. if scale node, fractional part of children's positions can have big effect on positions on screen. you should not convert character positions ints. spr...

loops - Java Number-Guessing Game Issue -

loops - Java Number-Guessing Game Issue - i trying build number guessing game in java unlike usual 1 guess number , programme tells whether high or low. trying build 1 programme guesses number , whether high or low until programme finds number chose. i having issue "if" statement number programme guesses low. the specific issue here: if (hilow.equals("l")) { middle = middle * 2; system.out.println(middle); numbguesses++; } the entire programme far following: import java.util.*; public class numbguess { public static void main(string args[]) { int numbguesses = 0; boolean win = false; int hi = 1000000; int low = 0; scanner input = new scanner(system.in); int middle = hi / 2; system.out.println(middle); while (win == false) { string hilow = input.nextline(); if (hilow.equals("h")) { ...

ios - load image by "imagenamed" method in xcode 6 -

ios - load image by "imagenamed" method in xcode 6 - i sense should typical question, haven't found reply yet. i'm trying load image imagenamed method iphone, ipad, retina , non-retina. i'm doing add 4 images image assets. ( image_name~iphone.png , image_name@2x~iphone.png , image_name~ipad.png , image_name@2x~ipad.png ) , set image set name "image_name". in code phone call [uiimage imagenamed:@"image_name"] load different devices , resolutions. the problem edges of image distorted non-retina devices ipad mini , ipad 2. i'm thinking maybe not picking right image non-retina devices. there wrong naming conventions? suggestions welcome! sorry interruption. ends problem of image.=p ios

ios - JSON outputted as key with blank value -

ios - JSON outputted as key with blank value - so have dictionary i'm trying send node hapi server ios device. and reason request payload adding dictionary key blank value. here ios code nsdictionary *userdata = [user usertodictionary: newuserinfo]; nsdata *userjson = [nsjsonserialization datawithjsonobject: userdata options: kniloptions error: nil]; nsstring *urlstring = [nsstring stringwithformat: @"%@%@/addnewuser", kbaseurl, kusers]; // set url nsurl *url = [nsurl urlwithstring: urlstring]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl: url]; [request sethttpmethod: @"post"]; [request addvalue: @"application/json" forhttpheaderfield: @"content-type"]; // set url session nsurlsessionconfiguration* config = [nsurlsessionconfiguration defaultsessionconfiguration]; nsurlsession *session = [nsurlsession sessionwithconfiguration: config]; nsurlsessionuploadtask *uploadtask = [session uploadtaskwithrequest: req...

php - mysql date and time filter -

php - mysql date and time filter - can please recommend can find documentation next : i have mysql table called customer ---------------------------------- name + surname + email + dob --------------------------------- my dob table format : dd-mm-yyyy hh:mm:ss i have html filter done form lets search "from date - " date " it not post or dont know how create filter date. any help appreciated. first have convert "from date" "to date" in dd-mm-yyyy formate. then add together status in query as where dob between "from date 00:00:00" , "to date 23:59:59" php mysql filter

javascript - Backbone.js model caching -

javascript - Backbone.js model caching - note : very beginer on backbone platform !! :) i have model in backbone: var errors_model = backbone.model.extend( { total_errors : 0, error_messages : {}, initialize : function () { this.set('total_errors', 0); this.set('error_messages', {}); }, add_error : function (tab, field, error) { var error_messages = this.get('error_messages'); var error_md5 = this.md5(error); if(!(tab in error_messages)) { error_messages[tab] = {}; } if(!(field in error_messages[tab])) { error_messages[tab][field] = {}; } if(!(error_md5 in error_messages[tab][field])) { error_messages[tab][field][error_md5] = error; } th...

ios - Allow landscape when UIWebView is playing video -

ios - Allow landscape when UIWebView is playing video - i have uiviewcontroller uiwebview play video stream. whole app made portrait orientation only, i'd video play on landscape well. the furthest implement method on appdelegate : - (nsuinteger)application:(uiapplication *)application supportedinterfaceorientationsforwindow:(uiwindow *)window { homecoming [[window rootviewcontroller] ismemberofclass:[uiviewcontroller class]] ? uiinterfaceorientationmaskallbutupsidedown : // if current view player, allow landscape uiinterfaceorientationmaskportrait; // otherwise, portrait-only } debugging top-most view controller, found out when video player appears fellow member of uiviewcontroller , , since app not display other vc of class (only subclasses), work. it allow me rotate video (and video), great, when close video , app returns previous vc, navigation bar breaks: instead of having regular 64 pt height (20 status bar + 44 of navbar itse...

Read xml data in java -

Read xml data in java - i trying read xml file info using java program. o/p shows null only. the thought read value illustration content name below xml file 1.e. content value="assetflow_trial_07.mpg" below xml file. blank output only. below xml file, xml file: <?xml version="1.0" encoding="utf-8"?> <adi> <metadata> <ams asset_name="mntario8616_8889pk_026" provider="rogers" product="draod" version_major="4" version_minor="12" description="kids_in_hall_ep__1package_asset" creation_date="2010-06-11" provider_id="hboworld" asset_id="tjpk0000000000000026" asset_class="package"/> <app_data app="mod" name="provider_content_tier" value="ifcc_free_10"/> <app_data app="mod" name="metadata_spec_version" value="cablelabsvod1.1"/> </metadata> <as...

java - How To Check For Diagonal Neighbors in a 2D Array and Set Current Value Equal to Number of Neighbors -

java - How To Check For Diagonal Neighbors in a 2D Array and Set Current Value Equal to Number of Neighbors - i trying walk through 2d array , count diagonal neighbors equal 0, set current position equal number of neighbors. example: 0 5 0 9 0 5 0 3 1 9 4 6 7 0 0 9 should alter to 0 2 0 1 0 3 1 2 1 3 1 2 0 1 1 1 i using next code (i grab exceptions because there index out of bounds exceptions parameter numbers) : int row, col, count; count = 0; // standard for-loop used in walking through 2d array (row = 0; row < num; row++) { (col = 0; col < num; col++) { // check top left neighbour seek { if (grid[row - 1][col - 1] == 0) { count++; } } grab (indexoutofboundsexception e) { } // check bottom left neighbour seek { if (grid[row - 1][col + 1] == 0) { ...

jquery - Clear input box when input:invalid in html using javascript -

jquery - Clear input box when input:invalid in html using javascript - my goal clear input type text box when focused if input invalid. let's have text box has maximum value of 200 <input id="textbox" type = "text" max="200" runat="server"> so let's input 150 it's valid hence if focus 1 time again on it, remain value 150 but, if input greater 200, text box have have reddish border color on , focused on textbox(its working on current code) , if focus on again, want clear value. i wanna this. input:invalid { box-shadow: 0 0 1px 3px #e74c3c; } input:focus:invalid { textbox.value = "" (i know not work, wanna how?) } note have multiple textboxes different max , min values, not one. you can utilize validitystate interface enables check state of each input field. first need hear onfocus event. example: var form = document.queryselecto...

php - Saving Form Information to File on server -

php - Saving Form Information to File on server - i need save form input text file on server. have created text file on server "email.txt", , given permissions of 777. when form submitted text file remains blank. my html follows: <form action="process.php" method="post"> <input id="email-input" type="text" name="your-email" placeholder="you@yourmail.com" class="cform-text" size="65" title="your email"> <input id="optin-button" type="submit" value="download report" class="cform-submit"> </form> php follows: <?php $email = $_post["email-input"]; $to = "you@youremail.com"; $subject = "new email address mailing list"; $headers = "from: $email\n"; $message = "a visitor site has sent next email address added mailing list.\n email address: $email"; $user ...

ubuntu - Apache two domains on two different ip addresses -

ubuntu - Apache two domains on two different ip addresses - i trying setup 2 different domains on 2 different ip addresses: bbb.zzz.xxx.yyy & bbb.xxx.yyy.zzz . problem is, domain1 working fine. sec site (domain2) working when come in ip address in browser, shows content of domain1 when come in wwww.domain2.com . how should solve ? there module missing ? using different files in sites-available directory different domains. <virtualhost bbb.zzz.xxx.yyy> # admin email, server name (domain name) , aliases serveradmin **********@gmail.com servername domain1.com serveralias www.domain1.com # index file , document root (where public files located) directoryindex index.php documentroot /home/apachewebsites/domain1/httpdocs # custom log file locations loglevel warn errorlog /home/apachewebsites/logs/error.log customlog /home/apachewebsites/logs/access.log combined <directory /home/apachewebsites/domain1/httpdocs/> options i...

javascript - Isotope Masonry with multiple widths columns -

javascript - Isotope Masonry with multiple widths columns - i'm trying layout using has 3 different widths using masonry: the problem lastly element doesn't seem work get: this code: $( function() { $('.isotope').isotope({ itemselector: '.item', masonry: { columnwidth: 394 } }); }); #main{ width: 1250px; margin: 0 auto; .isotope{ max-width: 1250px; .item { float: left; width: 394px; &.width2 { width: 835px; } &.width3 { width: 367px; } } } } <div id="main"> <div class="isotope"> <div class="item"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/home-1.jpg"></div> <div class="item"><img src="<?php bloginfo('stylesheet_di...

html - media screen and max width -

html - media screen and max width - i doesnt know much media queries, want seek create responsive divs. set div resolutions: @media screen , (max-width:768px) { div#zarada p {width:100%; font-size: 14px;} .zaradabox img {display:none;} } @media screen , (max-width:1024px) { div#zarada p {width:38%; font-size: 14px;} } @media screen , (max-width:1280px) { div#zarada p {width:38% } } @media screen , (max-width:1366px) { div#zarada p {width:39% } } @media screen , (max-width:1440px) { div#zarada p {width:42%} } @media screen , (max-width:1536px) { div#zarada p {width:46% } } @media screen , (max-width:1600px) { div#zarada p {width:48% } } @media screen , (max-width:1680px) { div#zarada p {width:50% } } @media screen , (max-width:1920px) { div#zarada p {width:56% } } but if display 1024x600px or any, read width:56% (last style line) what missed? essentially code saying "if it's...

Android NDK - Android studio gradle undefined reference to __android_log_write -

Android NDK - Android studio gradle undefined reference to __android_log_write - i trying debug jni c function inserting log messages, can't work. start trying modify hello-jni illustration comes android studio. modified code: #include <string.h> #include <jni.h> #include <android/log.h> jstring java_com_example_hellojni_hellojni_stringfromjni( jnienv* env, jobject thiz ) { #if defined(__arm__) #if defined(__arm_arch_7a__) #if defined(__arm_neon__) #if defined(__arm_pcs_vfp) #define abi "armeabi-v7a/neon (hard-float)" #else #define abi "armeabi-v7a/neon" #endif #else #if defined(__arm_pcs_vfp) #define abi "armeabi-v7a (hard-float)" #else #define abi "armeabi-v7a" #endif #endif #else #define abi "armeabi" #endif #elif defined(__i386__) #define abi "x86" #eli...

php - Loop through a JSON decoded array -

php - Loop through a JSON decoded array - i using randonuser api generate dummy images. api returns json have used json_decode decode , using print_r , got array below: array ( [results] => array ( [0] => array ( [user] => array ( [gender] => male [name] => array ( [title] => mr [first] => dwight [last] => evans ) [location] => array ( [street] => 6822 hunters creek dr [city] => fresno [state] => vermont [zip] => 63409 ...