Posts

Showing posts from August, 2012

How do I run a video in a Div? iOS/iPhone (Prevent Fullscreen) & Aviod apple's video loop glitch -

i’m developing ios app looping video embedded div. i’ve got “webkit-playsinline” working prevents apple’s fullscreen video player kicking in… there’s glitch. video begins first loop, reason forgets set play inline , goes fullscreen. here’s workaround in case frustrating else out there: <video class=“myvideo” width="640" height="360" autoplay webkit-playsinline> <source src=“video.mp4" type="video/mp4" /> </video> rather adding “loop” attribute video tag, use jquery’s .on function play video again when ends this: var myvideo = document.getelementsbyclassname('myvideo')[0]; $('.myvideo').on('ended',function(){ myvideo.play(); $('.myvideo').attr('webkit-playsinline', ''); }); i reminded video we’re playing inline incase gets funny ideas , tries run in full screen mode on replay… viola! problem solved ;)

javascript - Modify dojo chart x axis with real data -

question: how can build x axis dojo chart date column? i'm trying create custom addaxis() function x axis of dojo multiseries line chart. incoming json data stored in observable memory dstore, retrieved via xhr php script, , looks like: {"date":1415854800,"pressure1":23.2312,"pressure2":17,"pressure3":0,"pressure4":0}, {"date":1415913460,"pressure1":25.0123,"pressure2":17,"pressure3":0.015,"pressure4":0},... that "date" field unix epochal timestamp via mysql's unix_timestamp() on date column. doesn't have be, i've tried lot of recipes , that's latest one. my custom function looks like: var data = new memory({data:myjsondata}); ... labelfunc: function(n) { var d = dates.get(n).date; alert(d); } the "data" object far addseries concerned: addseries() can plot 4 pressures correctly. that's hard part. usually. dojo charts

exchange server - Get appointments for all rooms -

currently, can appointments 1 room, have many rooms, if want show appointments, performance bad, want ask if has method appointments multiple rooms 1 time? no there no operation that. can use getuseravailbility operation give freebusy status , subset of calendar property start,end,location,subject if request calendardetails see http://msdn.microsoft.com/en-us/library/office/hh532567%28v=exchg.80%29.aspx . there limitations around operation time window in 42 days , can retrieve max of 100 mailboxes per request. cheers glen

javascript - Multiple functions in Node.js -

i have 1 big multi-functional function: function trans() { var credentials = { clientid: 'turbofantrans', /* client id registered app */ clientsecret: 'gkqa2ru37dehafr4adh/sj94j5ge1s8ad7spp89mmis=' /* client secret registered app */ }; translator.detect(credentials, text, detectcb); function detectcb(err, from) { if (err) { sendmain('error', err); return; } translator.translate(credentials, text, from, lang, translatecb); } function translatecb(err, translated) { if (err) { sendmain('error', err); return; } console.log(text + lang + "=>" + translated); } } assume declared, since multifunctional, doing wrong when calling trans() here code snippet: case 'translate':

python - Check if word is inside of list of tuples -

i'm wondering how can efficiently check whether value inside given list of tuples. have list of: ("the", 1) ("check", 1) ("brown, 2) ("gary", 5) how can check whether given word inside list, ignoring second value of tuples? if word use if "the" in wordlist: #... but not work, there along line can do? if ("the", _) in wordlist: #... may use hash >>> word in dict(list_of_tuples)

javascript - Why does Ember Data think save() is failing when it’s not? -

i have ember model saving database. when call model.save().then(function () { alert('everything worked.'); }, function () { alert('save failed.'); }); the record persists database, network request api call saving responds status code of 200 , body of { "id": 11, "send_date": "2014-12-01t23:20:31.821z", "expiration_date": "2014-12-08t06:00:00.000z", "message": "what happening here", "url": null, "feature_id": null } and no errors appear in console. works perfectly, except rejection handler alert('save failed.') called every time. success handler never called. why? edit the reason passed fail handler error: column: 22 line: 11256 message: "undefined not object (evaluating 'factory.typekey')" sourceurl: "http://localhost:8080/bower_components/ember-data/ember-data.js" stack: "modelfor@http://localhost:8080

