Posts

Showing posts from August, 2011

openlayers 3 - geolocation.bindTo() is not defined -

i following guide. executes when visit site when try run localhost gives me geolocation.bindto() error undefined. read being geolocation object not yet created or method executes asynchronously far read here. here link: https://openlayersbook.github.io/ch10-openlayers-goes-mobile/example-02.html this tracking location of user using openlayers 3 openstreetmaps. bindto depracted ol.dom.input. use "propertychange" , other listeners.

ruby on rails - Rails4: Template is missing error with using PDFKit -

i'd generate pdf file, trying use pdfkit failing. the following error displayed when input http://localhost:3000/users/1.pdf browser. template missing missing template /users.show {:locale=>[:en], :formats=>[:pdf], :variants=>>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. searched in: * "c:/xxx/xxx/app/views" please advise me on how avoid error. \config\initializers\pdfkit.rb pdfkit.configure |config| config.wkhtmltopdf = `which wkhtmltopdf`.to_s.strip config.default_options = { encoding: "utf-8", page_size: "a4" } end \app\controllers\users_controller.rb def show @user = user.find(params[:id]) respond_to |format| format.html format.pdf html = render_to_string template: "users.show" pdf = pdfkit.new(html, encoding: "utf-8") send_data pdf.to_pdf, ...

ios - Swift: How to use static cell in dynamic UITableView -

static dynamic dynamic dynamic .. .. dynamic i've dynamic table list dynamic content. @ top of list, need static cell. and trying add label in static cell try features. my static cell's identifier is: firstcell dynamic cell's identifier is: cell override func numberofsectionsintableview(tableview: uitableview) -> int { // #warning potentially incomplete method implementation. // return number of sections. return 1 } override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { // #warning incomplete method implementation. // return number of rows in section. return 5 } override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("cell", forindexpath: indexpath) as! uitableviewcell // configure cell... cell.textlabel?.text = "test" return cell } t...

ruby - Rails not including timestamps even though I specifically ask for them -

i having problem ror. need fields created_at , updated_at in in tables further use. rails doesn't seem add them though ask rails to. these models: picture.rb class picture < activerecord::base belongs_to :category has_many :comments, dependent: :destroy mount_uploader :photo, photouploader validates_presence_of :photo end category.rb class category < activerecord::base has_many :pictures, dependent: :destroy validates :name, presence: true, uniqueness: { case_sensitive: false } end comment.rb class comment < activerecord::base belongs_to :user belongs_to :picture validates :text, presence: true end these migrations: class createcategories < activerecord::migration def change create_table :categories |t| t.string :name t.timestamps end end end class createpictures < activerecord::migration def change create_table :pictures |t| t.string :description t.references :category...

android - Disable DrawerLayout's scrim touch gesture -

Image
i need disable touch gesture on scrim (the red highlighted part). want dismiss drawer swipe. the issue when drawer layout open , need select element listview below red highlighted part, what's happend drawer closed , @ point can select element listview. i need select element listview directly, when drawer opened you have create custom drawer public class customdrawer extends drawerlayout { public customdrawer(context context) { super(context); } public customdrawer(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); } public customdrawer(context context, attributeset attrs) { super(context, attrs); } @override public boolean onintercepttouchevent(motionevent event) { if(isdraweropen(gravity.start)){ if(event.getx() > getchildat(1).getwidth()){ return false; } } return super.onintercepttouchevent(ev...

nuget - How best to support multiple versions of .net in the same library -

i creating .net library in visual studio 2015 following aims:- support .net 2, 3.5, 4 , 4.5+ pcl support (.net 4.5+) no dependencies apart json.net ideally .net 4.5+ version of library make use of async, , include methods return task etc now there seems many different ways of supporting want do, visual studio 2015/project.json release approach starting scratch today? my library relatively simple, as want re-use code don't want compromise .net 4.5 version. what sensible project structure, mean take advantage of latest .net framework, still build in support older frameworks. with beta8 of webdev tooling able target net2, net35, net40, net45, ... your library differences might use #ifdef flags in code hide methods in builds.

volt - Task not setting variables properly? -

having issues getting variable passed client. task gets run this: def getmaps $mapnames_current = [] url = 'http://s3-ap-northeast-1.amazonaws.com/splatoon-data.nintendo.net/stages_info.json' resp = net::http.get_response(uri.parse(url)) buffer = resp.body result = json.parse(buffer) result.each |gamemode| gamemode['stages'].each |stage| $mapnames_current << $mapnames.key(stage['id']) end end end and $mapnames_current gets called here: <div class="text-center"> <h2>current maps!</h2> <h3>turf war:</h3> <h2>{{ $mapnames_current[0] }}</h2> <h2>{{ $mapnames_current[1] }}</h2> <h3>ranked:</h3> <h2>{{ $mapnames_current[2] }}</h2> <h2>{{ $mapnames_current[3] }}</h2> </div> i'm not sure what's going wrong here. shouldn't $mapnames_current variable accessibl...

