Posts

Showing posts from February, 2012

jQuery to check amount -

i'm trying write jquery event check if amount enter less or equal zero. if true clear entered amount. after after event completion event running element setting default amount value zero. can please tell me how stop second event after completion of event. i have tried using event.stopimmediatepropagation(); event.preventdefault(); event.stoppropagation(); but no success yet. here code: $(document).on('change', 'input[id^="amount_totalpaymentamout"]', function(event) { var paymentamount = parsefloat($(this).val().replace(/,/g, "")); if (paymentamount <= 0) { $.sticky("total payment amounts entered should greater zero.", { autoclose: 2000, position: "top-right", type: "st-error" }); $(this).val(''); $(this).focus(); return false; } }); try this:- $(document).on("blur", "#yourid&quo

Google email markup tester fails to validate JSON-LD for FlightReservation -

google email markup fails validate json-ld took schema.org flightreservation . markup tools says type of "boardingpolicy" wrong , "airline" field missing, it's easy test yourself: copy code below , paste there . does know can fix this? <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "flightreservation", "reservationid": "rxj34p", "reservationstatus": "reservationconfirmed", "passengerprioritystatus": "fast track", "passengersequencenumber": "abc123", "securityscreening": "tsa precheck", "undername": { "@type": "person", "name": "eva green" }, "reservationfor": { "@type": "flight", "flightnumber": "ua110", "provider": {

javascript - How do I modify Image Map Pro? -

