Posts

Showing posts from January, 2012

ios - iBeacon send notification for multiple beacon -

scenario i have 3 merchants in same street. each merchant hold beacon. want end users notify once go near ( clproximitynear ) . source code appdelegate.m self.ibeaconmanager = [[cllocationmanager alloc] init]; self.ibeaconmanager.delegate = self; nsuuid *proximityuuid = [[nsuuid alloc] initwithuuidstring:@"b9407f30-f5f8-466e-aff9-25556b57fe6d"]; clbeaconregion *region = [[clbeaconregion alloc] initwithproximityuuid:proximityuuid identifier:@"beaconidentifier"]; region.notifyentrystateondisplay = yes; [self.ibeaconmanager startmonitoringforregion:region]; delegate - (void)locationmanager:(cllocationmanager *)manager didstartmonitoringforregion:(clregion *)region { [self.ibeaconmanager requeststateforregion:region]; } - (void)locationmanager:(cllocationmanager *)manager diddeterminestate:(clregionstate)state forregion:(clregion *)region { uilocalnotification *notification = [[uilocalnotification alloc] init]; switch (state) { c

android - camera app - list of permissions -

i want know permissions assigned stock camera app in android 4.4. tried androidmanifest file online, can't find it. can point me web-link might ? settings > apps > camera. lists permissions there. and looks uses permissions available ;)

javascript - How do I assign a value to a variable stored in an array? -

for example: var = b = c = null; var array = [a, b, c]; var value = 5; how assign value a using array , without having array[0] overwritten? how assign value variable stored in array? you can't. i think have misconception here: javascript pass-by-value , i.e. array doesn't hold reference variable , holds value variable had @ moment array created. when write [a, b, c] literally means "evaluate a , b , c , add values array" . after array created, there no knowledge anymore values came from. this makes sense, since same behavior if use literals or other expressions instead of variables: [1, 40 + 2, "foo"] . evaluates each expression , adds result array.

c++ - How add existing file to Different Visual Studio Project Programmatically -

i newbie. want create visual c++ project programmatically. have tried envdte objects working on instance of current solution want edit different project file of different solution not opened anywhere. how can instance of different project edit it? and using visual studio 2013 express. there limimation it? should use vspackage's? thanks. in general recommend considering build system cmake or scons. allows generate build scripts arbitrary platform (as such includes msvs solution files). however, might edit project file script or program. project files plain xml files , it's easy add external files. <itemgroup> <clcompile include="some_file.cpp" /> </itemgroup>

javascript - Bing Maps not working properly on BlackBerry -

Image
i creating simple web application using bing maps. when load application in blackberry z30, route drawn between start , end destination getting distorted. please find attached screenshot. works fine on samsung devices. there work around make work blackberry ? below sample code use draw line between start , end destinations. function drawrouteshape(points, color){ var cfg = { strokecolor: new microsoft.maps.color(255,100,0,100), strokethickness: 5 }; this.map.entities.push(new microsoft.maps.polyline(points, cfg)); }; points array of lat , longs. sample screenshot: attached code in index.html. whole index.html of sample app can reproduce issue in blackberry browser. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head> <title></title> <meta http-equiv="content-type&q

C++ socket programming: packing data from an array of different types -

i'm new socket programming in c++, , while have basics down, i'm having trouble tackling following situation: i have function consumes array of void pointers (i.e. void **). each pointer pointing different standard c data type (i.e. char, int, short, long, float, double). array of variable length, have access length , type of data each pointer pointing to. the goal of function send data pointed pointers. question is: there way send in 1 go? by way, know send() doesn't guarantee delivery of every byte. have helper function loops , invokes send() many times needed. question has packing , serializing data. if want send integer, invoke htons() or htonl() in order convert data network byte order. if want send variable length string, send length of string first followed actual string. easy enough. but if want send variable amount of data, in 1 go (assuming have helper guarantee delivery of every byte), data comes array of pointers different c standard data types?

mysql - Sql query for a specific time period -

i trying write mysql query below details- i have 3 tables 1) booking table column booking_id , journey_start_datetime , journey_end_datetime. 2) driver table column driver driver_id , driver_name. 3) driver_assign table column booking_id, driver_id, busy_start_datetime, busy_end_datetime. when assign booking driver new entry goes driver_assign table details of booking_id , journey_start_datetime , journey_end_datetime. i want drivers name not busy given time. ie lets 1 booking assign driver "john" journey_start_datetime->'2014-06-27 12:00:00' , journey_end_datetime->'2014-06-27 14:00:00'. now new booking (journey_start_datetime->'2014-06-27 13:00:00' , journey_end_datetime->'2014-06-27 15:00:00') driver john not come. moving op's code comment question - select u.driver_name driver u u.id not in (select driver_id driver_assign dva ('2014-06-27 13:00:00'>= dva.busy_start_datetime or