c# - How can I strip any and all HTML tags from a string? -

this question has answer here: how can strip html tags string in asp.net? 13 answers i have string defined so: private const string refer_to_business = "<pre> (refer business office guidance , explain below circumstances exception policy or attach copy of request)</pre>"; ...which has, can see, "pre" tag preserve space prepended verbiage. want to, though, reference string without "pre" tags. easy enough search "<pre>" , "</pre>" , remove them, become tedious every html tag type. how can i, in c#, strip tags out of string, regardless of whether "<pre>", "<h1>", "<span>", "<aside>" or else? try regex replacement. pattern matches html tags within string. here var pattern = @"</?\w+((\s+\w+(\s*=\s*(?:...

Why is Chrome still caching this request? -

i have page cache control goodies set, , yet, google chrome keeps pulling cache. emptied navigation history after 1 reload, chrome caches again : request url:http://stuf.com/path/to/foo request method:get status code:200 ok (from cache) response headers accept-ranges:bytes age:0 cache-control:no-cache, no-store, max-age=0, must-revalidate content-encoding:gzip content-language:fr content-length:7289 content-type:text/html; charset=utf-8 date:fri, 17 jul 2015 23:19:54 gmt expires:fri, 01 jan 2010 00:00:00 gmt server:nginx vary:accept-language, cookie, accept-encoding via:1.1 varnish x-varnish:1867509088 x-varnish-cache:miss request headers provisional headers shown accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 user-agent:mozilla/5.0 (macintosh; intel mac os x 10_9_5) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.134 safari/537.36 we have varnish setup, can see x-varnish-cache, it's miss. plus, status code section state chrome using ca...

asp.net - Using ViewData in Javascript code -

i'm creating viewdata in asp.net controller this: var elements = db.requests.groupby(user => user.submituser) .select(slt => new { userscount = slt.key, countreq = slt.count() }); this have example userscount count user1 3 user2 3 user3 3 then in javascript want create array userscount , count, example: var arrayusers = viewdata.userscount; var arraycounter = viewdata.countreq; i tried several solutions , can't it. what's best solution? controller: public actionresult statistics() { var elements = db.requests.groupby(user => user.submituser) .select(slt => new { userscount = slt.key, countreq = slt.count() }); viewdata["userscounter"] = elements; return view(); } javascript in view <script> var check = @viewdata["userscounter"]**;**error .... } to use viewdata...

asp.net mvc 5 - Unable to read beyond the end of the stream. Azure Deployment Issue -

i want integrate office 365 api's , i'm following sample git code enter link description here follow steps , working fine in localhost when deploy same asp application on git gives me following error **unable read beyond end of stream.**it can git line issue // place entry in memory this.deserialize((cache == null) ? null : cache.cachebits); debug app, when debug app providing localdb connectionstring works fine when change connectionstring online throws above mention exception on above mention line i have sold issue replacing local db connection string online gb connection string , run migration the problem migrated data when deploy on azure htat's why have run online migration first deploy

javascript - Angular UI navbar collapse not working -