i'm using plugin called image map plus. high lights hot spot on image when hover on spot. this.... i have list under image. when hover on 1 of list items corresponding hotspot on image it's hover effect. plug in provides function on click not hover... adding list item <li><a href="#" data-open-spot="poly-3692">3314    administration</a></li> it has do data-open-spot="poly-3692" the poly-3692 targets hotspot. here js in code. <script type="text/javascript"> ;(function ($, window, document, undefined) { $(document).ready(function() { $("#map").imagemappro({"id":4954,"editor":{"previewmode":1,"selected_hotspot":"poly-3692","tool":"poly"},"general":{"name":"dan","width":1143,"height":572,"responsive":1,"sticky_tooltips":0,"c

javascript - How to prevent leaflet from loading tiles outside map area? -

i have map 8576x8576, , keep getting console errors: failed load resource: net::err_file_not_found because leaflet trying load tiles doesn't exists. have bounds set , maxbounds prevent panning outside map area (to keep map on center of screen). var map = l.map('map', { maxzoom: mapmaxzoom, minzoom: mapminzoom, zoomcontrol: false, crs: l.crs.mysimple }).setview([0, 0], 3); l.tilelayer('assets/map/{z}_{x}_{y}.jpg', { minzoom: mapminzoom, maxzoom: mapmaxzoom, tilesize: 268, nowrap: true, reusetiles: true, tms: false, bounds: mybounds, errortileurl: "assets/map/404.jpg", continuousworld: true }).addto(map); new l.control.zoom({position: 'topright'}).addto(map); var sidebar = l.control.sidebar('sidebar').addto(map); var mybounds = [[-8576 / 2, -8576 / 2],[8576 / 2, 8576 / 2]]; map.setmaxbounds([[-5600, -5600], [5600, 5600]]); what doing wrong? why leaflet keeps trying load tile

PT algorithm for ML type inference -

for pt algorithm ml type inference work, input program expression has have property every bound variable distinct. can explain example? the point variables bound different binders different each other, , hence may have different types. so, practice rename them, in order avoid confusion , able talk type of "x", without having worry among binders of "x" referring to.

node.js - New line in express.js message -

is possible make new line in message notification? "\n" or "\r\n" disappear there's no new line set. tried var endofline = require('os').eol; instead of \n. doesn't work sadly. res.render('settings.ejs', { user: req.user, isauthenticated: true, message: 'changed user(s):' + changearray + '\n(notice: can\'t affect users higher settingrights.)' }); probabbly stupid/easy question don't working... in advance. you can use html tags. reason why not getting displayed because suppose must using escaped text. need use unescaped syntax if want render tags in html string: res.render('settings.ejs', { user: req.user, isauthenticated: true, message: 'changed user(s):' + changearray + '<br />(notice: can\'t affect users higher settingrights.)' }); here's how display unescaped text in view: <%

Add dependency to remote spark on intelliJ -

i running spark in intellij remotely facing difficulties while adding dependency spark conf. val conf = new sparkconf() .setmaster("spark://ip:7077") .set("packages", "com.databricks:spark-avro_2.10:2.0.1:jar") .setappname("localtrial") error: 16/02/23 12:27:10 warn tasksetmanager: lost task 0.0 in stage 0.0 (tid 0, 172.16.248.156): java.lang.classnotfoundexception: com.databricks.spark.avro.avrorelation$$anonfun$buildscan$1$$anonfun$3 @ java.net.urlclassloader.findclass(urlclassloader.java:381) ``` i have tried setjars property of conf class. appreciated. you need add dependency build.sbt file intellij can compile against it. if adding argument spark-submit can set dependency prodived else need package inside jar file using sbt-assembly, or similar, plugin. add following line build.sbt file , if auto-import enabled intellij download dependency. if auto-import isn't enabled close project ,

javascript - jQuery daterangepicker shows year as 0 or -1 -

Image
hello having strange problem daterangepicker. i load necessary javascript files before </body> tag. here js files: <script src="https://www.example.com/members/js/jquery/jquery-2.2.3.min.js"></script> <script src="https://www.example.com/members/js/bootstrap/bootstrap.min.js"></script> <script src="https://www.example.com/members/js/jquery/jquery-ui.min.js"></script> <script src="https://www.example.com/members/js/daterangepicker/moment.min.js"></script> <script src="https://www.example.com/members/js/daterangepicker/daterangepicker.js"></script> <script src="https://www.example.com/members/js/slimscroll/jquery.slimscroll.min.js"></script> <script src="https://www.example.com/members/js/icheck/icheck.min.js"></script> <script src="https://www.example.com/members/js/fastclick/fastclick.js"></script&

android - fetch and display the JSON data in Marker info window extracting the place type of current location -

i have 2 auto complete find route completed that.now have route 2 locations.i have origin , destination marker.in set info window display latitude,longitude,locality,sub locality,admin area.i have displayed lat , lan.now fetch json data , display in info window.i have parse data doesnt know how display in info window.suggest solutions.. googlemap.setinfowindowadapter(new googlemap.infowindowadapter() { // use default infowindow frame public view getinfowindow(marker arg0) { return null; } // defines contents of infowindow public view getinfocontents(marker arg0) { // getting view layout file info_window_layout view v = getlayoutinflater().inflate(r.layout.info_window, null); // getting position marker latlng latlng = arg0.getposition(); // getting reference textview set latitude textview tvlat = (textview) v.findviewbyid(r.id.tv_lat);

node.js - Google Cloud Print API - white page when printing PDF -

Image
i want send pdf file printed using google cloud print api. code bellow give me positive message telling me 1 page generate. when go , check came out, gate empty page. the same result happens if save print on google drive. the code unirest.post('https://www.google.com/cloudprint/submit') .header('authorization', 'bearer ' + token) .header("accept-charset", "utf-8") .field('xsrf', xsrf_token) .field('printerid', printerid) .field('ticket', '{"version": "1.0", "print": {}}') .field('title', 'test simpe.li') .field('contenttype', 'application/pdf') .attach('content', buffer) .end(function (res) { console.log(res); }); i know i'm sending pdf, because when change .field('contenttype', 'application/pdf') to .field('contenttype', 'text/plain') i 53 pages of text raw content of pdf file.

user interface - Java Desktop GUI: Drag/Drop, Draw, insert background image -

i have these requirements desktop gui program: import image in background user should draw on top of (lines, shapes) should able click on drawn shapes , move them (mouse move). clicking on points of drown lines, should able move them (shape of obj modified) should able drag , drop image ui (from let's right-hand side panel) i should able coordinates of drawn points user my question solution should pick. tried use japplet graphics , 2, 3 , 5. used simple graphics , looks ugly. don't here... does have suggestions how implement this. can find bits , pieces online, not example has ll together. is there better way doing? isn't using jframe better , easier this?

calling created javascript function in jquery -

i want call created javascript function in jquery. want trigger function when div 'sample' class.i tried append class in click event. my script function worked when called in javascript. need call in jquery. $(document).ready(function() { $('#digital-services').click(function() { $('#second-menu').addclass('sample'); }); }); $(window).scroll(function() { var menu = $('.sample'); console.log(menu.length); if (menu.length == 1) { var y = setinterval(counter, 10); //calling in jquery not working } }); var y = setinterval(counter, 10); //working var x = 0; function counter() { if (x < 11) { document.getelementbyid('counter1').innerhtml = x; } if (x < 601) { document.getelementbyid('counter2').innerhtml = x; } if (x < 31) { document.getelementbyid('count3').innerhtml = x; } if (x < 7) { document.getelementbyid('counter4'

html - How do I loop through a stored procedure within a sql statement -

i know sounds old question, haven't been able solve problem after reading endless answers, i'll try specific. have table column of text, includes html tags. need remove of html leave some. i've written following code that: declare @start int = 1; declare @end int = 1; declare @length int = 0; declare @keep int = 0; declare @replacechar varchar(10) = ''; declare @offset int = 0; return; while @start > 0 , @end > 0 begin set @replacechar = (select case when substring(@htmltext,@start + 1, 7) in ('/strike') ('</strike>') when substring(@htmltext,@start + 1, 6) in ('strike') ('<strike>') when substring(@htmltext,@start + 1, 4) in ('br /') ('<br />')

how to find the following node (siblings and preceding) using xpath -

<months> <month name="january"></month> <month name="february"></month> <month name="march"></month> <month name="april"></month> ...[etc] </months> how siblings here above code want xpath node after february i want xpath expression such if given programming questions site give month after february you can have xpath this: //months/month[@name='february']/following-sibling::month

javascript - why the external link dose not work on my wordpress site -

in site, when use external link it's not work until check browse in new tab; in other word it's not open in same window; like aa , bb menu in site: http://home.masostudio.com/ whats matter error?

Send Powershell results to email using SMTP -

#build base pieces emailing results $servername = gc env:computername $smtpclient = new-object system.net.mail.smtpclient $mailmessage = new-object system.net.mail.mailmessage $mailmessage.body = "" $smtpclient.host = "mail" $mailmessage.from = ($servername + "@company.com") $mailmessage.to.add("josh.o@comapany.com") $mailmessage.subject = $servername + " certificate expiration results" $threshold = 300 #number of days expiring certificates $deadline = (get-date).adddays($threshold) #set deadline date dir cert:\localmachine\trustedpeople | foreach { if ($_.notafter -le $deadline) { $_ | select issuer, subject, notafter, @{label="expires in (days)";expression={($_.notafter - (get-date)).days}} } } this script checks certificate expire within specified time frame specified, want create scheduled task , make send me emails. stuck here. have idea on how make send me emails using smtp server?

Working mechanism about angularJS -

i starting learn angular , want overall idea of how framework created. for example, in code snippet <!doctype html> <html lang="en-us"> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"> </script> <body> <div ng-app=""> <p>name : <input type="text" ng-model="name"></p> <h1>hello {{name}}</h1> </div> </body> </html> there usage of "{{name}}". clearly, plain html doesn't have functionality. so angular parse whole html file know like, oh, need substitute value "name" here. if so, won't slow down whole process (time spent on parsing , interpreting file)? so, recommendation how understand source code appreciated. thank you! yes! fact <div ng-app=""> tag wraps around bit of code means angular.js gets $a

how to check if office document excel is readonly office.js addin -

i want know if there api/function can used detect if office document read-only. creating office add-in using office.js library. document shared other user in readonly mode. if use following property, shows readwrite document in readonly mode. following property not helping var docmode = office.context.document.mode; // did not work, gives value of manifest file guess i trying following thing, worked not sure if right approach. if file in 1 drive give url http://d.doc.onedrive..something this. if (office.context.document.url.indexof("https://excel.officeapps.live.com") > -1) {// in read-only mode-this unique folder name file $("#container").show(); $("#readonlyarea").show(); } else { $("#mainarea").show();} it question. since excel has interesting scratch mode, though excel in read mode. both users , add-ins still able write workbook. therefore api returns readwrite meaning add-i

code analysis - Detect before_filter of a nonexistent action in Rails -

how can detect i've got before_filter of non-existent action in rails? class postscontroller < applicationcontroller before_action :authorize_user, only: [:kreate] def create end end this straightup hack, way think of checking before filter on initialize. following checks if controller has before/after filter uses non-existant action , raises exception message if does # config/initializers/before_filters.rb # require controllers dir['app/controllers/*'].each |path| require path.split('/').last if path.include? '.rb' end # array of controllers controllers = applicationcontroller.descendants controllers.each |controller| # filters controller filters = controller._process_action_callbacks # actions under controller actions = controller.action_methods.to_a filters.each |filter| # action_conditions filter action_conditions = filter.instance_variable_get(:@if) # raise error message if action used in filter

angular - What steps are requried to upgrade from Angular2 RC2 to RC4 -

what steps required upgrade existing angular2 rc2 app rc4? i've updated package.json file (see below) , have run npm update on root folder still references old versions of angular packages in node modules folder rc2. ive checked change logs , release notes , searched google no avail. app runs crashes when referencing new ngmodel related form functionality wasn't working in rc2. im trying update rc4 use new forms module see if resolves underlying form issue. original "dependencies": { "@angular/common": "2.0.0-rc.2", "@angular/compiler": "2.0.0-rc.2", "@angular/core": "2.0.0-rc.2", "@angular/forms": "0.1.0", "@angular/http": "2.0.0-rc.2", "@angular/platform-browser": "2.0.0-rc.2", "@angular/platform-browser-dynamic": "2.0.0-rc.2", "@angular/router": "3.0.0-alpha.7&quo

postgresql - Returning Postgres Nested JSON Array -

i have been searching around answer haven't found close enough looking for. i have 2 tables: create table skill_tree ( id serial primary key, name text not null, description text not null ); and create table skill ( id serial primary key, name text not null, description text not null, duration integer not null, cooldown integer not null, skill_tree_id serial references skill_tree(id) ); i trying return json postgres db in such way structured so: [{ "id": 1, "name": "skill tree 1", "description": "skill tree description", "skills": [{ "id": 1, "name": "skill 1", "description": "skill 1 desc", "duration": 10, "cooldown": 20 }, { "id": 2, "name": "skill 2", "description": "skill

javascript - Issue - AngularJS Uncaught Error: [$injector:modulerr] -

am new angularjs. trying flow of sample application before start development of new app in project. below have tried. index.html <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html ng-app="app"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> <script src="lib/angular.min.js"></script> <script src="lib/angular-route.js"></script> <script type="text/javascript" src = "js/app.js"></script> </head> <body> <h1>student registration!</h1> <div ng-view></div> </body> </html> registerstudent.html <table> <tr> <td><input type="button" value="save" ng-click="save()"></td> <td>{{

c# - How do I get 2 IQueryable<T> methods to implement a disjunction? -

this question has answer here: chaining / building linq query or instead of and 2 answers appologies if simple question; suppose have ef query object 2 methods: public static iqueryable<animal> fourlegged(this iqueryable<animal> query) { return query.where(r => r.numberoflegs == 4); } public static iqueryable<animal> withouttail(this iqueryable<animal> query) { return query.where(r => !r.hastail); } now, in service layer, animals four-legged , without tail, can do: _animalservice.query() .fourlegged() .withouttail(); that result in sql query so: select * animal numberoflegs = 4 , hastail = 0 how use 2 query methods or instead? want animals either 4 legged or without tail select * animal numberoflegs = 4 or hastail = 0 in nhibernate have used simple disjunction, can't find in ef. thanks solution : ended

php - array_search return wrong key -

this question has answer here: php in_array() / array_search() odd behaviour 2 answers i have array: $ar = [ 'key1'=>'john', 'key2'=>0, 'key3'=>'mary' ]; and, if write: $idx = array_search ('mary',$ar); echo $idx; i get: key2 i have searched on net , not isolate problem. seems when associative array contains 0 value, array_search fails if strict parameter not set. there more 1 bug warnings , rejected motivation: “array_search() loose comparison default”. ok, resolve little problem using strict parameter... but question is: there decent, valid reason why in loose comparison 'mary'==0 or 'two'==0 or php madness? you need set third parameter true use strict comparison. please have @ below explanation: array_search using == compare values during search form php

Android Studio automatically erases my static imports in Unit tests -

android studio automatically erases static imports. started out creating new tests using robolectric , when used static import import static junit.framework.assert.assertequals; android-studio automatically removes it. frustrating. is there settings need set up? go preferences --> editor --> code style --> java, select "imports" tab. you can manage imports there see fit. example, have settings in section "packages use import '*'". screenshot

How can I use regex to remove a line from a file with PHP? -

i writing extension codeigniter's language class remove language line file. script provided array key determine file line remove. don't believe have written regex detect config file line. here cat_names language file: <?php $lang['cat_123'] = 'transportation'; $lang['cat_124'] = 'restaurants'; this language class extension: public function remove_line($line, $file){ $ci =& get_instance(); $ci->load->helper('file'); foreach($this->existing_langs $lang){ $lang_contents = read_file($this->lang_path.'/'.$lang.'/'.$file.'_lang.php'); $new_contents = preg_replace("^$lang\[\$line\] \= (.*?)\\n^", '', $lang_contents); write_file($this->lang_path.'/'.$lang.'/'.$file.'_lang.php', 'w+'); } } i use following call method removes lines language file: $this->lang->remove_line('cat_123&

jenkins - Check out stream from AccuRev without workspace or reference tree -

since can not delete workspace or reference tree in accurev (only deactivate it), want create local copy of streams contents, without using those. ofcourse use accurev hist in combination accurev cat , sounds awful workaround such basic functionality. so, wonder, there easy command this? i want use in jenkins ci environment check sources (compile, run tests, etcetera). never have push changes accurev, accurev gurus recommend using reference tree. however, want create these dynamically , used once. not seem idea clutter accurev server thousands of unused reference trees. you can use accurev pop command want. within jenkins, equivalent of using option of "neither" workspace or reference tree if using accurev plug-in jenkins. if prefer script yourself, can use accurev pop -r -v <stream-name> -l <some-directory-location> /./ substitute in stream name , directory location want write. /./ in command tells accurev populate depot root directory , -r

html - itHow do I make div/ div images not move when resizing, while also allowing them to have a % from the top -

i want able resize window while divs keep position on page , resize % of width , height declare. html: <body> <div class="view"> <div class="tree"> <img id="tree" src="img/tree.png"> </div> <div class="ground"> <div class="g"></div> </div> </div> </body> css: .tree { position: absolute; } .tree #tree { position: relative; height: 75%; width: 75%; left: 30%; } .ground { z-index: 2; width: 100%; height: 100%; } .ground .g { background-color: green; opacity: .5; position: relative; height: 50%; width: 100%; } the tree stays pretty constant, when window largest can on macbook, slides on left little. ground element vertically takes half page, instead want placed 50% top. when try apply 'top' style either of them nothing happens. know

sql - Set empty strings ('') to NULL in the whole database -

in database many text columns values empty strings ( '' ). empty strings need set null . not know exact schemas, tables , columns in database or rather want write general solution can reused. how write query / function find text columns in tables in schemas , update columns empty strings ( '' ) null ? the efficient way achieve this: run single update per table. only update nullable columns (not defined not null ) actual empty string. only update rows actual empty string. leave other values unchanged. this related answer has plpgsql function builds , runs update command using system catalog pg_attribute automatically , safely given table: replace empty strings null values using function f_empty2null() answer, can loop through selected tables this: do $do$ declare _tbl regclass; begin _tbl in select c.oid::regclass pg_class c join pg_namespace n on n.oid = c.relnamespace c.relkind = 'r'

ios - Remove duplicate key value from array of NSDictionary? -

i need compare 2 array values 1 one, if value match 1 another, need update value , replace main array. nsmutablearray having array of nsdictionary nsarray having array of nsstring objects. my code nsmutabledictionary *dicone = @{@"eveid":@"1",@"imgarray":@[@"one",@"two"]}; nsmutabledictionary *dictwo = @{@"eveid":@"2",@"imgarray":@[@"three",@"four"]}; nsmutablearray *temparray = [nsmutablearray array]; [temparray addobject:dicone]; [temparray addobject:dictwo]; nsarray *eventarray = [nsarray arraywithobjects:@"1",@"2",@"3",nil]; nsstring *filename = @"five"; (int jj = 0; jj<[eventarray count]; jj++) { nsstring *toparrayeventid = [nsstring stringwithformat:@"%@",[eventarray objectatindex:jj]]; (int kk = 0; kk<[temparray count]; kk++) { nsmutabledictionary *curen

android - Fabric (Crashlytics) does not deobfuscate exception stacktraces -

i've configured fabric maven , android-maven-plugin , can see test exceptions in fabric dashboard. i've obfuscated app can see obfuscated class/method names (i expect plugin upload proguard mapping , show deobfuscated stacktraces instead). i've checked follow doc . can see 'mapping.txt' saved in ./target/proguard/mapping.txt instead of ./target/proguard_map.txt expected fabric. i've checked proguard.cfg not contain -printmapping mapping.txt . i've tried fix adding mapping_location fabric plugin (though it's not clear in doc plugin should added) this: <plugin> <groupid>com.crashlytics</groupid> <artifactid>crashlytics-maven</artifactid> <version>1.12.0</version> <executions> <execution> <id>generateresources</id> <goals>

jekyll - How can I loop on all items where a certain field is not empty? -

i want loop on items in collection have field set (not empty). tried this: {% assign papers_with_demos=site.data.papers | where:"demo", not blank %} {% if papers_with_demos.size > 0 %} <h2>demos</h2> {% paper in papers_with_demos %}] ... {% endfor %} {% endif %} but not work; papers returned. my goal heading "demos" shown, if there 1 or more paper demo. if papers being returned, must using data files. if value empty particular key in data file return false. check data key forloop like: {% paper in site.data.papers %} {% if paper.demo %} {% endif %} {% endfor %} you'll find more info in data files section of jekyll documentation. updated in response reply: {% item in site.data.items %} {% if item.random %} {% assign random-val = item.random %} {% if random-val %} <p>true</p> {% endif %} {% endif %} {% endfor %} this return true if inside items.yml, have - random: true, no

nginx - Keep Docker running when shell script exits -

i have following docker file. from ubuntu run apt-get update expose 9000:80 # install nginx run apt-get install -y nginx # install curl run apt-get -qq update run apt-get -qq -y install curl entrypoint service nginx start when try run following commands in shell script, docker image created , container started, however, when shell script exits, docker container stopped. how can keep docker container running after shell script exits ? idea have running container nginx running on port 80 can accessed host using port 9000. don't run nginx background service. launch in foreground nginx container on hub.docker.com does: cmd ["nginx", "-g", "daemon off;"] with containers, when pid 1 dies, container dies. it's identical when kill pid 1 (init) on linux machine.

jquery - Clone single div contents with the same class -

i trying clone contents of clicked div's same class different id's. have tried several answers no luck. have tried $(this).next('.pick').clone().appendto('#four'); here have example. <div id="one" class="pick"> 1 </div> <div id="two" class="pick"> 2 </div> <div id="three" class="pick"> 3 </div> <div id="four" class="pickfour"> 4 </div> <script type="text/javascript"> $(document).ready(function() { $(".pick").click(function(e){ e.preventdefault(); $(function(){ $(".pick", this).clone().appendto('#four'); }); }); }); </script> there no need 2nd domready code, , use $(this) selector: $(document).ready(function() { $(".pick").click(function(e) { e.preventdefault(); $(this).clone().appendto('#four');

java ee - @Resource not injected in CDI managed bean, but works fine in web servlet -

i'm trying read out lot of first names database using jdbc, , working fine in servlet named helloservlet. able respond request bunch of names. @webservlet(name = "helloservlet", value = "/hello") public class helloservlet extends httpservlet { @resource(lookup = "java:global/employeesds") datasource ds; @override protected void doget(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception { list<string> list = new arraylist<>(); try(connection connection = ds.getconnection()) { statement statement = connection.createstatement(); resultset result = statement.executequery("select first_name employees"); while(result.next()) { list.add(result.getstring(1)); } } catch (sqlexception e) { e.printstacktrace(); } printwriter pw = resp.getwriter(); for(string na

c# - WebBrowser Use in WPF Not Working Correctly -

Image
i attempting host webbrowser in wpf application going used display cctv camera. have 2 issues current use of it. firstly, webbrowser isn't behaving have come expect other wpf ui elements. have set inside grid , doesn't fill row / column. ends looking this; from normal wpf point of view have expected webbrowser fit entire host. simple xaml it; <grid> <grid.rowdefinitions> <rowdefinition /> <rowdefinition /> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition /> <columndefinition /> </grid.columndefinitions> <webbrowser x:name="cctvwb"/> </grid> secondly, doesn't seem want display common web pages such google or bbc, though believe may html , error message reads "to protect security of information enter website, publisher of content not allow displayed in frame." this html ; private void cctvload(obje

javascript - How to add socket.io to my gruntfile.js -

i have gruntfile.js generated automatically , add socket.io (it client part working). have tried this but, not working. this gruntfile.js grunt.initconfig({ connect: { options: { port: 9000, hostname: '0.0.0.0', livereload: 35729, oncreateserver: function(){ var io = require('socket.io').listen(server); console.log("new sever ----------------------------------------"); } }, livereload: { options: { open: true, middleware: function (connect) { return [ connect.static('.tmp'), connect().use( '/bower_components', connect.static('./bower_components') ), connect().use( '/app/styles', connect.static('./app/styles') ), connect.static(appconfig.app) ]; } } }, test: {

android - Custom Property animation not working on disabling animation -

i creating android application each fragment bind custom left right slide animation. achieved using custom property animation ( fractionlinearlayout.java class given below). app has several fragment , switching among these fragment followed right left slide animation. working perfect untill disable animation developer options testing purpose. nothing appears when disable animations. can see logcats means app working perfect views not being loaded, (may be) because of custom properties fractiontranslationx , fractiontranslationy . has gone through problem? in advance. fractionlinearlayout.java: custom class animation public class fractionlinearlayout extends linearlayout { displaymetrics matrics = getcontext().getresources().getdisplaymetrics(); public fractionlinearlayout(context context, attributeset attrs, int defstyleattr) { super(context, attrs, defstyleattr); // todo auto-generated constructor stub }

Specific Sort of elements to add in new list Python/Django -

i have : [ [{ 'position': 1, 'user_id': 2, 'value': 4, 'points': 100}], [{ 'position': 2, 'user_id': 6, 'value': 3, 'points': 88}], [{ 'position': 3, 'user_id': 5, 'value': 2, 'points': 77}], [{ 'position': 4, 'user_id': 7, 'value': 1, 'points': 66}], [{ 'position': 5, 'user_id': 3, 'value': 1, 'points': 9}], [{ 'position': 6, 'user_id': 11, 'value': 0, 'points': 9}], [{ 'position': 7, 'user_id': 1, 'value': 0, 'points': 3}], [{ 'position': 8, 'user_id': 10, 'value': 0, 'points': 3}], [{ 'position': 9, 'user_id': 4, 'value': 0, 'points': 2}], [{ 'position': 10, 'user_id': 8, 'value': 0, 'points': 2}] ] is organized points. idea choose user_id ,