windows - Execute command prompt commands in java -

i want write java program , in need execute batch file convert mp3 wav file,am having command , working fine in command prompt,so convert file wave mp3 first step have change directory batch file presents , need execute mu-law-mp3.bat muic command in command prompt question how can achieve through java? in java program i need execute cd command location of batch file i need execute above command . here 1 way of doing it.you can specify location of file in command itself. processbuilder pb=new processbuilder(command); pb.redirecterrorstream(true); process process=pb.start(); bufferedreader instreamreader = new bufferedreader( new inputstreamreader(process.getinputstream())); while(instreamreader.readline() != null){ //do commandline output. }

javascript - Can't submit button on load event -

i created example work jquery 1.7.2 , onload event click onload event nobody needs click. here example: http://jsfiddle.net/fztd5/32/ <script> window.onload=function(){ document.getelementbyid("formbutton").submit(); } </script> <form action="page/site" method="post"> <input type="hidden" name="name" value="value" /> <input type="submit" id="formbutton" /> </form> i tried document.getelementbyid("formbutton").click(); please can me? you have 2 mistakes: 1- form's method 'postt' , submit's invocation on button instead form element. try this <script type="text/javascript"> $(document).ready(function(){ $("#form").submit() }) </script> <form action="page/site" method="post" id="form"> <input type="hidden" name="name" v

sql server 2012 - Distinct error with image field -

i have table contains image column. want select distinct value of image column, gives error. column name image. my query is: select image tbl1 error is: image data type cannot selected distinct because not comparable. so how select distinct value tb1 table image data types in select statement contains distinct clause. depending on version of sql server being used, there few ways of overcoming restriction. for sql server 2000, text column can converted varchar data type, ntext column can converted nvarchar data type while image data type can converted varbinary data type. select statements earlier contain distinct clause can rewritten follows , avoid error message: select distinct [booktitle], cast([booksummary] nvarchar(4000)) [booksummary] [dbo].[book] select distinct [booktitle], cast([bookimage] varbinary(8000)) [bookimage] [dbo].[book] sql server 2005 , sql server 2008 (and later), instead of limiting nvarchar 4000 characters or varchar or varbinary 8000 ch

atlassian - Restore Stash from backup -

we using atlassian stash manage our git repositories on version 2.6.0 . have planned upgrade 2.6.2 , have given installation , home directory in same location made encounter huge data loss. i have backup of stash 2.6.0 home , installation directories. can please guide me on how roll stash 2.6.0 existing 2.6.2 ? also, if provide 2 different directories stash home , installation , copy repository code backup existing stash data repositories, work?please let me know. you can more direct support via support.atlassian.com or answers.atlassian.com - in case i'd suggest former.

Create aggregation function to report most popular in Google DataTable -

i have google datatable looks this: var data = new google.visualization.datatable(); data.addcolumn('string', 'city'); data.addcolumn('string', 'model'); data.addcolumn('number', 'sold'); data.addrows([ ["melbourne","ford",10], ["perth","ford",2], ["melbourne","ford",7], ["melbourne","holden",25], ["perth","holden",25], ["melbourne","holden",12], ["melbourne","ford",11] ]); what group city , report model highest cumulative sold value city. the result returned : city model melbourne holden perth ford from reading of google visualisation api possible write custom aggregation function beyond limited experience. any assistance appreciated. this require double grouping: first time total sold per model per city,

node.js - Socket.io connection does not when i change my wifi network -

i using node.js + socket.io chat application. noticed when change wifi connection, socket stops working. how can work? here client side connection code var socket = io.connect("https://website.com:8080", { 'reconnection delay': 500, 'reconnection limit': infinity, 'max reconnection attempts': infinity }); you can use socket.io disconnect event make own reconnect: var socket = connecttoserver(); function connecttoserver(){ var socket = io.connect("https://website.com:8080", { 'reconnection delay': 500, 'reconnection limit': infinity, 'max reconnection attempts': infinity }); return socket; } socket.on('disconnect', function(){ socket.socket.connect(); }); : )