i can't seem navbar start collapsed below code. i'm using angular-ui-bootstrap: navbar.directive.html: <button type="button" ng-click="iscollapsed = !iscollapsed"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div collapse="iscollapsed"> <ul class="nav navbar-nav"> <li>test</li> <li>testing...</li> </ul> </div> navbar.controller.js: angular.module('gameapp') .controller('navbarcontroller', navbarcontroller); navbarcontroller.$inject = ['playersservice']; function navbarcontroller(playersservice) { var vm = this; vm.iscollapsed = true; var getcurrentplayer = function() { playersservice.getcurrentplayer().$promise.then(function(data) { vm.player = data.player; }); ...

android - how to merger wizrocket events from app and web? -

i have added wizrocket sdk in applicatoin , inside application opening webapp has wizrocket integration, app sends events , webapp wizrocket identifies both event different user. how combine both events ? you can passing common identity value when events being raised. can user’s email id, phone number or other identifier using tag users.this key looked find user profile needs updated. if identity not found new user profile created.

Python - Cant make it to encode string properly -

im trying grab data , here code: import requests bs4 import beautifulsoup url = 'http://www.privredni-imenik.com/firma/68225-a_expo' r = requests.get(url) soup = beautifulsoup(r.content, "html.parser") g_data = soup.find_all("div", {"class":"podaci"}) in g_data: = i.text.encode('utf-8', 'ignore') print (some) it works, results looks this: b'a & l expo preduze\xc4\x86e za proizvodnju where \xc4\x86 should represented letter Ć . how can make work? you have string, print text: in [18]: g_data = soup.find_all("div", {"class":"podaci"}) in [19]: in g_data: ....: = i.text ....: print (some) ....: & l expo preduzeĆe za proizvodnju, trgovinu usluge doo 11070 beograd vladimira popovtelefaksmatični broj: 17461460 informacije o delatnostima koje obavlja ova firma: » organizovanje sastanaka sajmova in [20]: print(type(som...

javascript - How to dynamically change header based on AngularJS partial view? -

i using ng-view include angularjs partial views, , want update page title , h1 header tags based on included view. these out of scope of partial view controllers though, , can't figure out how bind them data set in controllers. if asp.net mvc use @viewbag this, don't know equivalent in angularjs. i've searched shared services, events etc still can't working. way modify example works appreciated. my html: <html data-ng-app="mymodule"> <head> <!-- include js files --> <title><!-- should changed when ng-view changes --></title> </head> <body> <h1><!-- should changed when ng-view changes --></h1> <div data-ng-view></div> </body> </html> my javascript: var mymodule = angular.module('mymodule', []); mymodule.config(['$routeprovider', function($routeprovider) { $routeprovider. when('/test1', {templateurl: 'test1.html', ...

ios - All cells have same text label in uitableviewconroller -

i have following function: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"statecell" forindexpath:indexpath]; nsstring *state = self.statearray[indexpath.row]; cell.textlabel.text = state; return cell; } the state strings come nsarray : self.statearray = [nsarray arraywithobjects:@"alabama", @"alaska", @"arizona", @"arkansas", @"california", @"colorado", @"connecticut", @"delaware", @"florida", @"georgia", @"hawaii", @"idaho", @"illinois", @"indiana", @"iowa", @"kansas", @"kentucky", @"louisiana", @"maine", @"maryland", @"massachusetts", @"michigan", @"minnesota", @"mississippi", @...

How to clean up this python output -

i trying use python module textract extract text images , since images contains noise output getting noise in addition actual text interested in. can suggest code best ways clean output. here code: >>> in glob.glob("*.jpg"): ... print(textract.process(i)) here output: ... -s. 4‘-0-.r-v .- 5,14,45_18685-m c. .4 "v-0-an .- 5,14,44_17793-m 5,13,66 17951-n 5,13,65_17959-n basically want lines starts number "5" , nothing else. added line code above still didn't work way expected. here revised code >>> in glob.glob("*.jpg"): ... text = textract.process(i) ... if text.startswith('5'): ... print text and output revised code 5,13,66 17951-n 5,13,65_17959-n maybe should try split extracted text lines first: >>> in glob.glob("*.jpg"): ... text = textract.process(i) ... # split text multi lines ... line in text.split(...

asp.net - IIS 10 Express performance issues -

upgraded vs2015 yesterday , noticed when running our web application locally performance awful - chrome dev tools shows requests scripts, images , fonts etc. taking upwards of 60 seconds complete makes debugging nightmare. has else had similar issues iis express 10? i've tried disabling failed request tracing suggested here (it's old thread though) made 0 difference speed. this iis express 10 issue i've uninstalled , reverted version 8 , problem has gone away. we'll keep using 8 couldn't find online issue wanted raise , see if i'm one. so worked 1 out: in our organization have home drives mapped network locations. iis express 10 default location logging set %iis_user_home% me network folder. by default, trace logging enabled results in ~500kb log file each resource on page (images, scripts, style-sheets etc.) , caused slow page loading due amount of data being saved across network. the fix straightforward: within solution directory, open ...

html5 - How to draw markers of different sizes -

the following html script draws specified map tiles , markers planned. but, size of markers same. how can draw markers size specified in items 3 , 4 in list 'planes'? way can differentiate different markers per properties. <!doctype html> <html> <head> <title>simple leaflet map</title> <meta charset="utf-8" /> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" /> </head> <body> <div id="map" style="width: 600px; height: 400px"></div> <script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"> </script> <script> var planes = [ ["7c6b07",-40.99497,174.50808, 5, 5], ["7c6b38",-41.30269,173.63696, 10, 10], ["7c6ca1",-41.49413,173.5421, 15, 5], ["7c6ca2",-40.98585,174.50659, 15, 15], ["c81d9d",-40.93163,173.81726, 20, ...

c# - How to make a image clickable in unity 2d 4.3 -

i developing 2d game in unity 4.3 want know how can make image clickable using c#.for example don't want use button on game want different images when user click 1 of them happens.like 'setting' image setting option appears.please tell me how this. thank you there 1 or more way take sprite gameobject , click through script on it,or can through gui means ongui() method,make texture variable public , pass desried image through inspector panel , draw image in ongui(),like public class exampleclass : monobehaviour { public texture btntexture; void ongui() { if (!btntexture) { debug.logerror("please assign texture on inspector"); return; } if (gui.button(new rect(10, 10, 50, 50), btntexture),guistyle.none) debug.log("clicked button image"); //pass guistyle none behaves image not button. } }

php ini vs json and halt compiler hack -

i debating on using either configuration.ini or config.json administration dashboard designing. ini more configuration purposes todays interest in json seems more logical configurations designed json in mind. question here should use json sure? , secondly have hack on configuration.ini file prevents file being seen publicly. ;<?php exit(); __halt_compiler(); ; //to stop script execution if not used in our best interest! ; //remember format //ini stuff ;?> i wondering if use json file well? haven't tested because didn't want nothing strange screwing up.as description why works, know won't work json since ; ini based commenting transformed // or /**/ json? for interest purposes admin__autoload.php page set_include_path(dirname($_server["document_root"])); $ini = parse_ini_file("configurations.ini",true); foreach($ini $section=>$values) { foreach($values $key=>$value ) { define("__".strtouppe...

css - Table cell content: align text top-left and image in the middle in HTML -

i have table in html. content of table text , image. align text in top-left corner , image in middle (vertical-align). tried in way: css: table td {border-collapse: collapse;} #tabella {border: 1px solid black; text-align: left; vertical-align: top;} #variante {vertical-align: middle;} html: <td id="tabella" style="padding:6px 8px; border-left: 1px solid #eeeeee;">text <br> <img id="variante" width="75" border="0" src="www.favetta.com/image.png"> </td> but in way obtain (text , image) aligned in top-left corner of cell. suggestion? are doing email? if inline styling fine (although won't work in email clients have default. if email like... <table> <tr> <td align="center"> <table width="100%"> <tr> <td align="left">this text</td> ...

How to use PHP strpos not case sensitive? -

i have made php script searches whole directory text files in it, works fine, except case sensitive. how search without being case sensitive? here's code have far: <?php $query = $_post['search']; if ($handle = opendir('posts')) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { echo "<p>$entry "; $file = file_get_contents('posts/'.$entry, file_use_include_path); $check_str = strpos($file,$query); if ($check_str == 0) { print "not found</p>"; } else { print "found</p>"; } } } closedir($handle); } ?> yeah, stripos() you're looking for. here's the manual page .

sql - Select records from single column based on two conditions -

i might simple need solution. i have column id (1 10) in table , want rows having id between 2 4 , 6 10, how retrieve rows? helpful. select * mytable id between 2 , 4 or id between 6 , 10 sql fiddle

javascript - MustacheJS partials not rendering -

i trying use partial simple object enumerable property, partials won't render. here link sample . the object obj6 = { people : [ { firstname : 'jayson', lastname : 'buquia', ismale : true }, { firstname : 'jane', lastname : 'doe', ismale : false }, { firstname : 'john', lastname : 'smith', ismale : true } ] }; the partials partials = { person : '<li>{{ firstname }} {{ lastname }}{{^ismale}}, female {{/ismale}}.</li>' } the template <ul> {{ #people }} {{>person}} {{ /people }} </ul> try change tpl = $('.template .main').html() tpl = $('.template .main').text() html() wll return <h3>names:</h3><ul>{{ #people }} {{&gt;person}}{{ /people }}</ul> not valid template. var $p = $('#container'), tpl = $('.template .main'...

Which instance in Spring MVC framework is created first? -

i new spring mvc . can please tell me instance created first in spring mvc framework ? question asked in interview. i answered dispatcher servlet not correct answer per interviewer. can please explain instance creation sequences in spring mvc framework ? i call spring-context not "instance". anyway: in typical spring web application have 2 spring-contexts: the 1 created contextloaderlistener , and the 1 created dispatcherservlet the 1 created contextloaderlistener created first , become parent context of 1 create dispatcherservlet . @see: contextloaderlistener or not? more insights.

javascript - How to build this page use HTML? Thanks -

i have question don't know how solve. tried use fullcalendar plugin, failed. bad, picture not uploaded! here i've used in past when utilizing jquery full calendar plugin: you need include both css , js files it: <script type="text/javascript" src="js/jquery-2.1.3.min.js"></script> <link rel="stylesheet" href="css/fullcalendar-2.2.6.min.css" media="all"> <script type="text/javascript" src="js/moment.min.js"></script> <script type="text/javascript" src="js/fullcalendar-2.2.6.min.js"></script> then jquery: $(function() { $("#calendar").fullcalendar({ defaultdate: '', // can dynamically set highlight current day eventlimit: true, // allows "more" link when many events in day events: [ { title: 'all day event', start: ...

Plesk migration -

is possible migrate plesk 32bit server 64bit server? i getting error while migrating warning: uploaded backup file (cus11_cust11.com_info_1507301442.xml.tar) modified, corrupted, created on server or in older plesk version not support signing of backups. before restoring data backup file, make sure can trust source of file yes, possible. regarding mentioned warning can read kb article - http://kb.odin.com/en/125354 hope help.

ruby on rails - Stuck on how to use .first and .last in a Array -

i need create method named first_and_last. take 1 argument - array - , return new array first , last objects. my attempt: def first_and_last(a) first_and_last = [1,2,3] first_and_last.last.first end here's confused, says need strings "a" , "d" along numbers. however, there 3 numbers , 4 strings. figured 0 .first of numbers. describe "first_and_last" "creates new array numbers" expect( first_and_last([1,2,3]) ).to eq([1,3]) end "creates new array strings" expect( first_and_last(["a", "b", "c", "d"]) ).to eq(["a", "d"]) end end i'm not getting how include both 1,2,3 , strings "a", "b", "c", "d" array while using .first , .last thanks ahead of time help! def first_and_last(array) [array.first, array.last] end

javascript - Add, subtract and compare date and time on Meteor Mongo -

i running collection on meteor mongo has field called last_activity , 1 called expire_date . in particular case need items collection last_activity n hours ago. in second case have save expire_date n months creation time (right now). how can add or subtract date or time on mongo/meteor (if use different methods glad if explained both briefly) , make comparisons them? plus, 1 best idea choose when getting database? save processing time if directly on mongo? it depends on how store date. have @ least 2 options. date.now() 1437215759517 or new date() date 2015-07-18t10:36:04.981z in first case amount of ms special point of time in linux(unix) world :d , can add time existing one. example: 1 week 7 * 1 days 7 * 24 hours 7 * 24 * 60 minutes 7 * 24 * 60 * 60 seconds 7 * 24 * 60 * 60 * 1000 ms so in code have (1 week now): expire_date = date.now() + 7 * (24 * 60 * 60 * 1000) and yes. display date in eye-pleasing format suggest moment.js date.now() 143...

cordova - ionic setting up push - Cannot read property of undefined -

Image
i'm working on push app via ionic. followed tutorial ionic itself: http://docs.ionic.io/docs/push-from-scratch registering users - works perfect! setting push notifications don't it worked 2 weeks ago, able wanted. expect breaking change in ngcordova/ionic can't find it. the error cannot read property 'pushnotification' of undefined @ line: $ionicpush.register({ the trace typeerror: cannot read property 'pushnotification' of undefined @ object.register (ng-cordova.js:6362) @ init (ionic-push.js:146) @ ionic-push.js:309 @ new q (ionic.bundle.js:22259) @ q (ionic.bundle.js:22246) @ object.register (ionic-push.js:270) @ scope.$scope.pushregister (controllers.js:60) @ $parsefunctioncall (ionic.bundle.js:21172) @ ionic.bundle.js:53674 @ scope.$get.scope.$eval (ionic.bundle.js:23228) and code (controllers.js) angular.module('starter.controllers', []) .controller('dashctrl', fun...

Codeigniter/PHP Send SES Email Via API -

i ask if of tried using ses send email using php? if know needed requirements accomplish this? because tried research on sending email via ses encountered solution using smtp. problem need have smtp username , password. given task send ses via api call. tried looking under amazon documentation can't find clear answer. anyways i'm doing task without given credential aws username password or aws access key. hard part since have limited resources on me why don't know start. of example requires access key or secret key of sort. don't have of this. don't have iam role credential. superior said access granted on iam role can use ses on server , need use api call this. anyone has idea on how achieve on php? need guys. thanks your superior needs create iam user specific permisions particular user able use ses account. iam user has api key , secret. credentials can use library plays hard ses api. say, seems suoerior has created iam user need keys , you'll ...

ios - UISegmentedController not changing UIImageView -

Image
i new , use help. have 5 segment controller first button acknowledged. other buttons not seem work. have tried code both under -(ibaction)segmentbutton:(id)sender and -(void)viewdidload also can tell last segment different code tried no luck. if there better way format know of, feel free share! if (selector.selectedsegmentindex == 0) { ball.image = [uiimage imagenamed:@"ball2fire.png"]; } if (selector.selectedsegmentindex == 1) { ball.image = [uiimage imagenamed:@"ball2"]; } if (selector.selectedsegmentindex == 2) { ball.image = [uiimage imagenamed:@"ball70color"]; } if (selector.selectedsegmentindex == 3) { ball.image = [uiimage imagenamed:@"ball2b.png"]; } if (selector.selectedsegmentindex == 4) { [ball setimage:[uiimage imagenamed: @"ball2r.png"]]; } from question, looks you've put code change picture within viewdidload method? wrong. viewdidload called once, when view loaded. code need...

sharepoint 2010 - How can I sort my Jquery dropdownlist by date created? -

i have sharepoint dropdown need ordered date created. code have far tried simple jquery: function dashboardreport(a, b) { return new date(a.created).gettime() - new date(b.created).gettime(); } this html sharepoint dropdown want re-order: <sharepoint:formfield runat="server" id="ff1753" controlmode="new" fieldname="dashboardreport" __designer:bind="{ddwrt:databind('i','ff1753','value','valuechanged','id',ddwrt:escapedelims(string(@id)),'@dashboardreport')}" />

android - Can't Open File download from browser -

Image
i have download application ftp server. after downloaded apk server, when clicked on gives me error "can't open file". can see in screen shot. when open downloads application , try install application there gives same error. but when try file manager , try install getting installed. have idea cause this? can please suggest why can't install application notification section after download completed or inbuilt downloads application? i had problem. couldn't install apk via downloads app. opening apk in file manager app allowed me install fine. using oi file manager on stock nexus 7 4.2.1. or it shouldn't http headers if file has been downloaded , it's same file can open oi. a shot in dark, not allowing installation unknown sources, , oi somehow bypassing that? settings > applications > unknown sources...

android - ParseQuery to return file -

Image
i trying imagefile, user's profile image. have store image users table app @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mtoolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(mtoolbar); navigationitemslist = new arraylist<draweritem>(); additemstonavigationlist(); mrecyclerview = (recyclerview) findviewbyid(r.id.recyclerview); mrecyclerview.sethasfixedsize(true); parseuser username = parseuser.getcurrentuser(); header_name = username.getusername(); header_email = username.getemail(); madapter = new com.charity.dogood.dogood.adapters.navdraweradapter(navigationitemslist, this, header_name, header_email, header_image); mrecyclerview.setadapter(madapter); //parse image , details of logged in user // locate class table named "imageupload" in parse.com parsequery<parseobject> quer...

c# - Easy way to get and set pixels on writeablebitmap -

i need , set pixel in universal app (windows phone rt, windows 8.1). , cannot find way. when in wpf first calculate stride like: int stride = wb.pixelwidth * (wb.format.bitsperpixel / 8); after converting byte array byte[] data = new byte[stride * wb.pixelheight]; wb.copypixels(data, stride, 0); and after easy: for (int y = 0; y < wb.pixelheight; ++y) { (int x = 0; x < wb.pixelwidth; ++x) { var index = (y * stride) + (x * 4); data[index + 3]=255; data[index + 2]=255 data[index + 1]=255 data[index]=255 } } but when use universal app cannot find way similar. cannot use savejpeg because work in silverlight, dont have writeablebitmap.format etc. please help, suggestion welcome. thanx

How to get Country Area Code like India(+91) in php by API -

how country area code india(+91) in php api could not find $detailsid=json_decode(file_get_contents('http://ipinfo.io/'.$_server['remote_addr'])); i got fron this. $idd=json_decode(file_get_contents('https://restcountries.eu/rest/v1/alpha?codes=in')); you can try $detailsid=json_decode(file_get_contents('http://ipinfo.io/'.$_server['remote_addr'])); to data of country, , can call https://restcountries.eu/rest/v1/name/india you can currency , data needed.

javascript - Getting error [object HTMLCollection] -

i having problem in making simple test in javascript. quick example. each question's div id incremented in html code. html <form action="#"> <div id="q1"> <label>q. abcd</label> <label><input type="radio" name="radio1" value="1">a</label> <label><input type="radio" name="radio1" value="2">b</label> <label><input type="radio" name="radio1" value="3">c</label> <label><input type="radio" name="radio1" value="4">d</label> </div> .... .... <input type="button" value="click submit" onclick="result();"> </form> js (say 10 questions) function result() { var answer = new array(); for(var i=1; i<11 ; i++) { if(document.gete...

mysql - Query to fetch more than 6500 records in HQL -

i have requirement in project select more 6500 records table. have used select * tablename id in (:list) . getting stack overflow error. however if id list less 6500 records query formed without errors. also hibernate version 3.3.ga , requirement should not upgrade hibernate version. using current version should write query. can please me out in this. thanks in advance you can use setmaxresult() sinice limit not supported hql string hql = "select * tablename id in (:list)"; query query = session.createquery(hql); query.setmaxresults(6500); list results = query.list();

mysql - Joining tables but needs 0 for empty rows -

i don't know how explain scenario using words. writing examples: i have table named tbltype : type_id | type_name --------------------- 1 | abb 2 | cda 3 | edg 4 | hij 5 | klm and have table named tblrequest : req_id | type_id | user_id | duration ------------------------------------------- 1 | 4 | 1002 | 20 2 | 1 | 1002 | 60 3 | 5 | 1008 | 60 .... so trying is, fetch sum() of duration each type , particular user. this tried: select sum(r.`duration`) `duration`, t.`type_id`, t.`type_name` `tblrequest` r left join `tbltype` t on r.`type_id` = t.`type_id` r.`user_id` = '1002' group r.`type_id` it might return this: type_id | type_name | duration ------------------------------- 1 | abb | 60 4 | hij | 20 it works. issue is, want 0 value other types doesn't have row ...

javascript - using shadow dom in Internet Explorer -

the below code works in chrome not in internet explorer. there way use in internet explorer? <html> <head></head> <body> <div> <h4>my content heading</h4> <p>my content text</p> </div> <script> var mycontent = document.queryselector('div'); var shadowroot = mycontent.createshadowroot(); shadowroot.innerhtml = '<h2>inserted heading</h2> <content select="p"></content>'; </script> </body> </html> internet explorer (and new edge browser) doesn't support shadow dom natively. can use polyfill achieve desired behaviour.

http - send form and receive response android -

Image
the idea duplicate on android web http://www.telekino.com.ar/ in site there form check if lottery ticket won i confused on how it. tried @ way my layout has 3 edittext each 1 of form data sent (emision,cupon,algoritmo), similar web, , button send values. class public class control extends activity { private edittext numerocarton; private edittext algoritmo; private edittext emision; public static string emision, cupon, algo; public textview resultadocarton; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.control); emision = (edittext)findviewbyid(r.id.emsion); numerocarton = (edittext)findviewbyid(r.id.numerocarton); algoritmo = (edittext)findviewbyid(r.id.algoritmo); emision= emision.gettext().tostring(); cupon= numerocarton.gettext().tostring(); algo= algoritmo.gettext().tostring(); button resultados= (button) findviewbyid(r.id.controlcartonbut); re...

node.js - Communication between Meteor and nodejs apps -

i have meteor platform 4 node apps/servers inside. i'm using seamless iframes make whole package while stay in control, if 1 app goes wrong won't affect other 3 nor platform. now, question is: how share same userid between apps? can query mongodb node asking userid, how can query asking same userid online user has in meteor? 1 login everything, that's need. edit: faye or simplebus?

MongoDB Query Timing difference from shell and Android mobile -

i'm using mongodb mobile application store data's. when connect mongo server thro robomongo , query explain("executionstats") says { "cursor" : "idcursor", "n" : 1, "nscannedobjects" : 1, "nscanned" : 1, "indexonly" : false, "millis" : 0, "indexbounds" : { "_id" : [ [ objectid("5592a10d634a61834f354f3b"), objectid("5592a10d634a61834f354f3b") ] ] }, "server" : "h003744.mongolab.com:55690" } and millis 0. when put same query in android application without explain command takes 4 5 sec result though i'm using index in query. what mistake i'm doing here. edit : java code basicdbobject user = new basicdbobject(tripsconstants._id, new objectid(id)); basicdbobject show = new basicdbobject(tripsconstants._id, 0).ap...

c# - Cross-domain authentication ASP.net MVC -

i have 2 different web application built asp.net mvc. 2 application may not running in same server nor in same domain. i if user login in 1 of them, automatically should login in other. same should work logout. which think best solution? know example code? thanks! --- edited more info --- use case scenario: the user has web application a opened on tab, , @ point of app there link redirects user web application b . if logged in on a , show him full page, , if not, redirect him login form. why need it: applications a , b built. apparently, way of accessing b clicking on link located in a , shown if have logged. problem if know url of page of b (are long , complex, still) can write on browser , access b , means security problem. i assume cannot communicate between applications , b using shared store. (this allow shared session implementation). the more industry standard way (openid connect) of doing of other answers have hinted at. try , give more detai...

Android: how do i prevent canvas to draw the whole view when animation -

i hava customized view , draw ui on ondraw(canvas canvas) method. case need animation (anim true) public class gameview extends view { //more code @override protected void ondraw(canvas canvas) { canvas.drawbitmap(item.getbitmap(), item.getxy().getx(), item.getxy().gety(), null); canvas.drawbitmap(resizedbitmapmapping.gethouse(), 0f, 0f, null); if(amin){ canvas.save(); canvas.rotate(currentvalue); drawball(canvas); canvas.restore(); } } but ball small, small part of view needs re-drawn. should performance issue draw whole view. right draw such animation? what looking canvas.cliprect() . here short video google explains how works , how use it. alternatively, can invalidate region of view view.invalidate(int,int,int,int) .

objective c - Getting NSGeneric Exception while updating constraints programmatically? -

here code: int x= 17; int y = 27; int width = 287; int height = 181; int mainview_height = 568; int x_spacer = 0; int y_spacer = 0; int width_spacer = 320; int height_spacer = 27; uiview *view_spacer = [[uiview alloc]initwithframe:cgrectmake(x_spacer, y_spacer, width_spacer, height_spacer)]; [view_spacer setbackgroundcolor:[uicolor clearcolor]]; [view_spacer settranslatesautoresizingmaskintoconstraints:no]; [self.mainview addsubview:view_spacer]; uiview *view1 = [[uiview alloc]initwithframe:cgrectmake(x, y, width, height)]; [view1 setbackgroundcolor:[uicolor whitecolor]]; [view1 settranslatesautoresizingmaskintoconstraints:no]; [self.mainview addsubview:view1]; [view_spacer addconstraint:[nslayoutconstraint constraintwithitem:view_spacer attribute:nslayoutattributewidth relatedby:nslayoutrelationequal toitem:view_spacer attribute:nslayoutattributeheight multiplier:width_spacer/height_spacer constant:0.0f]]; [self.mainview addconstrain...

java - LinkedList to store LinkedList of Nodes -

i have written linkedlist class accepts nodes stores integers . i have created linkedlist stack = new linkedlist() , , have added node s if data of node s less data of node s exist in stack . if not, want put old stack new linkedlist called linkedlist pilesofstacks , , create newstack called linkedlist newstack = new linkedlist() , , add larger node newstack go linkedlist pilesofstacks . my question is; since created linkedlist class accept node s, how make new linkedlist accept linkedlist s of these nodes , creating different piles of linkedlist s in linkedlist ? this have far: public void sort(linkedlist listofints) { linkedlist<linkedlist> piles = new linkedlist<linkedlist>(); linkedlist stack = new linkedlist(); for(int = 0; < listofints.getsize(); i++) { node x = listofints.pop(); for(int j = 0; j < piles.getsize(); j++) { node y = piles.peek(); //check first element of each pile if( ( ((comparable)y.ge...

authentication - can we make enterprise AD transparent to the existence of local kerberos mechanism? -

we have users in enterprise ad , want kerberos ticket generated these users local kerberos server instead of kerberos service in ad itself. the intent of want make enterprise ad transparent exixtence of kerberos mechanism the approach thinking is-- say have 3 boxes: enterprise ad local ad embedded kerberos role based access control box flow thinking-- rbac box receive user request authentication , authorization in place of forwarding request enterprise ad , rbac box forwards request our local ad embedded kerberos. now, local ad embedded kerberos queries enterprise ad user authentication. on success of authentication, local ad kerberos generates ticket , sends response rbac box either allows/denies services user. we don't know if done, if possible please guide or suggest approach achieving same. thanks if enterprise ad , local ads organized forrest, might possible realize scenario using "cross-realm authentication": https://technet.mi...

powershell - How to update variables in script? -

script should restart service , save current data , time in file after memory usage reach limit. doesn't save current time , in second if when service stopped doesn't else . show same values in $data , $stat . not sure made mistake. $proc = 'process name' $serv = 'service name*' $ram = 10mb $inter = 1 $data = get-date -format "yyyy/mm/dd hh:mm:ss" $log = "c:\log.txt" $stat = get-process $proc -ea silentlycontinue while ($true) { if ((get-process $proc -ea silentlycontinue | select-object -exp ws) -gt $ram) { restart-service $serv add-content -path $log -value ($data + "`t" + "restarting") start-sleep -m 10000 if ($stat -ne $null) { add-content -path $log -value "working" } else { start-service $serv add-content -path $log -value ($data + "`t" + "starting") } } start-sleep -s $inter } ...

encryption - C# - save data in file that can't be opened by user -

i'm trying store user data locally in encrypted file. using settings method not need want create file somewhere , write - after writing should encrypted user can't open/edit it. later application should able decrypt , read/edit file. i don't have experiences in xml , don't know if that's i'm looking for. however, if possible solve without xml. do have ideas on how program encryption thing? thanks! if have got further questions, leave comment , i'll take care of it. edit seems forgot mention want prevent average user viewing or editing file. not want create high security app. what can joey encrypt whole string , save that, keep encryption key inside code, when want edit/read written data can use same key decrypt it the service called aescryptoserviceprovider, here documentation https://msdn.microsoft.com/en-us/library/system.security.cryptography.aescryptoserviceprovider(v=vs.110).aspx also video may aswell https://www.youtube.co...

node.js - How to clean foreverjs logs for running processes? -

how clean logs foreverjs running process? can manually delete log files results in forever not logging anymore. i've seen cleanlogs removes historical logs, not affecting logs of active processes. if linux, may help: for in /var/forever/path/to/log/*; cat /dev/null > $i; done

c# - How to access children, sub-children and their children from json formatted string -

this api link. https://api.indix.com/v2/offerspremium/products?countrycode=us&q=macys&name=10168--electronics&app_id=dbffc3ab&app_key=6c1608f7ba90259040aa98132f29b433 and values of mpns,upcs,maxsaleprice api link.i getting values in format foreach (jtoken child in result.children()) { foreach (jtoken grandchild in child) { foreach (jtoken grandgrandchild in grandchild) { var upsc = system.convert.changetype(result["upcs"].tostring(), type); var mpn = system.convert.changetype(result["mpns"].tostring(), type); var maxsaleprice = system.convert.changetype(result["maxsaleprice"].tostring(), type); } } } but gives values 1 time ,i got values of these objects related api link. you need replace result["upcs"] etc. grandgrandchild["upcs"] : string url = "https://api.indix.com/v2/offerspremium/products?countrycode=us&q=macys...