Posts

Showing posts from June, 2010

list - Sort depending on variable in Scala -

is there way in scala sort list of objects specific field using variable set order (asc or desc)? i know sortwith can like mylist.sortwith((x, y) => x < y) or mylist.sortwith((x, y) => x > y) to sort ascending or descending, want use variable. so, tried this: case class person(firstname: string, lastname: string, age: int) private def sortdocuments(sortfield: string, sortdirection: string, people: list[person]): list[person] = { sortfield match { case "age" => people.sortby(if (sortdirection == "desc") -_.age else _.age) case "firstname" => people.sortwith { sortstring(a.firstname, b.firstname, sortdirection) } case "lastname" => people.sortwith { sortstring(a.firstname, b.lastname, sortdirection) } } } private def sortstring(fielda: string = null, fieldb: string = null, direction: string = "asc") = { val fieldavaild = option(fielda).getorelse("") val fieldbvaild =

windows - UAC Elevation vs. Impersonation -

(skip bottom tldr version.) ok - have searched (really!) , other uac articles have found seem center on enabling, disabling, detecting or hiding uac. issue not 1 of those, here goes: my user used have standard dual-token setup in administrators group , uac's consent ui ask me if wanted proceed. now, have separate administrative-level accounts need use, , have authenticate new user. problem having previously, starting app administrator elevated current user, if use credentials of new administrative user, whatever running runs as new user. as example, elevating cmd , typing whoami command prompt used return normal/current user, returns new administrative user. this has serious negative consequences - since new user, , administrative-level one, if files created using new user, normal user cannot write or delete them unless manually adjust permissions , ownership. if use development environment under new account (e.g. need debug service or work driver) , rebuild so

c++11 - Linker refers to, supposedly, undefined reference to vtable -

i trying use abstract class represent common base subtypes. however, (the linker seems) keeps moaning vtables , undefined references no matter do. judging error messages, problem must related destructors in way. wierdldy enough, keeps talking a "undefined reference 'abstractbase::~abstractbase()'" in child.cpp makes no sense. like last time, can't show code, here example in essence same thing: first abstract class, "abstractbase.h": #ifndef abstractbase #define abstractbase class abstractbase { public: virtual ~abstractbase() = 0; } #endif the child uses abstractbase, "child.h": #ifndef child #define child class child : public abstractbase { public: ~child() override; } #endif the implementation in "child.cpp": #include "child.h" child::~child() obviously there far more functions, in essence that's how real class's destructors look. after scouring web ways of using abst

app store - Upload IPA to iTunes Connect from a different Mac -

i confirm understanding , check whether can done or not. have imac , macbook development. have created ipa app store need upload itunes. now question have generated ipa imac contains profiles , certificates. can upload ipa macbook using application loader 3.0, macbook not contain of profiles , certificates. from understanding should doable ipa contains required, still wants confirm other developers in community. this can done , application loader has no dependency on certificates , profiles. need login using proper credential , select proper ipa required uploaded.

regex - Notepad++: Reducing multiple line breaks to single -

Image
my text document has multiple line breaks @ random places. want use notepad++ reduce multiple line breaks single line break. how can accomplish that? i on lines of using \n in extended find/replace mode can't quite it. you can use regular expression s&r: (?:\r\n){2,} or \r{2,} in find what field and \r\n in replace with field. may adjust replacement pattern per needs.

shell - Daemonizing an executable in ansible -

i trying create task in ansible executes shell command run executable in daemon mode using &. following -name: start daemon shell: myexeprogram arg1 arg2 & what seeing if keep & task returns , process not started . if remove & ansible task waits quite time without returning. appreciate suggestion on proper way start program in daemon mode through ansible. pls note dont want run service adhoc background process based on conditions. running program '&' not make program daemon, runs in background. make "true daemon" program should steps described here . if program written in c, can call daemon() function, you. can start program without '&' @ end , running daemon. the other option call program using daemon , should job well. - name: start daemon shell: daemon -- myexeprogram arg1 arg2

python - Why use re.match(), when re.search() can do the same thing? -

from documentation, it's clear that: match() -> apply pattern match @ beginning of string search() -> search through string , return first match and search '^' , without re.m flag work same match . then why python have match() ? isn't redundant? there performance benefits keeping match() in python? "why" questions hard answer. matter of fact, define function re.match() this: def match(pattern, string, flags): return re.search(r"\a(?:" + pattern + ")", string, flags) (because \a matches @ start of string, regardless of re.m flag status´). so re.match useful shortcut not strictly necessary. it's confusing java programmers have pattern.matches() anchors search start and end of string (which more common use case anchoring start). it's different match , search methods of regex objects , though, eric has pointed out.

python - Django template failling despite my effort to learn it -

categories.html # want called categoryview.as_view() never works. howevwer index.html works have hardcoded link follows within index.html. although index.html extends base.html outputing url. edit: avoid confusion available in index.html template guess should work shows following error index page not found (404) <li><a href="{% url 'all_categories' %}">all</a></li> from root directory when type http://127.0.0.1:8000 works want http://127.0.0.1:8000/cartegories/ ( index.html or categories.html ) assume index.html or categories.html not visible when typed, fine. i can’t believe taking me 12hours possible intuitive tweaking still can’t work. please advise doing wrong. in essense outputing hellow world in categories.html later iterate through , list categories in blog… if hello world can’t work nothing will.. #posts urls.py django.conf.urls import include, url django.contrib import admin .views import indexview, categoryview urlpa

html - set background css image in phpstorm - "cannot resolve file" -

i have image i'd set background in laravel 3 project - background-image: url("public/img/find-a-table.png"); but it's saying "cannot resolve find-a-table.png" in phpstorm though have image file added directory. do need change have find image in directory? in other typical web app, quite trivial don't know if i'm missing something. this site shows don't need quotes around path? i've tried doesn't fix it. use: background: url(images/bg.jpg) no-repeat center center fixed; without quotes phpstorm not tell you, browser not see given file. tells phpstorm not see file. you have tell phpstorm relative path(es) start(s). to so, open project file structure ( cmd + 1 on mac), right click on (public accessible) root directory ( public ), mark directory > , mark sources root . after couple of seconds error message should disappear.

javascript - Call js function from code-behind (Not as startupScript) -

basically want is: click on button delete record. delete record if specific column (location) null (this done , works fine) delete record, if specific column not null, ask user confirm. so step 3 tricky part. ajax, call deletechannel(url) see below, calls proper method in code-behind. here tricky part: if (channel != null && channel.location != null) { // how do this? (notice code-behind) showdialogthatasksusertoconfirm() } the code: showdialogthatasksusertoconfirm() needs call client saying "the location column not null", , wait user delete anyway, or cancel. i have code call method in code behind: function deletechannel(url) { $.ajax({ url: url, type: "post", cache: false, contenttype: 'application/html; charset=utf-8', data: $("form").serialize(), datatype: 'html', success: function (msg) { showdialog('successdiv'); }, error: f

angularjs - How to have access to directive scope value from my main controller -

web api file upload angularjs - https://code.msdn.microsoft.com/angularjs-with-web-api-22f62a6e#content this tutorial upload selected files server there no way selected filename exception directive, please, need way filename of selected file directive scope, can use in controller this focus area (function () { 'use strict'; angular .module('app.photo') .directive('egphotouploader', egphotouploader); egphotouploader.$inject = ['appinfo','photomanager']; function egphotouploader(appinfo, photomanager) { var directive = { link: link, restrict: 'e', templateurl: 'app/photo/egphotouploader.html', scope: true }; return directive; function link(scope, element, attrs) { scope.hasfiles = false; scope.photos = []; scope.upload = photomanager.upload; scope.appstatus = appinfo.status; scope.photomanagerstatus = phot

php - Adding two different rules to htaccess file -

i have rule in .htaccess file force www url. here rule #force www: rewriteengine on rewritecond %{http_host} ^example.com$ [nc] rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc] and trying add rule remove index.php in url. here other rule #to remove /index.php rewritecond $1 !^(index\.php|resources|robots\.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l,qsa] i tried different ways, changing order of rules, removing [l] option, have first rule working not second, not sure missing. , guidance appreciated. thank you.

matlab - Error using integral: A and B must be floating-point scalars -

i want evaluate simple example of integral a = max(solve(x^3 - 2*x^2 + x ==0 , x)); fun = @(x) exp(-x.^2).*log(x).^2; q = integral(fun,0,a) and error is error using integral (line 85) , b must floating-point scalars. any tips? lower limit of integral must function, not number. the matlab command solve returns symbolic result. integral accepts numeric input. use double convert symbolic numeric. code written now, max should throw error due symbolic input. following works. syms x; = max(double(solve(x^3 - 2*x^2 + x))); fun = @(x) exp(-x.^2).*log(x).^2; q = integral(fun,0,a) output: 1.9331 . the lower limit of integral must function, not number integral numeric integration routine; limits of integration must numeric.

visual studio - VS platform toolset on the command-line, for use with make-files -

i have portable cli tool builds on command-line using simple make-file. have adapted make-file builds using nmake , vc++ command-line tools, can't figure out how request "vs120_xp" toolset. i'm aware can set "vs120_xp" toolset new vs project , build inside ide or using msbuild on command-line, , works fine, want avoid converting whole make-file if possible. is there argument can pass "vcvarsall.bat" or "vcvars32.bat" scripts, arguments nmake, pre-processor definitions in make-file, or global settings somewhere, can use control this? afaik xp support after vcvarsall.bat need somethin this: set include=%programfiles(x86)%\microsoft sdks\windows\7.1a\include;%include% set path=%programfiles(x86)%\microsoft sdks\windows\7.1a\bin;%path% set lib=%programfiles(x86)%\microsoft sdks\windows\7.1a\lib;%lib% set cl=/d_using_v110_sdk71_;%cl% set link=/subsystem:console,5.01 %link% you can check this article

indentation error python 1 -

i have no clue why there's indentation area it's realy stresssing me out print "hello!" print "i\'m charlie , i\'m going test security of password!" print "first i\'d know bit you! name? (no data stored!!)" name = raw_input() print "nice meet you, %s!" % (name) print "what date of birth?" dob = raw_input() print "ok! answers used me forgotten when close window!" print "now %s, ready password tested?" % (name) if raw_input() = "yes" print "what password?" if raw_input() = "no" print "suit yourself, %s!" % (name) first of all, indentation off when write if statements. need bring them 1 tab space. here example of working code: print "hello!" print "i\'m charlie , i\'m going test security of password!" print "first i\'d know bit you! name? (no data stored!!)" name = raw_input(

if statement - php - do something on soap empty response or not found -

i need search on ws, have working, need able know when soap can not find word i'm looking. for example, when search ke-5977 response , data <getchoferesresult xmlns:a="http://schemas.datacontract.org/2004/07/asdf.dto" xmlns:i="http://www.w3.org/2001/xmlschema-instance"> <a:choferes> <a:choferesdto> <a:dc_patente>ke-5977</a:dc_patente> <a:dc_patente_habitual>ke-5977</a:dc_patente_habitual> <a:dc_rut_chofer>10165014-6</a:dc_rut_chofer> <a:dc_tipo_equipo>4</a:dc_tipo_equipo> <a:dc_tipo_transportista>e</a:dc_tipo_transportista> <a:dg_nombre_chofer>juan soto</a:dg_nombre_chofer> <a:dg_tipo_de_equipo>camión</a:dg_tipo_de_equipo> <a:dg_tipo_transportista>externo (se llama transporte ocasionalmente)</a:dg_tipo_transportista> <a:dn_ano_fabricacion>1988</

MongoDb Driver 2.0 C# Filter and Aggregate -

i'm playing around new driver of mongodb 2.0, , looking adding facetted searchs (temporary move ,before using elastic search). here method created build agreggation. guess should work. as parameter passed filterdefinition in method. don't find how limit agreggation filter. any idea ??? private void updatefacets(searchresponse response, filterdefinition<mediaitem> filter, objectid datatableid) { response.facetgroups =new list<searchfacetgroup>(); searchfacetgroup group = new searchfacetgroup() { code = "cameramodel", display = "camera model", isoptional = false }; using (idataaccessor da = nodemanager.instance.getdataaccessor(datatableid)) { var collection = da.getcollection<mediaitem>(); var list = collection.aggregate() .group(x => ((imagemetadata) x.metadata).exif.cameramodel, g => new {

amazon web services - aws kinesis get-records returns empty array -

i playing around kinesis, , tried simple example i first put sample record aws kinesis put-records --records "data=test data - hemant,partitionkey=20150421" --stream-name mystream i back { "failedrecordcount": 0, "records": [ { "sequencenumber": "49549975503580743304507290523786194552567002802960728066", "shardid": "shardid-000000000000" } ]} so put appears have worked. trying retrive record, first, getting shard-iterator, , calling ger-record using returned shard-iterator. get-shard-iterator returns aws kinesis get-shard-iterator --stream-name cakestream --shard-id 0 --shard-iterator-type latest { "sharditerator": "aaaaaaaaaaena1yl0ccbirck95wu6wrfn7lamlaxl5bz1gzafrucsu8s74o4pus59z0xmdamamdvz4tv3qkupxpomz/eeg671gvuknhudruakya4pjwrp37vi1k5w/klqpbo49ysckhmxcduan6gdecxl4qmsgvh9aqi7leruir2t1w4meqjhlcm1iz8icawglhfuvcbgty="} and try records using shard-iterator

c++ - Installed MPI but still linker error LNK2019 appears -

i've installed ms-mpiv5 microsoft , debugger msmpi. in proejct properties in vs2012, i've changed c/c++ -> additional include libraries adding "$(msmpi_inc); $(msmpi_inc)\x64" , linker -> options->additional dependencies adding "msmpi.lib;", vs still giving me al lot of linker errors such error lnk2019: unresolved external symbol _mpi_barrier@4 unresolved external symbol _mpi_bcast@20 and on, mpi functions or type of variables. there forgot change or add? i haven't used 2012, if it's similar older versions of vs this detailed link may help. in general make sure these 3 things: add "additional include directories" add "additional library directories" add "additional dependencies " (msimpi.lib) it sounds may missing 2nd step?

c# - I'm a newbie. Import a .txt file to datagridview -

according assignment , need openfiledialog open .txt file them need loaded on datagridview in , ideas , know have split rows , columns don’t know code , beginner in freshman i start looking system.io.stringreader read file. need split have been told, , save values datagridviewcells can added datagridview.

Kendo Grid Filter - Show Yes/No if column has information -

as title says, on specific column in grid, trying show yes/no filtering options, depending on whether column has information. is possible? yes can done using filter menu customization. please visit here working demo more details here

data structures - Circular LinkedList in Java -

i brushing on data structures reading book , 1 of questions asks build circular single linked list not using "first" & "last" pointers, rather allow access using 1 reference "current". not sure understand question, thought needed @ least either first or last. here implementation has "first", not sure how around it. can please comment on how can adjust code eliminate reliance on first? class link { public int idata; public link next; public link(int id) { // constructor idata = id; } public void displaylink() { system.out.print(idata + " "); } } // end class link then here's list itself: public class circularlinkedlist { private link first; private link current; public link getcurrent(){ return current; } public void setcurrent(int data){ } public void adv

mysql - #1111 - Invalid use of group function -

the following query failing , complaining #1111 - invalid use of group function because of both sum() calls embedded inside if loops. i'm trying accomplish same goals while migrating sql query i'm having osme hard time, 1 point me right direction? database composed invoices table may have invoices_payments if client hasn't paid invoice @ once , instead have gone instal payments. known that, i'm trying sum invoices.invoice_total substracting each invoices_payments.payment_date whichs not equals current week if invoices.issued_date equals current week, if not i'm trying sum invoices_payments.payment_amount invoices_payments.payment_date equals current week. select sum( if ( yearweek(i.issue_date, 1) = yearweek(now(), 1), i.invoice_total, 0 ) ) week_invoiced, ##sum functions embedded inside next if causing error: #1111 - invalid use of group function sum( if ( ## if pa

Android: Sending SMS works on Emulator but NOT on real devices -

updated: have tried code on phone (4.1.2), works perfectly. when tried on phone using 4.4.2, not work, returns "radio off". app set default app handling message fyi. here activity send sms: public class viewconversation extends activity { sqlitemanager sql; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.inbox_conversation); init(); initlistview(); initsendsms(); } @override public void onbackpressed() { startactivity(new intent(this, mainlayout.class)); } private void init() { sql = new sqlitemanager(this); } private void initlistview() { viewconversationadapter adapter = new viewconversationadapter(this, getmessages()); listview lv = (listview) findviewbyid(r.id.lv_conversation); lv.setadapter(adapter); } private string[] getmessages() { bundle b = getintent().getextras(); string fk_conversation_info = b.getstring("fk_conversation_in

Check SQL Server Replication Defaults -

we have database a replicated subscriber db b (used ssrs reporting) every night @ 2.45 am. we need add column 1 of replicated tables since it's source file in our iseries having column added need use in our ssrs reporting db. i understand (from making schema changes on publication databases ) , answer here damien_the_unbeliever ) there default setting in sql server replication whereby if use t-sql alter table ddl statement add new column our table bupf in pion database, change automatically propagate subscriber db. how can check replication of schema changes setting ensure have no issues replication following making change? or should run alter table bupf add column bupcat char(5) null ? to add new column table , include in existing publication, you'll need use alter table < table > add < column > syntax @ publisher. default schema change propagated subscribers, publication property @replicate_ddl must set true. you can verify if @replica

java - label outside the actionPerformed does not refresh -

i tried implement code when press button has, increments 1 unit in label above button. in other words, shows how many times has user pressed button. problem can't seem refresh label when press button. variable holds number of "clicks" incremented in label remains initial declaration value, 0. can help? import javax.swing.*; import java.awt.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; public class contadorcliques extends jframe { private trataevento trataevento; private jbutton buttonclick; private int clickcont = 0; private jlabel l1; public static void main(string[] args) { contadorcliques contador1 = new contadorcliques("hello!"); } public contadorcliques(string titulo) { super(titulo); container c = getcontentpane(); borderlayout bl = new borderlayout(); c.setlayout(bl); l1=new jlabel(string.valueof(clickcont)); jpanel pbot

python - Updating SQL Table Where Fields May be Null -

i have sql table want update daily. data records need updated pulled web, text file. have python script read data, , figure out records need updated. given potentially large number of records updated each day, following: with get_connection_to('database') connection: cursor = connection.cursor() cursor.executemany(query, data) the problem approach of fields may potenitall null \ none so if use query like update tablename set active = 0 field1 = ? , field2 = ? , field3 = ? , field4 = ? , field5 = ? then records contain null value won't updated. the best idea i've come far loop on each row, inspect each element, construct sql query each update, , perform each transaction separately. feels inelegant, , slow solution problem. has got better solution? update tablename set active = 0 nullif(?,field1) null , nullif(?,field2) null , nullif(?,field3) null , nullif(?,field4) null , nullif(?,field5) null

phpeclipse - how execute php file in a browser with eclipse -

i need execute php file in web browser. use eclipse configured php. code simply: <?php echo "<a href='hi'>hello</a>"; i start "php web application" obtain is: http://it.tinypic.com/r/24pjwq9/8 "object don't find". anyone can me? you using wrong url . for moment if need test script it's not hard new php's inbuilt web server goto folder have php file command prompt. type php -s localhost:8000 , start php web server (as of php 5.4.0, cli sapi provides built-in web server.) lets file name index.php . goto web browser , type http://localhost:8000/index.php

javascript - "Uncaught TypeError: Illegal invocation" mystery (to me) -

i've looked through few dozen questions issue , still haven't been able figure out. here's example of i'm doing. note new_client_name string "walmart". function 1 (){ var new_client_name = allselectedinfo.client_name; pickclient(new_client_name); } function pickclient (new_client_name){ var new_client = new_client_name; $.ajax({ url: 'php/get_cohorts.php', type: 'post', //datatype: 'json', data: { client: new_client }, success: function(data) { //do } }); } both functions execute fine , data want ajax call , appears working fine, except illegal invocation error, tied line starts $.ajax . what's causing this?

php - How to store data inside session array in given format? -

category name list = rm 20 list b = rm 50 category name list = rm 40 category name list = rm 80 list b = rm 40 list c = rm 25 i tried $_session['info']=array('category'=>$category,'list'=>$list,'rate'=>$rate); but doesn't display format wanted. can please?` edit: i think didn't elaborate clearly. the values item category, list , rate come user input. so store them in variables this: php $category[]=$_post['category'];<br/> $list[]=$_post['list']; $rate[]=$_post['rate']; storing in session array this: $_session['info']]=array('level'=>$level,'subject'=>$subject2,'rate'=>$rate2);` html <input type="checkbox" name="category['category name']" id="category" class=category" value="1"> <input type="checkbox" name="list['category name']" id=&q

android - Contextual Action Bar appears white(no background) on one device but ok on the others -

i'm new android, thing don't think related experience. when long press item in list show cab, appears white background. can see buttons on bar when long pressing them, otherwise invisible.i using same style file on 2 different apps , other 1 ok. happens on 1 device. ideas? <resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android"> <!-- base application theme. --> <style name="mytheme" parent="theme.appcompat.light.darkactionbar"> <item name="android:activatedbackgroundindicator">@drawable/background_activated_drawer</item> <item name="android:actionbarstyle">@style/myactionbar</item> <item name="actionbarstyle">@style/myactionbar</item> </style> <style name="myactionbar" parent="@style/widget.appcompat.light.actionbar.solid.inverse"> <i

c# - Regex to parse Active Directory string fails -

i have block of code in c# code-behind: string input = "cn=l_wdjack127_wdc_ssis_user_ch,ou=alosup,ou=infra,dc=internal, dc=mycompany,dc=com" string pattern = @"cn\=(.+)\,"; matchcollection matches = regex.matches(input, pattern); foreach (match match in matches) { console.writeline(match.groups[1].value); } when run this, match.groups[1].value equal l_wdjack127_wdc_ssis_user_ch,ou=alosup,ou=infra,dc=internal, dc=mycompany i need equal l_wdjack127_wdc_ssis_user_ch can please fix regex? basic greedy/lazy quantifier problem: string pattern = @"cn\=(.+?)\,"; this resource should why: http://www.regular-expressions.info/repeat.html basically, .+ tries match as many of character, , @ least 1 of which, possible before hitting last comma . adding ? end of ( .+? ) tell regex engine match as many of any, , @ least 1 of which, character possible before hit first comma .

android - Using an old token to query Purchases.subscriptions in the Google Play Developer API -

let's have saved token when user has purchased automatically renewing subscription via google play. when subscription automatically renewed, can still use older, initial token current status of subscription (via purchases.subscriptions: get )? yes, can. token not change. pass token in request find out if subscription has renewed or not. make sure not lose token otherwise nightmare figure out if user has renewed or not.

javascript - How do I get Angular Isotope to be fully responsive? -

i trying create responsive version of isotope using angularjs/angular-isotope. have created non-angularjs version utilises jquery (found on stackoverflow , other sources) make columns , items responsive: $(window).load(function() { var $container = $('#one-column'), margin = 10, colwidth = function () { var w = $container.width(), columnnum = 1, columnwidth = 0; if (w > 1200) { columnnum = 5; } else if (w > 1024) { columnnum = 4; } else if (w > 768) { columnnum = 3; } else if (w > 480) { columnnum = 2; } columnwidth = math.floor(w/columnnum); var $item = $('.story'), width = columnwidth-10 $item.css({ width: width }); var $featured = $('.featured'), dblwidth = columnwidth*2-10 if (w > 480) { $featured.css({

Digital signature from electronic smartcard in Chrome -

for electronic prescription system, runs on browser , requieres personal signature professional, using java applet sign xml request, sended ws, using smartcard. but since version 42, chrome disabling default npapi support , , in future versions next september 2015 disabled , applets won't usable @ all. at chrome npapi deprecation page points webcrypto , tls alternatives. seems webcrypto has leaved out of scope support of smartcards , , seems tls cryptographic protocols , doesn't provides way use electronic cards. has used browser native solution sign documents , have control of process. @ least nedeed: no confirmations , no visualitzation of xml request signed user. because signed internal technical request has no value user, , application runs in controlled , trusted system in internal lan. we faced same problem, came solution (native messaging, yes) https://github.com/open-eid/chrome-token-signing

beautifulsoup - Python, Beautiful Soup: how to get the desired element -

i trying arrive element, parsing source code of site. snippet part i'm trying parse (here until friday), same days of week <div id="intforecast"> <h2>forecast rome</h2> <table cellspacing="0" cellpadding="0" id="nonca"> <tr> <td onclick="showdetails('1');return false" id="day1" class="on"> <span>thursday</span> <div class="inticon"><img src="http://icons.wunderground.com/graphics/conds/2005/sunny.gif" alt="sunny" /></div> <div>clear</div> <div><span class="hi">h <span>22</span>&deg;</span> / <span class="lo">l <span>11</span>&deg;</span></div> </td> <td onclick="showdetails('

asp.net - radiobuttonfor with data- with strange behaviour -

i'm trying make checkbox bool value model. works, i'm trying add data-* field checkbox in order add parameters nice bootstrap-switch component, , doesn't work: <input data-val="true" id="actionlist_0__efficacity" name="actionlist[0].efficacity" type="radio" value="{ data_on_text = yeah}"> and should be <input data-val="true" id="actionlist_0__efficacity" name="actionlist[0].efficacity" type="radio" data-on-text = "yeah"> so i've done: @html.radiobuttonfor(x => x.efficacity, new { data_on_text = "yeah" } ) i tried editorfor can't put data_ editorfor apparently... thanks help the html , helper have shown don't quite match (the html suggests generating radio buttons collection because contains indexer or perhaps have editortemplate type represented property actionlist ?) 2nd parameter of radiobuttonfor() object s

"fatal error: 'chrono' file not found" when compiling C++ project based on CMake -

do know error message means , should now? vpn-global-dhcp3-252:build dolyn$ make scanning dependencies of target mdatom [ 10%] building cxx object cmakefiles/mdatom.dir/src/main.cpp.o /users/dolyn/sources/src/main.cpp:124:11: fatal error: 'chrono' file not found #include <chrono> high resolutio timings ^ 1 error generated. i have no idea have now. the build error probably means source file includes c++11 header ( <chrono> ) compiling without support c++11. given compiler supports c++11, need activate using following line in cmakelists.txt file: set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++11")

Run Windows service by installutil and facing permission issue c# -

i developed small windows service sql dependency classes monitor table changes. if table change occur service call web service. service create folder , file save log , service send mail user. i try copy service exe file in folder of program files folder , issue command installutil c:\bba-reman\partindexer\myservice.exe getting error related message , understood permission getting issue. open command prompt run admin , service running fine , create folder & file saving log data. so did now. add manifest.xml file in project , make association file project. manifest.xml file content here. this area change in manifest file running service admin privilege <requestedexecutionlevel level="requireadministrator" uiaccess="false" /> i again compile service , open command prompt without run admin , issue same command installutil c:\bba-reman\partindexer\partindexerservice.exe getting same permission issue related error message before. so please

tcp - Python scapy show ip of the ping (echo) requests -

i want grab , print source address of ping requests. have following script: pkt = sniff(filter="icmp", timeout =15, count = 15) if pkt[icmp].type == '8': print pkt[ip].src when packet arrives script crashes attributeerror:'list' object has no attribute 'type' however on scapy console can see exist! >>>packet=ip()/icmp()/"aaaaaa" >>>packet[icmp].type 8 >>> any thoughts?? i changed testing purposes (!) script following: pkts=sniff(filter="icmp", timeout=120,count=15) packet in pkts: if packet.haslayer(ip) , str(packet.getlayer(ip).src)=="127.0.0.1" print "packet arrived" if packet.haslayer(icmp) , str(packet.getlayer(icmp).type)=="8": print(packet[ip].src) the above after doing ping: ping localhost -c 3 produces following awkward result: packet arrived 127.0.0.1 packet arrived 127.0.0.1 packet arrived packet

android - Map Toolbar always shows in liteMode -

Image
i show map in recyclerview litemode , working how expected until last night. believe phone got new google play services 7.3 update , when started app morning every instance of litemode map has little open in google maps app icon in bottom right. in onbindviewholder of recyclerview try disable toolbar so @override public void onbindviewholder(viewholder viewholder, cursor cursor,int position) { if(viewholder.mgooglemap != null){ viewholder.mgooglemap.addmarker(new markeroptions().position(incident.getposition())); viewholder.mgooglemap.getuisettings().setmaptoolbarenabled(false); viewholder.mgooglemap.getuisettings().setallgesturesenabled(false); viewholder.mgooglemap.setonmapclicklistener(new googlemap.onmapclicklistener() { @override public void onmapclick(latlng latlng) { } }); cameraposition p = new cameraposition.builder()

javascript - Unit Testing angularjs directive with angular-material-design with requirejs throws a "GET" error -

my app uses requirejs angularjs. i'm using text! in order load templates (so not use templateurl in directives). works fine - unless 1 of directives contains image in template. i'm trying setup tests new directives icons in templates, no success. instance, have following directive template: <buttondirective> <md-icon md-svg-src="/android.svg" alt="android "></md-icon> </buttondirective> karma yells @ me "/android.svg" being called (the known "get" error: unexpected request: imagefilepath). i've tried add image files karma config, did not solve issue. any way around besides not using md-icon? (it works when change m d-icon simple image, guess issue md-icon directive using async call svg file , karma hates that...). i got around issue using $httpbackend mock request: beforeeach(inject(function(_$compile_, _$rootscope_, _$httpbackend_) { $compile = _$compile_; $rootscope = _$ro

How to run Polymer locally, without any web server? -

i have designed ui desktop app using polymer. when run app locally gives me following error : "imported resource origin 'file://' has been blocked loading cross-origin resource sharing policy: received invalid response. origin 'null' therefore not allowed access." desktop app need no internet connectivity , no web server. solution run app locally ? thanks import s cannot work without web server because potentially violates of browser's security policies , sure know that. here few solutions: use local web-server python or node serve custom-elements if use node-webkit wrap html , comes built-in server no worries web-server p.s. using web-server safer choice.

java - How to make the random placing of ships not overlap any ships when placing in battleships -

im making game battleships on computer , wonder how can make ships not overlap each other when randomly placing them. code right looks this: public class battleshipsetup { public static class boat { int size; } public static class aircraftcarrier extends boat { public aircraftcarrier() { size = 5; } } public static class battleship extends boat { public battleship() { size = 4; } } public static class destroyer extends boat { public destroyer() { size = 3; } } public static class submarine extends boat { public submarine() { size = 3; } } public static class patrolship extends boat { public patrolship() { size = 2; } } public static class gridsetup { int[][] grid = {{0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {

c# - async Throttling using AsyncCollection or BufferBlock from the TPL in .net -

i read stream , buffer it's output consumer read before producer has finish full reading of stream. example, read http stream , forward ... using .net4.5 tpl library. found out nito asynccollection , below wrote. wondering if correct because when debug, using long string test , when debuging asp.net vnext pipeline, readfrom , write in sequence... how sure has correct behaviour in non debug mode ? using nito.asyncex; using system; using system.collections.concurrent; using system.io; using system.threading.tasks; using system.threading.tasks.dataflow; namespace absyla.core { public class pipestream { private asynccollection<byte[]> _chunks = new asynccollection<byte[]>(1); public async task readfrom(stream s) { try { byte[] buffer; int bytesread = 0; int totalbytesread = 0

javascript - Json Filtering in jquery -

hello want filter json data sql query without of plugins alasql.js or linq.js or plugins. example { "managing pcl": [ { "iditscreen": "1436", "topicname": "managing pcl", "isfav": 0, "cdeitscreen": "listactivetarif", "busscreenname": "my current tarif" }, { "iditscreen": "1437", "topicname": "managing pcl", "isfav": 0, "cdeitscreen": "listterminetarif", "busscreenname": "history tarif" } ] } for example need data iditscreen>1430 json data must displayed main challenge without plugins please reccomend me solution without plugins first turn json javascript object: var obj = json.parse(myjson); then filtering: var match

symfony - Config entries for DoctrineExtensions SoftDeleteable: gedmo/doctrine-extensions -

i'm trying use softdelete option of gedmo/doctrine-extensions reason when call romove() , record in database gets removed instead of updating deletedat field. in here , doc tells update config with: $config->addfilter('soft-deleteable', 'gedmo\softdeleteable\filter\softdeleteablefilter'); this 1 of examples tried: # app/config/config.yml doctrine: orm: entity_managers: default: filters: softdeleteable: class: gedmo\softdeleteable\filter\softdeleteablefilter enabled: true references (just few of them): doctrineextensions softdeleteable http://knplabs.com/en/blog/gedmo-doctrine-extensions-on-symfony2 can't enable softdeleteable in symfony2 - unrecognized options "filters" so question in simple terms, how configure in config.yml? controller public function delete($id) { $profile = $this->profilerepository