Not able to get Facebook Reviews through PHP SDK V4. Error: (#210) Subject must be a page -

i trying use php sdk v4 retrieve 'facebook page ratings' in website's page. created fb app, , got page access token graph api explorer. as described in this link . code working when access page details $request = new facebookrequest( $session, 'get', '/{page-id}' ); but when try retrieve ratings of facebook page described here - $request = new facebookrequest( $session, 'get', '/{page-id}/ratings' ); i following error- fatal error: uncaught exception 'facebook\facebookpermissionexception' message '(#210) subject must page.'....... why that? please help! you're getting error coz you're not using page access token api call. getting page access token– instead of using page access token graph api explorer, 1 api call. remember user must authorize app manage_pages permission. you'l l page access token in response of following call ( demo )- $request = new facebookreque

django - Sharing Sessions on Subdomains -

i'm trying set way have user jump around subdomain subdomain. let's have following subdomains: one.example.com two.example.com three.example.com if log into, say, two.example.com, user should able jump on one.example.com or three.example without having log in. i'm following following example: stackoverflow - 3742675 ... , have settings on both sites: session_cookie_domain = '.example.com' session_cookie_name = 'examplesession' however not working. changed secret key, that's not working either. any ideas? thanks

CORS in embedded javascript -

i'm intending add security our javascript code gets embedded on other sites - eg: analytics code. the user copies 4-5 lines of code , puts on site. code downloads real script next step. i have been recommended use cors instead of current jsonp calls can restrict domains. as understand, cors work if html page add scripts needs add access domains , if add access domains the js file, wouldn't work. is cors final js or html page intending use script? edit: since it's confusing users, have made more simple. html in domain adds script domain b google analytics. can add access-domains: while rendering js or should html add access-domains in response? there explanation wiki question: cors can used modern alternative jsonp pattern. while jsonp supports get request method, cors supports other types of http requests. using cors enables web programmer use regular xmlhttprequest , supports better error handling jsonp . on other hand, jsonp works on

How to start Jetty as a OSGI bundle with JSP support? -

Image
i'm running jetty 9.2 osgi bundle using felix framework.in command prompt,apache felix started like java -djetty.home=c:/osgijars/jetty-osgi-boot-9.2.0.m0/jettyhome -jar bin/felix.jar my jetty home following once felix framework started, in command prompt can see list of bundles loaded in active state. now, i'm trying load sample web app(jsp + servlets) osgi bundle.i'm getting error (in cmd prompt) g! 2014-06-27 11:56:03.129:info:/webapp:qtp31392457-30: no jsp support. check jsp jars in lib/jsp , jsp option has been specified start.jar i know jsp support configured, need set options while starting jetty server jetty.options= server,jsp . so,i've tried while setting jetty home like java -djetty.home=c:/osgijars/jetty-osgi-boot-9.2.0.m0/jettyhome -djetty.options=server,jsp -jar bin/felix.jar but still getting same error. kindly suggest me how configure jsp in case..? never tried run jetty standalone this, though there 2 frameworks osgi

xml - Generate Timestamp in Ruby -

i getting timestamp value in xml request following format. 2014-06-27t12:41:13.0000617z i need form xml response kind of time format in ruby. how format corresponding time? i wanted know name of format. try this: t = time.utc(2010,3,30, 5,43,"25.123456789".to_r) t.iso8601(10) this produces: "2010-03-30t05:43:25.1234567890z"

sprite kit - SKAction go to and stop at a specific frame -

flash has gotoandplay() , gotoandstop() methods movie clips skip frame. don't see methods in skaction class there way or workaround simulate skaction instances? edit: additional info on gotoandplay , gotoandstop: gotoandplay(n) brings playhead nth frame. if clip 30 frames long , call gotoandplay(15) start playing 15th frame , stop @ 30. gotoandstop(n) takes animation nth frame , stops there without playing. there no action play frame x y. it's easy replicate because animate actions.. + (skaction *)animatewithtextures:(nsarray *)textures timeperframe:(nstimeinterval)sec .. take array of textures input. either create array specific frame textures want play, or if have array allframes textures can new array desired frames if wanted play frame 15 end: nsrange range = nsmakerange(15, allframes.count - 15); nsarray* animframes = [allframes subarraywithrange:range]; skaction anim = [skaction animatewithtextures:animframes timeperframe:0.1];

java - Accessing inner class methods on already created outer class object -

let's have class this: class outer { public void getoutervalue() { } class inner { public void getinnervalue() { } } } i understand create object of class as: outer outer = new outer(); outer.inner inner = outer.new inner(); but let's suppose getting object other method: void somemethodsomewhere(outer o) { // how call getinnervalue() here using o? } is there way call "getinnervalue" method using "o" in scenario above? please let me know. no. need have instance of inner call methods on it. an instance of outer class not enough (it work other way around: inner class instance has reference outer class instance).

twitter bootstrap - jquery side bar menu issues onhover -

i trying create side menu bar see in android phones using bootstrap , jquery what want when hover on particular element of mine inside sub-items should displayed. this have done of now the code follows <!doctype html> <html> <head> <meta charset="utf-8"> <title>newspaper</title> <link rel="stylesheet" href="../css/bootstrap.min.css"/> <link rel="stylesheet" href="../css/font-awesome.min.css"> <script type="text/javascript" src="../js/jquery.js"></script> <!-- latest compiled , minified javascript --> <script src="../js/bootstrap.min.js"></script> <style type="text/css"> .mini-submenu{ background:#000; border: 1px solid rgba(0, 0, 0, 0.9); border-radius: 4px; padding: 9px; /*position: relative;*/ width: 42px; } .mini-submenu .icon-bar { border-radius: 1px; display: block; h

java - What is the beginning and end of a Lucene token stream when parsing a query? -

we're trying implement custom filter needs remember past tokens processed before within same query. tried overriding end() and/or reset() methods tokenfilter found out these methods called between each token. this contrary our expectation of end() and/or reset() methods being called @ beginning or end of token stream representing query. unexpected behavior can reproduced following example code below. (solr) schema snippet: <fieldtype name="text_general" class="solr.textfield"> <analyzer type="index"> ... </analyzer> <analyzer type="query"> <tokenizer class="solr.whitespacetokenizerfactory"/> <filter class="com.foobar.solr.customfilterfactory" /> </analyzer> </fieldtype> filter implementation: public class customfilter extends tokenfilter { chartermattribute termattribute = addattribute(chartermattribute.class); public customfilt

javascript - Making use of browserified NodeJS file into browser -

i have nodejs file browserfied using browserify module. used following command browserify testfile.js -o bundle.js to make use of file in browser, making use of window object. assume below code generated after browserifying file. var main = function () { this.foo = function () { }, this.temp= function () { }, this.bar= function () { } } to make use changed window.main = function () { this.foo = function () { }, this.temp= function () { }, this.bar= function () { } } and use of these functions, used following code: var obj= new main (); and can obj.foo(); or obj.bar(); all working fine wonder if right way call function browserfied file. please suggest correct way make use of browserfied file. browserify great tool when use entire project. makes no sense use single files only. whole point of avoiding globals, instead of setting window.main this: module.exports = function () {

visual studio 2013 - how to open AD FS Sign-in Pages? -

i trying customize adfs sign in page using poweshell command using article given in following link. http://technet.microsoft.com/en-us/library/dn280950.aspx but not able how open sign on page, how open ad fs sign-in pages ? thanks in advance !!! we can open adfs sign on page following way ... https://testadfs.com/adfs/ls/idpinitiatedsignon.aspx (need change "testadfs.com" server name)

c# - What would be the impact on web portal when developed using .net framework 3.5 or developed using .net framework 4.5 -

since few years using .net framework 3.5 developing web application deciding switch on .net framework 4.5.1 performance can 1 describe me real time scenario of performance impact on web application if use .net framework 4.5.1 instead of 3.5 also core features difference between 3.5 & 4.5 in term of development i curious on following if used mvc on web form if used view engine razor on asp view engine does make impact on performance..?? any appreciated.. performance of .net 3.5 vs 4.0 dotnetpearls made benchmarks on if there performance gains moving 3.5 4.0 , assessment "equivalent programs compiled , executed using .net 4.0 framework may execute >faster based on .net 3.5 sp1. software easy >performance boost if move newer framework version." - dotnetpearls what news in .net framework 4, 4.5, 4.5.1 , 4.5.2 here can find new in .net framework 4, 4.5, 4.5.1 , 4.5.2. what new in .net framework 4 what's new in .net fram

php - Typo3 6.2.3 fe_users mapping recordType issue -

i trying map fe_users table in typo3 version 6.2.3. config.tx_extbase{ persistence{ classes{ typo3\cms\extbase\domain\model\frontenduser { mapping.recordtype > } typo3\checkuserprofile\domain\model\checkuser { mapping { tablename = fe_users #recordtype = tx_checkuserprofile_checkuser -> deleted } } } } } however if user not in tx_checkuserprofile_checkuser recordtype repository won't find tried findall() , findbyproperty different properties , nothing, recortype set somewhere default required or how map recordtype won't needed? the following solution works! one hint typo3 coding guidelines: don't use typo3 namespace in extensions!!!! instead of typo3\checkuserprofile\domain\model\checkuser should use yourname\checkuserprofile\domain\model\checkuser config.tx_extbase{ persistence{

xcode - google play services ad is displaying in corner in android -

i have developed game in xcode using cocos2d-x & converted android.then added google play services ad, displaying in leftsidecorner. want display in middle. please me find solution. private point getdisplaysize(display d) { if (build.version.sdk_int >= build.version_codes.honeycomb) { return getdisplaysizege11(d); } return getdisplaysizelt11(d); } @targetapi(build.version_codes.honeycomb_mr2) private point getdisplaysizege11(display d) { point p = new point(0, 1); d.getsize(p); return p; } private point getdisplaysizelt11(display d) { try { method getwidth = display.class.getmethod("getwidth", new class[] {}); method getheight = display.class.getmethod("getheight", new class[] {}); return new point(((integer) getwidth.invoke(d,(object[]) null)).intvalue(), ((integer) getheight.invoke(d, (object[]) null)).intvalue()); } catch (nosuchmethodexception e2)

ruby on rails - When to add records to a user_posts table to track 'likes' -

i have groups model has_many topics. topics model has_many posts, users model read posts etc. have users_posts model used keep track whether user has read post , whether 'liked' post, has :group_id, :user_id , :read , :liked boolean fields. user creates group , adds posts under different topics. the groups show action is; @posts = group.topics.includes(:posts) my question when , how add records users_posts table? should when post first created? or when user views post first time? and best way add attributes user_posts each record in @posts? @ minute i'm using virtual attributes, right way? class post < activerecord::base belongs_to :topic has_many :users, through: :user_entries attr_accessor :read, :liked id firstly, won't need use :group_id in user_posts model / table rails, , relational databases, use primary keys give elements unique id's. means regardless of whether post member of group , you'll still referencing po

When will AngularJS trigger dirty-checks? -

i've read q/a databinding , $apply -> $digest in angularjs : how data binding work in angularjs? while understand principle , consequences, i'm still unsure when angulajs going call $digest dirty-checks. (and so, when should consider $watcher) every example found using 'ng-click', 'ng-show', or 'ng-class'. i'm pretty sure triggered change on variables of scope ({{mydata}}), , many others directives (all of them maybe ?). i understand in cases $digest called. can give me generic rule knwo when called, or exhaustive list of actions trigger dirty-check ? have @ this: angularjs docs , @ "integration browser event loop" section. basically way works angularjs binds event handlers element interacts angular (any element has directive attached it) , every time event fires, $apply called internally calls $digest trigger reevaluation of $watches check values changed, etc...

c# - Check in a website if an App is installed on tablet -

is possible check existence of app on mobile device website? currently developing website in c# has have ability choose whether open concerned app or install it. (i assuming asp.net here didn't specify.) yes can if tablet sends correct user agent string. i have attached current platform.browser file may have inaccuracies. content placed in app_browsers asp.net folder. reason patch file microsoft's isn't up-to date , have missing information. android problem v3 tablet 4 may not , haven't had time correct further. to access information use request.browser.platform , request.browser.version <browsers> <gateway id="platformwindowsphone" parentid="platform"> <identification> <useragent match="windows phone" /> </identification> <capabilities> <capability name="platform" value="windows phone" /> &

azure - Custom provider in the url rewite module -

i developing on website hosted in azure on vm. changing website able run azure website. now problem: using url rewrite module iis database provider, works in vm. database provider users of website can create own simple rewrite rules. but when upload website azure website , access url that's specified in database error: "the page cannot displayed because internal server error has occurred.". this logging configuration use: <rewrite> <rules configsource="rewriteinbound_live.config" /> <outboundrules configsource="rewriteoutbound_live.config" /> <providers> <provider name="db" type="dbprovider, microsoft.web.iis.rewrite.providers, version=7.1.761.0, culture=neutral, publickeytoken=0545b0627da60a5f"> <settings> <add key="connectionstring" value="*****" /> <add key="storedprocedure" value="sp_getrewrittenurl&q

javascript - BackboneJS Iterate complex model -

i have backbonejs composite model has 2 attributes; "myattr1": new myobj1(model.myattr1), "mycollectionattr": new myobj2(model.mycollectionattr) myobj2 looks like "attr1" : new base1( ), "attr2" : new base2( ) now want set inner level attribute (i.e. attribute of base1)...so iterate , say; self.model.get("mycollectionattr").each(function(model) { model.get("attr1").set('basemodel1attr','y'); }); so base1 , base2 model has attributes basemodel1attr , basemodel2attr while model.get("attr1") returns me list of attributes. cannot use .set() on it. what correct way of doing set on inner attribute ? if understand correctly want iterate through models of collection , set 1 specific attribute of model this $.each(collection.models, function(i, model){ model.set('item','new value'); }

php - Final element in foreach() not be compared -

i have given array such: array ( [0] => array ( [product_colour_sizes_id] => 31822 [product_colour_sizes_product_id] => 1495 [product_colour_sizes_option_value_colour_id] => 377 [product_colour_sizes_option_value_size_id] => 297 [quantity] => 999 [product_colour_sizes_name_sizes] => 6 [product_colour_sizes_name_colours] => grey ) [1] => array ( [product_colour_sizes_id] => 31823 [product_colour_sizes_product_id] => 1495 [product_colour_sizes_option_value_colour_id] => 377 [product_colour_sizes_option_value_size_id] => 295 [quantity] => 999 [product_colour_sizes_name_sizes] => 7 [product_colour_sizes_name_colours] => grey ) [2] => array ( [product_colour_sizes_id] => 31824 [product_colour_sizes_product_id] => 1495 [product_colour_sizes_option_value_colour_id]

javascript - Angular asynchronous assinging href to a link -

i need update href of link asynchronously. let's i've got html: <a ng-href="{{url}}" ng-click="resolveurl()" target="_blank">click me</a> and angular controller: app.controller('mainctrl', function($scope, $q) { $scope.url = '#'; $scope.resolveurl = function() { async().then(function(resolvedurl){ $scope.url = resolvedurl; }); } function async() { var deffered = $q.defer(); settimeout(function() { deffered.resolve('http://www.google.com'); }, 1000) return deffered.promise; } }); and need link go google.com first time. how synchronize async call or how assign url async function resolves? code in plunker edited: as @konstantin krass pointed out use window.open(). cannot use asynchronously because browsers popup block new window. i've tried open window on-click (which not blocked) , after promise resolved update url of opened window google.com.

c# - Can I bind two list of different type together? -

i have question binding in mvvm pattern. let's have 3 classes myview, myviewmodel , mymodel. each 1 containing static list: static public list<line> myviewlist; (for myview) static public list<myviewmodel> myviewmodellist; (for myviewmodel) static public list<mymodel> mymodellist; (for mymodel) is possible bind myviewlist myviewmodellist , myviewmodellist mymodellist ? are asking if can bind 3 collections itemscontrols? if so, yes - using compositecollection <listbox name="mylistbox" height="300" width="200" background="white"> <listbox.itemssource> <compositecollection> <collectioncontainer collection="{binding source={staticresource greekgodsdata}}" /> <collectioncontainer collection="{binding source={staticresource greekheroesdata}}" /> <listboxitem foreground="red">other lis

html - CSS with divs and divs on a box? -

Image
i can't find mistake in css. 2 buttons want create, should have 5px margin. button far away. mistake? .box{ background-color: #dcdcdc; border:; border-radius: 15px; padding: 5px; margin-right:5%; margin-left:auto; margin-top: 10%; min-width: 50%; max-height: 60%; overflow:auto; display: inline-block; } .buttons{ border-width: 2px; border-color: black; border-style: solid; border-radius: 10px 0px 0px 10px; padding:5px; border-right-color: #dcdcdc; background-color: #dcdcdc; margin-top: 11%; margin-left: 30%; max-width: 8%; min-width: 5%; float:left; min-height: 3%; display: inline-block; } .buttons2{ border-width: 2px; border-color: black; border-style: solid; border-radius: 10px 0px 0px 10px; padding:5px; border-right-color: #dcdcdc; background-color: #dcdcdc; margin-top: 5px; margin-left: 30%; max-width: 8%; min-width: 5%; m

c# - NotifyIcon (aka TrayIcon) in .NET Compact Framework 3.5 -

Image
i developing simple tray icon application required run in .net compact framework 3.5 (will deploy in windows ce 6). unfortunately "notifyicon" component not supported in compact version. does have solutions or code samples can refer to? what need run application in tray icon mode , popup menustrip when detected mouse right-click on icon

How to edit last sent message in skype using ubuntu -

i want know there keyboard short cut in ubuntu edit last sent message on skype. preas arrow key, last message start appearing in input area, can edit , press enter again. hope help.

bash - Is it possible to find which network interface client is connected to with PHP? -

i want find network interface client connected on. possible? if possible bash or scripting language. acceptable me. i working on freebsd. here how code should like. function get_connected_interface(){ //... } echo get_connected_interface(); //should print network interface. example em0 if using apache, php setting $_server["server_addr"] destination ip address client connected te server. if using nginx, lighttpd or other webserver, @ result of page <?php phpinfo(); ?> know how ip address of destination (one of ip addresses of server) in case, use php script launch ifconfig , search interface having ip address. i'd : function get_connected_interface() { static $interfaces=array(); if (!count($interfaces)) { $curif=""; // launch ifconfig , parse result (inet/inet6) // @ first function call exec("ifconfig",$out); foreach($out $line) { if (preg_match("#^([a-z0-9\.]*): #",$line,

c# 4.0 - How to send/receive messages through a web socket on windows phone 8 using the class ClientWebSocket? -

the web socket written in javascript colleague. managed connect. first of have log in on application using test account. have send email , password through json. have installed json.net packet using nuget. some code found on reaserch this, not understand how send data using segment. var buffer = new byte[1024]; var segment = new arraysegment<byte>(buffer); websocket.sendasync(segment, websocketmessagetype.text, true, cancellationtoken.none); of course, can use object user user=new user(); user.email="bla@bla.com"; user.password="pass"; string json = jsonconvert.serializeobject(user); but not of use because method sendasync accepts byte type on segment. all want send data, , if log in succeeds, should receive other data (in json format) user. as side note, quite new web sockets, used http protocols asp.net web api 2. i have no idea windows phone 8, code pasted seems similar regular .net clientwebsocket , here have examples: public s

android - Battery Power Consumption between C/Renderscript/Neon Intrinsics -- Video filter (Edgedetection) APK -

i have developed 3 c/rs/neon-intrinsics versions of video processing algorithm using android ndk (using c++ apis renderscript). calls c/rs/neon made native level on ndk side java front end. found reason neon version consumes lot of power in comparison c , rs versions. used trepn 5.0 power testing. can 1 clarify me regarding power consumption level each of these methods c , renderscript - gpu, neon intrinsics. 1 consumes ? what ideal power consumption level rs codes ?, since gpu runs less clock frequency , power consumption must less! does renderscript apis focuses on power optimization ? video - 1920x1080 (20 frames) c -- 11115.067 ms (0.80mw) rs -- 9867.170 ms (0.43mw) neon intrinsic -- 9160 ms (1.49mw) first, power consumption of render script code dependent on type of soc, frequency/voltages @ cpus, gpus operate etc. even if @ cpus same vendor, arm instance a15s , a9s, a15s cpus more power hungry compared a9. similarly, mali gpu

Regarding MS Access 2003 and VBA programming -

my requirement add blank table onto form in ms access 2003 on can paste data copied excel sheet. table need have same column structure excel sheet. but unable find ui component can task. jagu first step, need create table same columns data type in same order excel then create form table allowing datasheet view. when open in data sheet view, can past records excel. first copy excel records clipboard , right click on asterisk (*) in access form (datasheet view) , paste.

python - plotting with pcolormesh, changing axis -

supppose plotting assymetric matrix pcolormesh: import prettyplotlib ppl import matplotlib.pyplot plt import numpy np plt.figure() fig, ax = plt.subplots(1) ppl.pcolormesh(fig, ax, np.random.randn(10,80)) plt.show() now want change x-axis such extents example -500 500 without changing plot, labels of x-axis, same y-axis. how can accomplish that? after ppl.pcolormesh command can define ticklables directly using ax.set_xticks(xticks) ax.set_xticklabels(xticklabels) where xticklabels array of desired labels , xticks values @ labels should apply.

java - How to set Value in Global Variable? -

i have declared variable on top after import string sk5; putted value in sk5 sk5 = s.substring(s.lastindexof("-")+1).replace("]", ""); system.out.println("checking sk5->"+sk5); it printing value well, when using variable in other function prints null. please suggest me how solve this. i assume want define class variable, should use public static string sk5; but defining public static variable not final bad code style . if want use class variables in other classes, should implement getter-method like private static string sk5; public static string getsk5(){ return sk5; } and still static variable not best. try check singleton instead, depending on our usecase make sence from point of view best define private string sk5; public string getsk5(){ return sk5; } so can call testclass s = new testclass(); string t = s.getsk5();

give default values to optional attributes in directive in angularjs -

i trying give default values directive has optional attributes. giving default values in scope.init() method shown below. dont see default values reflected in view. if try scope.$apply(), says digesting :) doing wrong? angular.module('noi.questionoptions', ['noi.filters' //'ui.bootstrap' ]).directive('noiquestionoptions', ['$filter', '$log', function($filter, $log){ 'use strict'; var letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']; var romans = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix','x']; return { restrict: 'ea', scope: { // have .text attribute , optionall index options: "=noioptions", // default ) separator: '@?noiseparator', // 1 of alpha, numeric, roma