Xamarin : Authenticating Android application using Windows Authentication -

i have wcf service hosted asp.net web application user authenticated using windows authentication. trying write android application consume wcf service. any idea how application windows-authenticated able start consuming service? you won't able use windows integrated authentication (it's proprietary), could use either basic auth (transport-layer encryption/ssl highly recommended) or oauth combined owin.

Python: Making A Set of Dictionary Values -

i want create set values within existing dictionary passing function set being created in. as example: def function(dictionary): say dictionary looks this: {'1': 'monday', '2': 'tuesday', '3': 'monday'} what want set contains unique value elements of dictionary, this: {'monday', 'tuesday'} thoughts? that be: set(my_dict.values()) this work on both python3 , python2. method below more efficient on python 2: set(my_dict.itervalues())

add polyline array in polyline array in google maps android -

i want make multiple polyline in map. have 1 polyline in maps, want make new polyline again. line connect previous polyline. should do, code: package com.evy; import java.util.arraylist; import java.util.list; import org.json.jsonarray; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.googlemap.onmaplongclicklistener; import com.google.android.gms.maps.googlemap.onmarkerdraglistener; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.googlemap.onmapclicklistener; import com.google.android.gms.maps.model.bitmapdescriptorfactory; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.marker; import com.google.android.gms.maps.model.markeroptions; import com.google.android.gms.maps.model.polyline; import com.google.android.gms.maps.model.polylineoptions; import android.app.activity; import android.app.alertdialog; impor

php - Fatal error: Call to a member function execute() on a non-object PDO Working -

