Posts

Showing posts from March, 2010

iphone - Upload with Buffer iOS 7 -

i trying implement upload random data , measure speed. generating random nsdata this: void * bytes = malloc(""); nsdata * mydata = [nsdata datawithbytes:bytes length:"bytes"]; free("bytes"); but there memory problems if want upload big file... my upload process this: nsurlsessionconfiguration *sessionconfig = [nsurlsessionconfiguration defaultsessionconfiguration]; nsurlsession *session = [nsurlsession sessionwithconfiguration:sessionconfig delegate:self delegatequeue:nil]; nsurl * urll = [nsurl urlwithstring:upload_server]; nsmutableurlrequest * urlrequest = [nsmutableurlrequest requestwithurl:urll]; [urlrequest sethttpmethod:@"post"]; [urlrequest addvalue:@"keep-alive" forhttpheaderfield:@"connection"]; nsstring *boundary = @"*****"; nsstring *contenttype = [nsstring stringwithformat:@"multipart/form-data; boundary=%@",boundary]; [urlre...

c# - News/message replay at specific times -

i have list objects. each newsitem has 2 properties: string headline { get; set; } datetime postedon { get; set; } i'm trying write "replay" code retrieves yesterday's news items db , publishes each 1 of them @ exact (or exact) time posted, , display them live feed in wpf app. i understand scheduling posts done system.threaing.timer. e.g. find next post postedon.time > datetime.now.time, schedule timer, , in timer_elapsed method raise posted event of sort. however i'm wondering if there more "modern" way of doing in c#, e.g. tasks or reactive extensions / observables. i've noticed there observable.replay method can't seem find examples. not sure if it's applicable in case. any appreciated. check out quartz.net open sourced c# scheduler library. check out quick start . @ end in public class hellojob, can replace object publish/display them live feed in wpf app.

scala - Requests / Responses DTO objects in Play -

i have simple question. in java code, used use data transfer objects requests / responses. for example, in spring webapp creating request dto, public class saveofficerequest { private string officename; private string officephone; private string officeaddress; /* getters / setters */ } after had controller "mapped" method like @responsebody public saveofficeresponse saveoffice(@requestbody saveofficerequest) { ... } . every request json request. when controller method called converted request dto domain dto entities , business logic. so! should save practice in new scala project based on play framework? case classes can used represent request , response objects. helps make api explicit, documented , type-safe, , isolate concerns, avoiding use domain objects directly in external interface. for example, json endpoint, controller action use pattern this: request.body.asjson.map { body => body.asopt[customerinsertrequest] m...

How to implement preload youtube video feature in android app? -

i using youtube api android add play youtube videos within app , buffers , play. i trying find method in api can allow preload video , play continuously gone through complete documentation didn't found method. is there method missed or workaround me in implementing same or it's against youtube's policy. i mean native android app provides same feature, why it's not allowing other apps ? yes, can use youtubeandroidplayerapi this. can refer following link example of this. https://developers.google.com/youtube/android/player/downloads/ or http://android-er.blogspot.in/2013/06/simple-example-using-youtube-android.html

python - Beautiful soup extracting specific columns -

slowly learning python , beautifulsoupbut been stumped this. i trying extract 1st , 4th columns of data following layout (reduced in size) http://pastebin.com/btruubrn the file stored locally , @ present have patchwork of code other similar issues cannot work for row in soup.find('table')[0]body.findall('tr'): first_column = row.findall('td')[0].contents third_column = row.findall('td')[3].contents print (first_column, third_column) there multiple things wrong code. line: soup.find('table')[0]body.findall('tr'): makes no sense. when use find returns single bs object. can not access elements index on single object. , wherever use findall , returns list of bs objects. means have loop on individual elements. reason body of loop won't work expected. below code gets want: from bs4 import beautifulsoup html_file = open('html_file') soup = beautifulsoup(html_file) table = soup.findall('table')[0]...

perl - Perl5: returning several arrays/hashes from a sub -

i wanna return several arrays , hashes sub. when execute sub, first output array wraps outputs toguether , others keep empty. pls see example: the main file script.pl has: use mymodule; (@o1, $o2)=mymodule::mysub; print "o1 gives ".$o1[0]." ".$o1[1]." ".$o1[2]; print ", , o2 gives ".$o2." \n"; file mymodule.pm looks like: package mymodule; sub mysub{ @a = ('a', 'b'); $b = 4; return (@a, $b); }; 1; running script.pl return o1 gives b 4, , o2 gives . as see, correspondence of (@o1, $o2) values (@a, $b) returned module not preserved. can me here? thx lot! thx explanation. cannot obtain aimed result thru suggestion. code: my ($o1_ref, $o2)=mysub; @o1 = @{$o1_ref}; print "o1 has ".$#o1." elements, o2 has ".$#o2." elements\n"; print "the first element of o1 ".$o1->[0]."\n"; sub mysub{ @a = ('a', 'b'); $b = 4; ...

testing - Test methodology for Hand gesture recognition application in Kinect -

i developing immersive image navigation project in kinect, uses hands-free gestures. have decided upon set of gestures, shall use in project. i working on algorithms. want know general methodology testing various components of such kinect related projects. how must design test suite, fields? how must different gesture recognition algorithms tested? optimum number of tests establish data worth presenting? how many participants must involved? , set of data must collected required coverage of test information? with kinect sdk can record gestures , replay them verify code can detect them. doing gestion recognition hard, though - try record different people doing different gestures , see if code can recognize them all. most of time machine learning involved in creating such recognizers - machine learning working need record many many people training recognizer - advise against , reuse gestures offered kinect sdk (grip, release example) unless know doing.

Java JScrollBar getValue Formatting -

when do: system.out.println(scrollbar.getvalue()); what value formatted in? pixels, percent? the returned value number of pixels, if java api doesn't precise it. amount of pixels "scrolled".

javascript - ng-repeat don't show last piece of text -

i have list of answers separate comma, not want last comma show - how can using ng-repeat , !$last? html have far (which not showing entire last answer): <h3 ng-repeat="answer in correctanswers" ng-show="!$last"> {{answer + "," + " " }} </h3> i recommend not using separate span , toggling visibility, use closer have attempted: <h3 ng-repeat="answer in correctanswers"> {{answer + ($last ? '' : ',')}} </h3> no directives processed, simple boolean logic w/ concatenation of string

android service to show push notification on launch of an application -

i want start service run @ background time , when user launches application should show push notification name of application. how can this? push notification pushing server, have create notification in client side.

javascript - Unable to get the RegisterClientScriptBlock() method to work when passing "true" as last Boolean parameter -

here 3 versions tried include scripts in page: page.clientscript.registerclientscriptblock(this.gettype(), "jquerytestfile1", "<script type=\"text/javascript\" src=\"jquerytest1.js\"></script>", false); page.clientscript.registerclientscriptinclude(this.gettype(), "jquerytestfile2", "jquery-1.11.0.min.js"); page.clientscript.registerclientscriptblock(this.gettype(), "jquerytestfile3", "src=\"jquerytest3.js\"", true); the first 2 versions working fine . 3rd 1 "true" last parameter rendering <![cdata[ in source code , can't work. why rendering cdata ? purpose serves in context? how can third version working without removing "true" parameter ? below html code rendered in browser:: <form method="post" action="scriptsmanager.aspx" id="form1"> <script type="text/javascript" src=...

Can We delete own parent coming from jquery in html -

i want remove own block on clicking of cross... not removing , nothing showing in error. please ..... <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <style type="text/css"> *{ margin:0; padding:0; box-sizing:border-box; } .inputfilewrap{ width:230px; position:relative; margin:10px 0; } .inputfilewrap i{ position:absolute; right:0; top:0; cursor:pointer; } </style> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(e) { var upload_element= '<div class="inputfilewrap"><input type=...

canvas - drawing complex stroke (border) in KineticJS -

i have kineticjs image. i want draw border around image. to that, using stroke . var x = new kinetic.image({ image: img, stroke: 'red', strokewidth: 5 } 1- have border rounded corners ? here jsbin 2- give border transparency gradually increases interior exterior (let say, opacity=0.9 opacity=0.3, linear decrease) can achieve these stroke or need drawing line etc. , create group image? 1) can draw transparent kinetic.rect stroke , rounded corner image. var rect = new kinetic.rect({ x : image.x(), y : image.y(), width :image.width(), height : image.height(), stroke : 'blue', storkewidth : 5, cornerradius : 10 }); demo 2) there no easy way this. if wil draw stroke manually kinetic.line objects.

tfs2010 - How to retrieve TestRunId by build number using TFS api? -

we need run tests , publish results in custom continousintegration environment. mstest used testing, use commandline execution of tfs build. after executing tests/build using tfsbuild.exe, buildnumber , updatedbuildnumber. c:\program files (x86)\microsoft visual studio 10.0\vc>tfsbuild start "tfsurl" "teamprojectname" "builddefinitionname" microsoft (r) tfsbuild version 10.0.0.0 microsoft visual studio v10.0 copyright (c) microsoft corporation. rights reserved. build number: 36399 updated build number: xyz_20140405.1 succeeded i use updatedbuildnumber query tfs , builduri. uri tfsuri = new uri("tfsurl"); tfsteamprojectcollection _tfs = new tfsteamprojectcollection(tfsuri); ibuildserver tfsbuildserver = _tfs.getservice<ibuildserver>(); ibuilddefinitionspec buildspec = tfsbuildserver.createbuilddefinitionspec("teamprojectname"); ibuilddetail bui...

javascript - jquery get value of input -

my php code <input style="text-align: center;" id="<?php echo $this->get_field_id("nums"); ?>" name="<?php echo $this->get_field_name("nums"); ?>" type="text" value="<?php echo absint($instance["nums"]); ?>" size='3' /> and jquery : $(document).ready(function(){ $('.div1').slick({ slidestoshow: 3, slidestoscroll: 1, }); }); how value: slidestoshow = $instance["nums"] thanks declare variable global , can accessed across files(in case php , js on different pages) $globals['a'] = absint($instance["nums"]); $(document).ready(function(){ $('.div1').slick({ slidestoshow: <?php echo $globals['a'];?> slidestoscroll: 1, }); });

html - Overflow-x : scroll works but items not aligned -

i have fixed div , inside of x-scrollable div contains many items. code : <div class="gallery-items" style="position: fixed"> <div class="scrollable"> <div class='gallery-items-item'>....</div> <div class='gallery-items-item'>....</div> <div class='gallery-items-item'>....</div> <div class='gallery-items-item'>....</div> <div class='gallery-items-item'>....</div> <div class='gallery-items-item'>....</div> <div class='gallery-items-item'>....</div> </div> </div> .gallery-items { position: fixed; ..... } .scrollable { overflow-x: scroll; overflow-y: hidden; width: 100%; height: 100%; white-space: nowrap; } .gallery-items-item { height: 130px; width: 150px; cursor: pointer; p...

customization - Wordpress: using "season" tag in permalink for a rugby club site -

i'm not expert in wordpress, apologize if question trivial or obvious. i run local rugby club's website wordpress, , i'm fixing permalinks. i'd achive permalink form myclub.com/2013-14/myposttitle , fit our need, better myclub.com/2013/myposttitle in other words, want add concept of season custom permalink tag, able define rule /%season%/%postname% is possible? although seems useful customization clubs, haven't found reference on web. thanks try simple solution: add post category "2013-14" , set custom premalinks /%category%/%postname%/

jquery - How to right align columns of DataTable in R Shiny? -

from this post gather should define alignright css class desired alignment: # ui.r sidebarlayout(..., mainpanel( tags$head( tags$style(".alignright { align: right; }", media = "all", type = "text/css") ), ... # content call datatableoutput("mytable") ) ) and when creating datatable, use aocolumndefs option set class of desired columns alignright : # server.r shinyserver( function(input, output) {... output$mytable <- renderdatatable(..., options = list( aocolumndefs = '[{"atargets": [7, 9, 10], "sclass": "alignright"}]' ) ) } ) however, has had no effect on datatable, when remains left aligned columns. thought simple alignment issue easy sort out, after many hours, apparently not so. ideas appreciated. this: library(shiny) runapp(list( ui = basicpage( tags$head(ta...

css - Twitter bootstrap carousel with pictures that are not uniform -

let me start sorry long post. i'm attempting use bootstrap carousel , unfortunately pictures have been given not uniform. example 100x200, doe 150x100, etc. aspect ratios different, letter vs landscape. ive attempted number of things, including using following helper function on load of each of images in carousel: function scaleimage(srcwidth, srcheight, targetwidth, targetheight, fletterbox) { var result = { width: 0, height: 0, fscaletotargetwidth: true }; if ((srcwidth <= 0) || (srcheight <= 0) || (targetwidth <= 0) || (targetheight <= 0)) { return result; } // scale target width var scalex1 = targetwidth; var scaley1 = (srcheight * targetwidth) / srcwidth; // scale target height var scalex2 = (srcwidth * targetheight) / srcheight; var scaley2 = targetheight; // figure out 1 should use var fscaleonwidth = (scalex2 > targetwidth); if (fscaleonwidth) { fscaleonwidth = fletterbox; } ...

standards - Why do not all CSS rules work in HTML emails? -

why can't html emails support normal positioning , html tags. is there specific reason simple css rules float , background-image not work ? can't imagine these present security issues don't have in normal emails? i answers based on reliable sources/ references , explain fundamentals of behaviour within email clients. why html emails not following normal web standards when comes html , css. some general info on html emails: how html email works rock solid html emails here's nice article gives tips concerning html emails: the do's , don'ts of html email my own interpretation of css problem following: html markup language, means email program needs html parser read it. also, know, not browsers use same rendering engine or rendering rules. browsers, same html parsers: each parser differ little bit. and reason why float doesn't work, because implemented html parsers email clients use, not 'good' in interpretat...

Facebook debug token without using any SDK, just a HTTP GET request -

instead of using facebook sdk, i'm using http requests. here url i'm using log user application: (not real id or url) https://www.facebook.com/dialog/oauth? client_id=6545941f68498461 &redirect_uri=https://script.google.com/macros/s/hcz-irojhm/exec? &response_type=token &scope=publish_stream the documentation here. official facebook login after user signs in facebook, website loads access token appended url. request response_type=token token, not code or both code , token. according facebook documentation, confirming identity because redirect flow involves browsers being redirected urls in app login dialog, traffic directly access url made-up fragments or parameters. if app assumed these valid parameters, made-up data used app potentially malicious purposes. result, app should confirm person using app same person have response data before generating access token them. confirming identity accomplished in different ways dependi...

c++ - Convert string to integer ( binary equivalent ) -

i have seen lots of ways convert string such "12345" integer based on charecters represent ( integer 12345 ) , need able take string's binary equivalent , turn that integer. example , take string "hello!" . on hard drive ( or memory ) stored binary pattern : 010010000110010101101100011011000110111100100001 if treat these bits binary number instead of text, pattern equal 79600447942433. "hello!" = 79600447942433 the way of loop until end of string , convert individual charecters integers, multiply 2^ position_of_charecter #include <string> #include <cmath> using namespace std ; // ... string str = "hello!" ; int , total , temp ; unsigned char letter ; ( = 0 ; < str.length() ; i++ ) { letter = string[ ] ; temp = ( int ) letter ; total += ( temp * pow( 2 , ) ) ; } cout << "\"hello!\" equal " << total << endl ; but working large strings , faster way convert it ...

java - Restful web service to take complex object as input -

how can pass complex object person class input parameter in restful web service?? i have gone through many links didnt find solution. please help transform object json or xml (or other format, these common), , send body of request.

android - Service keeps getting destroyed -

i have service uses media player play music. service started activity , if playing , user moves away activity service should keep playing in background. running service in foreground seems work (i can see notification), in close cases service destroyed (ondestroy called system on service). know using startforeground not mean service never killed, keeps getting destroyed right away, guess few ressources forcing system kill it, not reason that. this how implemented it: in oncreate of activity, start (in background) , bind service. in onpause bring service foreground not destroyed well: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_play); // start service startservice(new intent(this, myservice.class)); // connect service bindtoservice(); ... } @override protected void ondestroy() { unbindfromservice(); super.ondestroy(); }; @override protected void onstart() { su...

twitter bootstrap - button-group in horizontal and vertical -

i want resposive view of buttons in bootstrap. that: [button1] [button3] [button5] [button2] [button4] [button6] and on phone: [button1] [button2] [button3] [button4] [button5] [button6] as user clicked in 1 button should set active, others inactive. you can use 1 http://jsbin.com/dohanivo/1 , in example used 4 column lg,md , sm , 12 column xs devices.

c# - WinForms tab order issue -

Image
i have devexpress wizard control. here it's tab order: i want change focused control tab button press, when focus not changed. cn wrong here?

c# - Class For generating Random Code -

i wrote class generate random code, shouldn't create 2 repetitive number. want know, in code, how possible have collision? public string myrandom() { random r = new random(); int x = r.next(1000);//max range persiancalendar pc = new persiancalendar(); string _myrandom = pc.getmonth(datetime.now).tostring() + pc.getdayofmonth(datetime.now).tostring() + pc.gethour(datetime.now).tostring() + pc.getminute(datetime.now).tostring() + pc.getsecond(datetime.now).tostring() + pc.getmilliseconds(datetime.now).tostring() + x.tostring(); return _myrandom; } if do list<string> s = new list<string>(); for(int = 0; < 100; i++) { s.add(myrandom()); } why? when random class created in loop, can duplicate random numbers. more info solution: create random instance outside loop.

android - How to align check boxes in frame Layout -

<framelayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="click" /> </framelayout> this main xml file check boxes collapsing. want vertically. please suggest me. you should replace framelayout linearlayout . docs: framelayout designe...

android - Java Heap Space error is occurring -

Image
java heap space error occurring in system. tried lot of solutions stack overflow nothing working. when working when pressing ok (no error in project) my eclipse.ini is: -startup plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807 -product com.android.ide.eclipse.adt.package.product --launcher.xxmaxpermsize 256m -showsplash com.android.ide.eclipse.adt.package.product --launcher.xxmaxpermsize 256m --launcher.defaultaction openfile -vmargs -dosgi.requiredjavaversion=1.6 -declipse.buildid=v22.3.0-887826 -xx:maxpermsize=512m my ram:4gb please me solve issue. it's because eclipse runs out of memory. can increase allocated memory editing (or creating) eclipse.ini file (on root of eclipse directory) , putting following code: -vmargs -xms512m (for 512 mb) -xmx1024m (for 1024 mb) for full list of available options, please check link .

asp.net mvc 3 - cannot convert expression type error in ReturnToAction when calling an action -

while returning action instead of returning view in mvc applicationi getting error: cannot implicitly convert type 'system.web.mvc.redirecttorouteresult' 'system.web.mvc.viewresult' for example: public viewresult today() { var date = datetime.now; return view("datetimeview", date); } public viewresult test() { return **redirecttoaction("today");** } i getting error: cannot implicitly convert type 'system.web.mvc.redirecttorouteresult' 'system.web.mvc.viewresult' change return type of action actionresult instead of viewresult . can this: public actionresult today() { var date = datetime.now; return view("datetimeview", date); } public actionresult test() { return redirecttoaction("today"); }

Delphi - Soap timeout have a maximum range? -

im setting timeout 50000, exception throws 42 seconds. setting 10000, exception throws 9,.. seconds. setting 120000, exception throws 42 seconds again. if ftimeout <> 0 begin internetsetoption(data, internet_option_connect_timeout, pointer(@ftimeout), sizeof(ftimeout)); internetsetoption(data, internet_option_send_timeout, pointer(@ftimeout), sizeof(ftimeout)); internetsetoption(data, internet_option_receive_timeout, pointer(@ftimeout), sizeof(ftimeout)); end; soap timeout have maximum or mininun range?

c# - Nullable short and array -

i got this public string myfunction() { return myfunction(null); } public string myfunction(short? variable) { if null else else return string; } now i'm trying make like public string myfunction(short[] variable) { string a; foreach(var z in variable) = +" "+ myfunction(z); } but recive error the call ambiguous between following methods or properties is possible stay 1 parameter cause know makin' function 2 params resolve problem still using 1 param. it's impossible replace null chosen number (e.g. 0). you can use cast resolve ambiguity: return myfunction((short?)null); without cast there no way compiler detect function want invoke.

css - Giving inline-block divs margin -

i provided advice on how center align divs great im having issue divs stack on screen sizes should need give them margin no matter how margin give them changes anything? html: <div class="categorylist"> <div class="categorypost">1</div> <div class="categorypost">2</div> <div class="categorypost">3</div> <div class="categorypost">4</div> <div class="categorypost">5</div> <div class="categorypost">6</div> </div> css : .categorylist{ background-color: #fff; height: auto; padding: 0px; text-align: center; margin: 0 auto; } .categorypost{ height: 200px; background-color:red; margin-bottom: 20px; width: 300px; display:inline-block; margin:0 auto; } if understand correctly here example html <div class="categorylist"...

Solr-Collection or Core not reloading schema.xml -

i using solar 4.6 , changed inside schema.xml . in order update schema.xml inside core used zkcli . works fine , able see modified schema.xml inside solr admin gui under cloud\tree\config\foobar\schema.xml . but after calling http://localhost:8983/solr/admin/collections?action=reload&name=foobar , http://localhost:8983/solr/admin/cores?action=reload&name=foobar , the old schema.xml still in core named foobar. your 2nd http request core api wrong. change name core : http://localhost:8983/solr/admin/cores?action=reload&name=foobar should http://localhost:8983/solr/admin/cores?action=reload&core=foobar . http://archive.apache.org/dist/lucene/solr/ref-guide/apache-solr-ref-guide-4.6.pdf (page 277) reload the reload action loads new core configuration of existing, registered solr core. while new core initializing, existing 1 continue handle requests. when new solr core ready, takes on , old core unloaded. this useful when you've ...

excel vba - type mismatch error while dimensioning a sheetname -

dim astring, jstring, kstirng string set rmdvsheet = activeworkbook.sheets(sheet11) rmdvsheet.range("$a$1:$k$103").autofilter field:=10, criteria1:= _ "d7u l462-l494 17my" rmdvsheet.range("$a$1:$k$103").autofilter field:=11, criteria1:= _ "air induction" rmdvsheet.calculate here on 2nd line getting type mismatch error. can help?

How to create mini inline form buttons in jQuery Mobile 1.4.2? -

have site uses jquery mobile 1.3.2. have 3 <input> buttons styled <input type="submit" id="1" value="1" data-mini="true" data-inline="true" /> create 3 small horizontally aligned buttons. i'm trying upgrade jqm 1.4.2, , have followed documentation change using data attributes instead setting class <input type="submit" id="1" value="1" class="ui-btn ui-btn-inline"> . instead of getting 3 buttons lined in row this: "1 2 3", i'm getting 3 buttons taking entire width of container flowing vertically this: " 1 " " 2 " " 3 " is there way re-create did in jqm 1.3.2 using 1.4.2? the documentation unfortunately isn't clear. both data mini , inline can used on input , however, can add them directly classes a , button tags. input wrapped in div holding classes. if add class input itself, won...

java - Using ant and build.xml error -

when try run program on gl server, error. also, have 2 packages, 1 is, , other driver package has driver.java in it. runs program. build failed target "run" not exist in project "autofill". why this? here build.xml <?xml version="1.0" encoding="utf-8" standalone="no"?> <!-- warning: eclipse auto-generated file. modifications overwritten. include user specific buildfile here, create 1 in same directory processing instruction <?eclipse.ant.import?> first entry , export buildfile again. --> <project basedir="." default="build" name="autofill"> <property environment="env"/> <property name="debuglevel" value="source,lines,vars"/> <property name="target" value="1.7"/> <property name="source" value="1.7"/> <path id="autofill.classpath"...

jquery - Texts don't keep form when panels animate -

when switch panel panel text on panels don't keep form. how can make text keep shape panels animate. please help `<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>website</title> <!--favicon--> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <!--fonts--> <link href='http://fonts.googleapis.com/css?family=special+elite' rel='stylesheet' type='text/css'> <!--css--> <link rel="stylesheet" type="text/css" href="css/normalize.css"/> <link rel="stylesheet"...

javascript - Using multiple textures on different faces of one geometry -

i'm quite new three.js i'm not sure if it's possible this: i want display multiple images on plane geometry (some of them appear multiple times). imagine next simplified case: +---+---+---+ | 1 | 2 | 3 | +---+---+---+ | 4 | 1 | 6 | +---+---+---+ | 1 | 1 | 9 | +---+---+---+ i'm creating plane it's divisions , applying meshbasicmaterial (contained inside meshfacematerial) faces. each pair of faces has assigned 1 of available images, ie: image1 applied faces {0, 1}, {8, 9}, {12, 13}, {14, 15} image2 applied faces {2, 3} ... the images "correctly" appearing on right position size not correct. each tile square 256x256 pixels size , each image displayed 256x256. problem texture size being streched edge of geometry. i've tried play texture wraps/wrapt properties no luck it's stretching out 768x768 (in example). my current code: // texture loading loop // canvas contains 256x256 image var texture = new three.texture(ca...

linux - Interrupt context bottom half (Softirq or tasklets) -

softirqs /tasklets said executed in interrupt context have below question respect interrupt context bottoms half. q1) happen if try put sleep in tasklet (interrupt context bottom half) ( consider tasklet scheduled interrupt handler). [my understanding] know while coming out of interrupt handler when tasklet_schedule called get tasklet_vec structure pointer , if no other interrupt / high priority softirq in progress schedule ksoftirqd run handler (tasklet handler) , if tall tasklet handler uses sleep in case ksoftirqd move wait_queue , unless , until tasklet_schdule called interrupted tasklet hander continue on point onwards. we "interrupt context code must not sleep" ( consequence if use sleep in interrupt handler, considering have not used spint lock or have not disabled timer interrupt ) (please correct me if understanding wrong) sleep works in process context not in interrupt context. in interrupt context, "current" not valid task can put in ...

c# - How to replace a user input in regular expression? -

i use simple codes describe situation. example, here codes: using system; using system.text.regularexpressions; public class example { public static void main() { string pattern = @"\b(?!non)\w+\b"; string input = "nonsense not non-functional."; foreach (match match in regex.matches(input, pattern, regexoptions.ignorecase)) console.writeline(match.value); } } now, replace "non" user input. let it's called "userinput" , codes written getting user input. want this, error exists: string pattern = @"\b(?!{0})\w+\b", userinput; is there way replace "non" inside pattern of regex user input? i think you're missing string.format() : string pattern = string.format(@"\b(?!{0})\w+\b", userinput);

reporting services - How to export to PDF on the click of view report button of report viewer in vb.net -

can please me how can add own code report viewer button export data directly pdf. i got below answer in 1 of thread want know how can done. you create own custom report viewing control. control comprised of fields report parameters , button generate report. when user clicks button generate report in background. display report pdf. to achieve you're after think you've 2 choices: use report server webservice directly required output pdf file use reportviewer control , render pdf it if can use of reportviewer control easier option maintain. depending upon requirements may need mix elements of both approaches. option 1 see answer supplied on question nice starter solution accessing web service directly reporting services: pdf of generated report option 2 rendering output of reportviewer control pdf involves rendering report viewer output byte array, , sending memorystream object , writing output stream. sample code below take report configured in r...

backbone.js - Marionette js routing - What am I doing wrong here? I'm getting error that route actions are undefined? -

just want basic routing , going. having seen number of examples thought code below should work, when run error "unable property 'dochat' of undefined or null reference". have initialization sequence wrong? require(["marionette", "jquery.bootstrap", "jqueryui"], function (marionette) { window.app = new marionette.application(); app.start(); app.addregions({ //add regions here }); //set routing var approuter = marionette.approuter.extend({ approutes: { "": "dodefault", "chat": "dochat" }, dodefault: function () { alert("doing default...") }, dochat: function () { alert("doing chat...") } }); var router = new approuter(); //history if (ba...

How to select multiple vertical characters in Notepad++ -

i have following setup (but 30 li items) in notepad++ <ol> <li>1. test1</li> <li>2. test2</li> <li>3. test3</li> <li>4. test4</li> <li>5. test5</li> <li>6. test6</li> <li>7. test7</li> </ol> but want replace first 3 characters after each <li> item looks this... <ol> <li>test1</li> <li>test2</li> <li>test3</li> <li>test4</li> <li>test5</li> <li>test6</li> <li>test7</li> </ol> is possible with ui tools in notepad++? or have manually go hand , fix html page... thanks advice! hey there why don't use column edition :) it's pretty easy :) it's alt + click drag column want :) here link : http://notepad-plus-plus.org/features/column-mode-editing.html

Reaching static variables in C++ -

if define static variable in classa: static int m_val; and initialize int classa::m_val = 0; can use directly m_val in order access in classa (or other class) or should use classa::m_val. inside of classa , write m_val . outside of classa , classa::m_val . however, m_val not const in example, (typically) should private anyway. in case, you'd not access directly other classes provide member function retrieve copy: class classa { private: static int m_val; // ... public: static int getval(); }; implementation: int classa::m_val = 0; int classa::getval() { return m_val; }

c++ - Dividing formatted string into smaller strings -

i store list of students in text file. every student's primary data stored in 1 line , list of classes second line, classes separated ',' . goes mathematics,linear algebra,physical education adv, optics, . if read 1 string, how can divide it, temp1 mathematics, temp2 linear algera , on...? use strtok function - use page reference http://www.cplusplus.com/reference/cstring/strtok/ though might difficult use @ first, it's quite efficient

r - Working with rich objects in data.table columns -

say have data.table in 1 column contains linear models: library(data.table) set.seed(1014) dt <- data.table( g = c(1, 1, 2, 2, 3, 3, 3), x = runif(7), y = runif(7) ) models <- dt[, list(mod = list(lm(y ~ x, data = .sd))), = g] now want extract r-squared value each model. can better this? models[, list(rsq = summary(mod[[1]])$r.squared), = g] ## g rsq ## 1: 1 1.000000 ## 2: 2 1.000000 ## 3: 3 0.004452 ideally, i'd able eliminate [[1]] , not rely on knowing previous grouping variable (i know want each row it's own group). this summary being bad little function, that's not vectorized. how vectorizing manually (this same @mnel's solution): r.squared = vectorize(function(x) summary(x)$r.squared) models[, rsq := r.squared(mod)] models # g mod rsq #1: 1 <lm> 1.000000000 #2: 2 <lm> 1.000000000 #3: 3 <lm> 0.004451631

ios - In UIPageViewController, when "pageViewController:viewControllerBeforeViewController"get called? -

i try display photos in uipageviewcontroller . firstly display photos in collection view , tap 1 photo enter page view. when i'm in page view, however, if scroll photo(to right or left), find both pageviewcontroller:viewcontrollerbeforeviewcontroller , pageviewcontroller:viewcontrollerafterviewcontroller method called(by calling nslog found it). should 1 of 2 methods called once? quite confused , have big trouble updating photonumber displaying photo want. here page view code: #import "photopageviewcontroller.h" #import "photoviewcontroller.h" @interface photopageviewcontroller () @property (nonatomic)nsinteger previousphotonumber; @end @implementation photopageviewcontroller - (void)viewdidload { [super viewdidload]; self.datasource = self; self.delegate = self; self.numberofphotosincurrentalbum = [photo numberofphotosinalbumwithname:self.albumname inmanagedobjectcontext:self.context]; photoviewcontroller *currentphotoviewc...