error message: fatal error: call member function execute() on non-object on line 30 lines 29 , 30 $stmt = $pdo->prepare("insert installs (customer_id, engineer_id, datetime, tracker, tracker_serial, tracker_sim, satnav, eco_plus, eco_plus_address, ttconnect, ttconnect_address, fms, remote_link, remote_link_address, remote_logbook, remote_logbook_address, registration, vehicle_make, vehicle_model, colour, mileage, box_location, comments, ip_address) values (:1,:2,:3,:4,:5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24)"); $stmt->execute(array("1" => $customer_id, "2" => $engineer_id, "3" => $date, "4" => $tracker, "5" => $tracker_serial, "6" => $tracker_sim, "7" => $satnav, "8" => $eco_plus, "9" => $eco_plus_address, "10" => $ttconnect, "11" => $ttconnect_serial, "12"

java - Is there any advantage to using Buffered Streams when dealing with files if you're reading large chunks of data at a time? -

if i'm dealing files, i'll wrap inputstream , outputstream in bufferedinputstream , bufferedoutputstream - minimize amount of file io operations possible improve performance. i believe considered practice , recommended. the standard 'stream copy' code uses when copying inputstream outputstream this: (assuming they're not using third party library , want remain compatible java 6) byte[] buffer = new byte[buffer_size]; (int n = 0; (n = input.read(buffer)) != eof; ) { output.write(buffer, 0, n); } what got me thinking is, set buffer_size 8192 (the default size of buffers in bufferedinputstream , bufferedoutputstream ). my question is, still benefical use bufferedinputstream , bufferedoutputstream ? i'm not entirely sure how these classes work under hood, , don't know if there advantage using them in situation. thanks. in general no, if you're using buffer size isn't power of 2 there might benefit in having reads

mysql - Php + sql statement always returns successfull? -

this code <?php include("global.php"); $username = mysql_real_escape_string(stripslashes($_post["strusername"])); $password = md5(mysql_real_escape_string(stripslashes($_post["strpassword"]))); $charid = mysql_real_escape_string(stripslashes($_post["charid"])); $quest = mysql_real_escape_string(stripslashes($_post["strquest"])); $query = "select * wherei_users, wherei_characters wherei_users.username = '{$username}' , wherei_users.password = '{$password}' , wherei_characters.username = '{$username}' , wherei_characters.id = '{$charid}'"; $result = mysql_query($query); $yesorno = (mysql_num_rows($result) == 0) ? 'no' : 'yes'; if(empty($username) || empty($password) || empty($charid) || empty($quest) || $yesorno == "no") { $status="error"; $msg="invaliddata"; $actiontype="&actiontype=savequestdata"; $out=("$actiont

Excel VBA For Loop and Nested IF statements for Counter -

i have value in cell should match filename of document in directory. sheet3 column a1 = c:\users\admin\desktop\folder1 sheet3 column a2 = test.xls ‘location of directory scurrentxldirectory = worksheets("sheet3").cells(1, 1).value set currentxlfso = createobject("scripting.filesystemobject") proceednow = true set currentxlfolder = currentxlfso.getfolder(scurrentxldirectory) set currentxlfiles = currentxlfolder.files ‘always 10 files in folder if currentxlfiles.count <> 10 msgbox "wrong directory or folder mismatch" proceednow = false else 'return 1 indentical filename dim namecount integer namecount = 0 each folderidx in currentxlfiles ‘compare file names specified cell value if folderidx.name = worksheets("sheet3").cells(1, 2).value namecount = namecount + 1 if namecount <> 1 msgbox "unable find file” proceednow = false end if end if next end if for reaso

java - CriteriaBuilder in JPA - where clause -

am new jpa. building select query clause. need select table contacts contactname's equals value of string name. used code below create db table: create table contacts ( contactid bigint unsigned not null primary key auto_increment, contactname varchar(100) not null, contactemailid varchar(100) not null, username varchar(100) not null, index contact_names (contactname) ) engine = innodb; following entity class; @entity private string username; @id @generatedvalue(strategy = generationtype.identity) @column(name = "contactid") public long getcontactid() { return contactid; } public void setcontactid(long contactid) { contactid = contactid; } @basic @column(name = "username") public string getusername() { return username; } public void setusername(string username) { this.username = username; } following contactservlet class code trying write criteriabuilder

javascript - How to convert an array of UTC dates into milliseconds using JS/Jquery -

i'm having array of dates: var ticks = []; ticks = [tue jan 01 2013 00:00:00 gmt-0800 (pst), fri feb 01 2013 00:00:00 gmt-0800 (pst), fri mar 01 2013 00:00:00 gmt-0800 (pst), mon apr 01 2013 00:00:00 gmt-0700 (pdt), wed may 01 2013 00:00:00 gmt-0700 (pdt), sat jun 01 2013 00:00:00 gmt-0700 (pdt), mon jul 01 2013 00:00:00 gmt-0700 (pdt), thu aug 01 2013 00:00:00 gmt-0700 (pdt), sun sep 01 2013 00:00:00 gmt-0700 (pdt)]. how can convert above array of dates millisecond format: below: [1390000000000, 1395000000000, 1400000000000, 1405000000000, 1410000000000, 1415000000000] (ps: need format have function takes format display x-axis) any ideas on how can achieved? thanks!!!! you map new array date objects: ticks.map(function ( value ) { return value.gettime(); });

maven - Convert a batch of jrxml files into jasper files? -

how create maven target convert batch of jrxml files jasper files in same folder? folder path can input argument of command? you have specify configuration below <build> <pluginmanagement> <plugins> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>jasperreports-maven-plugin</artifactid> <version>1.0-beta-2</version> <configuration> <sourcedirectory>src/main/resources/reports</sourcedirectory> <outputdirectory>src/main/resources/reports</outputdirectory> </configuration> <!-- here --> <executions> <!-- need wait until after java classes have been compiled compile reports -->

Setting alpha of colorbar in MATLAB R2014b -

Image
i have colorplot (from imagesc) alpha map. i'd colorbar reflect alpha (notice in image below colormaps same). found solutions online none seem work in r2014b. code here: subplot(2,1,1) = imagesc(meshgrid(0:10,0:5)); alpha(a,1) colorbar subplot(2,1,2) b = imagesc(meshgrid(0:10,0:5)); alpha(b,.7) colorbar james in pre-r2014b matlab, colorbar axis containing image can set alpha: hb = findobj(gcf,'type','axes','tag','colorbar'); hi = findobj(hb,'type','image'); alpha(hi,0.7) instead of gcf , use handles of individual subplots. or save handle when make it: hb = colorbar; from r2014b on, colorbar creating using new handle graphics system, there no longer child image modify. colorbar created internally colorbarhgusingmatlabclasses , obfuscated .p file, it's no clear how it's constructed.

sql server - How to extract cross databases references using scriptdom API -

microsoft has exposed scriptdom api parse , generate tsql. i'm new , still playing it. want know how cross databases references queries one. update t3 set description = 'abc' database1.dbo.table1 t1 inner join database2.dbo.table2 t2 on (t1.id = t2.t1_id) left outer join database3.dbo.table3 t3 on (t3.id = t2.t3_id) inner join database2.dbo.table4 t4 on (t4.id = t2.t4_id) what want list of references: database1.dbo.table1.id = database2.dbo.table2.t1_id database3.dbo.table3.id = database2.dbo.table2.t3_id database2.dbo.table4.id = database2.dbo.table2.t4_id however, last entry database2.dbo.table4.id = database2.dbo.table2.t4_id , both of columns 2 ends same database database2 , not want. final required result is: database1.dbo.table1.id = database2.dbo.table2.t1_id database3.dbo.table3.id = database2.dbo.table2.t3_id is possible implemented scriptdom ? a robust implementation not

css - Polymer Nested Core-Scaffold and Multiple Vertical Scrollbars / Scrolling Extent Issues -

i'm having trouble current layout of polymer site, regards nested components , associated scrollbars. i'll preface stating absolutely no means css guru. wish because wouldn't struggling as am. feel free jump straight jsbin url issue may become apparent. the situation: have nested core-scaffold element, main content requires vertical scrolling , it's vertical scrollbar becomes active required. however, nested, it's container(s) can have scrollbars enabled. ideally, i'd single scrollbar on highest level element can scroll scaffold's content it's full vertical extents, yet cause topbar slide away when scrolling down. i've noticed height of scaffold's main content determined first page loaded it. subsequent page loads different heights not cause scrollbar height extents change accordingly. please note i've inserted iframe loading external content scaffold's content section purpose of jsbin demo. actual site loads bunch of dat

asp.net mvc 5 - MVC 5 security measures -

i developing mvc 5 internet application , have questions in relation security. what security measures need manually implement ensure internet application secure? this have far: [validateantiforgerytoken] attributes on each httppost function sanitizer.getsafehtml function on model attribute has html data identity 2.1 authentication , authorization thanks in advance. update the application simple mvc internet application web service hosted on azure. using entity framework 6, web api 2.0 , mvc 5. relevant information can give you? that cover xsrf , stored xss . should check for: dom xss in javascript (when modifying dom using data query string example). json hijacking code injection (sql injection if using sql db example) enforce https login (both login form , login post) ... etc ... the common vulnerabilities not technical bugs, example should: reduce data trust client. example, if have shopping cart, may idea put price hidden field in buying

hibernate - spring data jpa select query for super class field -

i have super class(which not @entity or @mappedsuperclass ) , sub-class entty class like: class { @elementcollection protected collection<someentity> someentities; // getter , setter } and @entity class b extends { private string name; //getter , setter } i have written custom query select name , someentities like: @query ("select b.name, b.someentities b b") it throws exception in runtime saying unrecognized field someentities. any solution did mistakes? if super class not @entity or @mappedsuperclass (any reason this?), field declared in not persistent, not known hibernate, , can not used in queries. if provide use case, providing alternative.

verilog - The counter counts strangly -

my code describes fsm control traffic light. there 4 states, each different duration. whenever counter equals 1, counter needs 1 more clock change next value. example, @ state1, counter programmed count 4 1. every value should take 1 clock change next, when does, state changed next state. when counter equals 1, takes 2 clocks change. my program follows. counter implemented @ bottom of block: module hw3(times,a,b,clk,rst,ihand,ichang,s1); input clk,rst; output reg [2:0]a,b; wire oclk;//new freq reg [2:0] count1,count2,count3,count4;//count times reg [2:0]times; reg temp;//control switch parameter [2:0]state1=3'd0,state2=3'd1,state3=3'd2,state4=3'd3; always@(posedge clk or negedge rst ) begin if(!rst) begin s1<=state1; a<=3'b0; b<=3'b0; count1<=3'd4; count2<=3'd2;

permissions - Set uid on directories -

i used chmod 4755 directory. then, when executed "ls", showed drwsr-xr-x. i, however, reset permission 0755 , kept showing drwsr-xr-x. not think "s" affects anything, weird. how can rid of "s"? or shouldn't care it? my os ubuntu 14.04. setting uid file or directory giving other users can access directory or file owner of file or directory. not make effect. other owner can access that.

python - How to put key,value pair in dictionary in position based on sorted keys? -

i map in c++. know normal python dict dont support order. found ordereddict in collections. not work expected. >>> odict = ordereddict() >>> odict['z'] = '1' >>> odict['a'] = '2' >>> odict['y'] = '3' >>> print(odict) ordereddict([('z', '1'), ('a', '2'), ('y', '3')]) but have order, this: ordereddict([('a', '2'), ('y', '3'), ('z', '1')]) collections.ordereddict remembers item insertion order. you're looking sorteddict part of blist third party package ... the alternative sort keys before pack them ordereddict , things become un-sorted if need add more items ...

Prolog if-elseif-else -

as question says, thats kind of wanna simulate in prolog. i'm making game,here's code: move(x):- get_char(y) get_char(_), get_char(z), not(oldloc='z'), not(newloc = 'z'), validmove(oldloc,newloc). move(_):- write('thanks playing!'), nl. move(x):- write('invalid move!'), nl, write('try again?'), nl, move(x). what want if first predicate check fails @ not(oldloc='z'),not(newloc = 'z'), go next predicate move(_) , fails @ validmove(oldloc,newloc) go next move(x). i'm new prolog , i'm clueless. if-then-else: http://www.swi-prolog.org/pldoc/doc_for?object=send_arrow/2 another if-then-else: http://www.swi-prolog.org/pldoc/doc_for?object= (*-%3e)/2 sample #1: ?- test = test -> print('truth') ; print('false'). truth sample #2: ?- test = test -> (test2 = test3 -> print('truth'); print('false2')); print('false

Routing - Ng -hide , Ng-show AngularJS -

i have base html file dashboard. in dashboard have included header html file menu. .a content tml file. footer html file using ng-include. want click on menu on header html file. after click content html should hide , new html page called equity should take place. how achieve on clicking menu. me out . new angularjs you use ngroute achieve this. instead of ng-include, use ng-view content. define initial content , equity pages separately in $routeprovider . on clicking link, go equity page using href.

java - Process JSONObject to get the items -

this code: jsonobject jsonobj= jsonobject.fromstring(request.getparameter("parameter")); system.out.println(jsonobj.getstring("dlist")); gave me string: ["abc","cgr","drr"] how process values? tried getting jsonarray like, jsonarray arr= jsonobj.getjsonarray("dlist"); but showing following error. jsonobject["dlist"] not jsonarray. here raw data: {"sort":null, "filterfunction":null, "source":["abc","cgr","drr"], "length":3, "source":["abc","cgr","drr"], "length":3}} i passing dlist json.encode(dlist.source) flex . to jsonobject in json array jsonobject object = jsonarray.getjsonobject(index); values json object json values should key , value pair format jsonobject myjson = new jsonobject(myjsonstring); string name = myjson.get("name&qu

unable to Print custom Listview data in android -

public class setting extends activity implements onclicklistener { listview listview1; imageview backbutton; arraylist<notify> web = new arraylist<notify>(); list<string> places = arrays.aslist("item1", "item2", "item3", "bing", "itunes", "wordpress", "drupal", "item1", "item2", "item3", "bing", "itunes", "wordpress", "drupal", "item1", "item2", "item3", "bing", "itunes", "wordpress", "drupal"); @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); setcontentview(r.layout.setting); listview1 = (listview) findviewbyid(r.id.listview1

java - Ocaml learning resources -

we thinking of using functional languages in our projects. i'm trying collect points on functional language can start with(we java developers). thinking of using ocaml. tried learning website ocaml.org . i've following questions use ocaml @ workplace. does ocaml reduce lines of code compared java? what editors use ? i have see there many ocaml library implementations- batteries,core etc.in beginning can batteries suffice? do use ocaml core (by jane street)? how different compared standard one? in beginning, planing use ocaml in small amount,possibly in house project. at vector fabrics, using ocaml extensively. having recognised advantages functional programming bring our engineering activities (we constructing software tools analysing c , c++ programs), considered both haskell , ocaml languages use. in end, decided go ocaml, because execution model simpler (eager evaluation vs. haskell's lazy evaluation) , therefore reasoning behaviour of program

php - 3D Texture mapping for sofa Simulator -

this sample applicacion sofa simulator different fabrics can applied on sofa body. http://www.fama.es/virtual-simulator.html - test : click "go virtual simulator" - choose sofa model - apply fabric sofa how kind of applicaction done? kind of technology should used used on web application? thanks

jquery - How to Reset the value for the enum radio button? -

i have written script function reset controls of page using jquery. got enum public enum enumcurrencytype { [description("home currency")] homecurrency=1, [description("foreign currency")] foreigncurrency = 2, } and cshtml page, <div class="col-md-4 fnt-sz-1"> <label for="" class="control-label"> <b>currency type <font color="red">*</font></b></label><br /> <div class="radio col-md-4"> @html.enumradiobuttonfor(m => m.enumcurrencytype, false).disableif(() => model.isreadonly == true) </div> </div> and reset button , function following <input id="clickme" class="btn btn-default" type="button" value="reset" onclick="clearinput();" /> function cle

jsp - Upgrading from Aem 5.6 to AEM 6 -

we have of our apps developed aem5.6. apps working fine on aem5.6. using jsp view. however, when deploy these same apps on aem6.0, stops working. there's no error in logs while deploying app aem6. but, when open of pages, pages blank. have used custom taglibs in our application. need make changes in jsp make work on aem 6.0? there absolutely no errors in logs after deployment. did have @ bundle list , checked, if there unmet dependencies bundle or other bundle?

android - Different behaviour from button images -

Image
following previous question, fitting 3 buttons , background image in android , have wanted, there minor issue don't understand. there 3 buttons,each button image, 3 images have same size, shown differently. image 2 starts @ left border, images 1 , 3 have margin @ left side. from xml file, don't see reason that: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:weightsum="4" > <imageview android:id="@+id/imageview01" android:layout_width="match_parent" android:layout_height="5dp" android:layout_weight="0.5" android:scaletype="fitxy" android:src="@drawable/sector1" /> <button

android - Alarm manager Not triggering with correct time -

i know common thread in didn't find answer question . want trigger dynamic broadcast receiver @ particular time. using below code public void method1() { br = new broadcastreceiver() { @override public void onreceive(context c, intent i) { dotask(); } }; registerreceiver(br, new intentfilter("com.xxxx.wakeup")); pi = pendingintent.getbroadcast(this, 0, new intent("com.xxxx.wakeup"), 0); = (alarmmanager) (this.getsystemservice(context.alarm_service)); setalarmmanagerobject(); } and setalarmmanagerobject() method here public void setalarmmanagerobject() { calendar cal = calendar.getinstance(); int year = cal.get(calendar.year); int month = cal.get(calendar.month); int day = cal.get(calendar.day_of_month); cal.set(year, month, day , com.xxxx.constants.alarmhour , com.xxxx.constants.alarmminute , com.xxxx.alarmsecond); am

sql - Which Select query will run faster -

this question has answer here: sql performance max() 4 answers hi trying maximum id table has approx 1 million records. please suggest me on of these query execute faster. option 1: select top 1 surveyuserresponseid surveyuserresponse order surveyuserresponseid desc option 2: select max(surveyuserresponseid) surveyuserresponse as per actual execution plan both query took same time execute. you can try yourself. run query time statistics. so: set statistics time on; select top 1 surveyuserresponseid surveyuserresponse order surveyuserresponseid desc set statistics time off; and see on "messages" tab how long took execute each query.

java - How to work with overrided methods -

how can override method superclass in java , how constructor also? , how can call method or constructor of superclass? to override method in java, need define new method in sub class same name , same types of parameters. before defining should write annotation @override . access method in superclass, should write that: super.methodname(params..); to call super class constructor write: super(params..);

css - Display data from database without being effected by html tags -

in database there html tags , such as hello <br/> world and use following code in view display data: <span> @table.text </span> but problem data displayed break line , displayed hello world and same problem happen other html tags such <a> tag or <img> tag . in other words, want display data database without change. how can solve problem ? try this: @html.raw("hello <br/> world".replace("<br/>",""))

c# - How to get char of KeyEventArgs? -

i have listview show users. i want search keydown. <i:eventtrigger eventname="keydown" > <cmd:eventtocommand command="{binding searchcommand}" passeventargstocommand="true" /> </i:eventtrigger> and in viewmodel new relaycommand<keyeventargs>(e => { e.key }); i use persian language , pree 'س', e.key have 's' how persian char serach in listview?

java - What is the difference between Thread.join and Synchronised? -

i confused when use thread.join() , when use synchronization in multi threading application. according me, both of them block or wait execution done other thread. example has output 10 a's , 10 b's & 10 c's in sequential pattern 1 after other : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : 9 : 10 : 1 : b 2 : b 3 : b 4 : b 5 : b 6 : b 7 : b 8 : b 9 : b 10 : b 1 : c 2 : c 3 : c 4 : c 5 : c 6 : c 7 : c 8 : c 9 : c 10 : c ----program ends---- example starts here class synctest extends thread { stringbuffer sb; public synctest(stringbuffer sb) { this.sb = sb; } public void run() { synchronized(sb) { for(int i=1;i<=10;i++){ system.out.println(i+" : "+sb.charat(0)); } sb.setcharat(0, (char) (sb.charat(0)+1)); } } public static void main(string [] args) throws interruptedexception { stringbuffer sb =

arguments.callee in scala.js -

i porting javascript function scala.js: once: function (el, type, callback) { var typearray = type.split(' '); (var = typearray.length - 1; >= 0; i--) { el.addeventlistener(typearray[i], function(e) { e.target.removeeventlistener(e.type, arguments.callee); return callback(e); }); }; }, here attempt @ writing scala code: def once(element: topnode, tpe: string, callback: function1[event,any]): unit = { tpe.split(" ").foreach(item => element.addeventlistener(item, (e : event) => { e.target.removeeventlistener(e.`type`, ?) // <-- put here? callback(e) })) } how can reference lambda in place holder? scala.js not have equivalent of arguments.callee of javascript. more generally, not have equivalent of arguments . lambda cannot read reference itself, unless given via captured environment. can achieved storing lambda in val in once method. ideally, 1 write this: def once(element: topnode, tpe: string,

css applying slowly with google app engine -

whenever update webpage google app engine, html works fine css files don't applied right away. , makes me deploy several times. have cache? or else? my app.yaml version: 1 runtime: python27 api_version: 1 threadsafe: yes handlers: - url: /static static_dir: application/static - url: .* script: application.app libraries: - name: jinja2 version: "2.6" - name: markupsafe version: "0.15" hope me thx in advance! sounds cache issue. performance google cache static files on front-end servers , in addition browser may caching them depending on cache headers set. as andrei mentioned can debug things using browser developer tools better understanding of happening. it's desired behaviour (for performance) if both google , browser caches static files .css extended periods - while possible explicitly set short expires headers it's not want doing. a simple reliable solution in experience use different name css file each time dep

c# - How do you Unit TEst code which uses String.IsNullOrEmpty? -

do write 2 unit tests? 1 value being null , 1 value being string.empty? similar string.isnullorwhitespace()? typically i'd use nunit test cases test these permutations. they'll give coverage of 3 different checks without duplicating test code. for example: [testcase("")] [testcase(null)] public class sometest(string stringvalue) { assert.throws<argumentexception>(()=> checkifnullorempty(stringvalue)); } public void checkifnullorempty(string val) { if(string.isnullorempty(val)) { throw new argumentexception(); } }

user interface - How is this android UI element created -

i design of screen - can suggest how doing label/text part has time in - square type element rounded corners: http://40.media.tumblr.com/bba2d04346d2d491b75a86f41bcf46fb/tumblr_ndaew2owqv1r2wjwko3_1280.png http://41.media.tumblr.com/b737ee9a30581c5843d85c43617685bf/tumblr_ndaew2owqv1r2wjwko4_1280.png i try , similar, thx i think looking layout this.change orientation , colors need , add elements need in each layout.you can see original view after run in emulator or device only,so after creating run layout. layout: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="200dp" android:orientation="vertical" android:weightsum="3" android:layout_margin="50dp" > <linearlayout android:layout_width="fill_parent" android:layout_height="0dp" android:layo

upload - Servlet for (large) files chunked uploading -

i trying implement (jetty-based) servlet supporting uploading of (large) files web client, little javascript splits user-selected file chunks, , sends these chunks server using several posts appropriate content-range headers (the rationale of technique able track progress, pause , resume upload). i have come httpservlet overriding dopost() method, handles content-range header - i.e. writes payload @ specified location file on server. is there better/recommended way support (large) file upload in servlet? there set of classes in jetty that? thanks in advance

Programatically change HubSection Windows Phone -

is possible change hubsection if moved finger per code? e.g. have 3 hubsections, click button in hubsection3 , changes hubsection1. if assign both hub , sections names, in code-behind can this: private void button_click(object sender, routedeventargs e) { myhub.scrolltosection(hubsection1); } however ui perspective, wouldn't drive navigation button in way. generally, purpose of hub display content in similar style of magazine, allowing user flick through content @ discretion.

c# - On searching documents in mongodb collection using ISODate range, I get the error "String was not recognized as a valid DateTime" -

i trying query mongodb using following - list<bsondocument> list = nosqlbusinessentitybase.loadbywhereclause("peoplecounting", string.concat("{siteid:\"", siteid, "\", locationid:\"", location._id ,"\", starttime: {$gte:isodate(\"",old.tostring("yyyy-mm-dd hh:mm:ss"),"\")}, endtime: {$lte:isodate(\"",current.tostring("yyyy-mm-dd hh:mm:ss"), "\"\")}}")); the loadbywhereclause() function follows - public static list<bsondocument> loaddatabywhere(string table, string whereclause) { var collection = db.getcollection(table); querydocument wheredoc = new querydocument(bsondocument.parse(whereclause)); var resultset = collection.find(wheredoc); list<bsondocument> docs = resultset.tolist(); if (resultset.count() > 0) { foreach (bsondocument doc in docs) { doc.set("_id&qu

Indy FTP Client OnStatus not getting Disconnect events -

i have setup indy idftp client filezilla ftp server.the client tries connect on startup of app and, if fails, keeps retrying every few seconds lifetime of app. in addition, need detect if lose connection and, again, keep trying re-establish connection. having problem. have added onstatus event handler seems fire event types except hsdisconnecting , hsdisconnected. have ondisconnected event handler fires when have locked server, in case, when try connect, fires onconnected fires ondisconnected. however, if set server not active after initial successful connection, server tells me has disconnected me not event in code don't know need start trying connect again? wrong in expecting these events in scenario, there else should listening for? thank in advance help.