Posts

Showing posts from June, 2013

Azure Media Services & Playback of video via WPF Application -

i'm going around in circles turn final answer. i want develop small proof of concept application whereby demonstrate interaction azure media services. great apart video playback via mediaelement control. everything have done far in wpf, cannot work out how playback published media. i've tried number of presets believe supported mediaelement control, non of play. play in either chrome or silverlight player (smooth streaming.. know sl testing streaming work) is there wpf control , azure preset combination allow streaming via wpf application, or must done in silverlight only? smooth streaming playback available winrt, silverlight , windows phone -- not wpf. can, however, around if host silverlight player within wpf application . the media services preset want 1 of smooth streaming presets (or "playback via pc or mac" if stick simpler presets).

perl - how to form a new array based on part of an existing array -

i trying build new array based on existing array. #!/usr/bin/perl #join use warnings; use strict; @names = ('jacob', 'michael', 'joshua', 'mathew'); @t_names = join ("\t" , @names); @t_names2 = join ("\t", $names[0],$names[2]); print @t_names, "\n"; print @t_names2, "\n"; the test script allows me join 2 elements old array form new array. if array has 1000 elements , form new array contains selective portion of 1000 elements (say, element 3 , 3 multiples). tried join ("\t", $names[0,2]) perl doesn't recognize $names[0,2] (output suggests $names[0,2] "recognized" $names[2] . , not sure error means " multidimensional syntax not supported @ join.pl " if join not right function, other way build partial array existing array? thank you. whenever want more 1 thing out of array, whether it's items or subset, use @ instead of $ . you can select subset of items

php - Regex not matching correctly? -

i trying search subject match regular expression given in pattern not working correctly. want match number/10 postcode for example if string "hello 3/10 hu2" want preg_match function match 3 , postcode , needs in order the strange thing when try preg_match in opposite order hu2 3/10 works when change code around not recognize value 3. any appreciated the code below works order hu2 3/10 need in opposite order <?php preg_match('/([a-za-z]{1,2}[0-9][a-za-z0-9]?) ([0-9]{1,2})/', "hu2 3/10", $matches); echo $matches[1]; echo "<br>"; echo $matches[2]; ?> if change around, have include /10 in pattern. note can change delimiters don't have escape forward slash: preg_match('~([0-9]{1,2})/10 ([a-za-z]{1,2}[0-9][a-za-z0-9]?)~', "3/10 hu2", $matches); the [0-9] can replaced \d . also, if 10 variable number, that's easy take account, too: preg_match('~(\d{1,2})/\d+

Git allowing me to switch branches without committing changes -

i learning git, going through tutorial. in branch seo_title , have uncommitted changes file mission.html. did git checkout master expecting warning changes not staged commit, no changes added, etc, instead went ahead , switched branches message: m mission.html switched branch 'master' then when did git diff mission.html showed me working directory still contains changes made while had other branch checked out. missing? it's worth, using git bash on windows. edit: changes mission.html have not been added staging index either. edit 2: thought top voted answer correct, upon further investigation doesn't match behavior seeing. here fuller description of doing: top_directory(master) > git branch new_branch_1 top_directory(master) > git branch new_branch_2 top_directory(master) > git checkout new_branch_1 (open notepad++ , modify resources.html, save) top_directory(master) > git status # on branch new_branch_1 # changes not staged commit

sql order by - Need help optimizing mysql query to get it to sort quickly by index -

someone helped me come query still slow; order slowing down , dont think using index i'm hoping can fix me :d yes read manual page can't understand it. query: explain select u.id, u.url, u.title, u.numsaves urls u join tags t on t.url_id = u.id , t.tag = 'osx' order u.numsaves desc limit 20 showing rows 20 - 19 ( 20 total, query took 1.5395 sec) [numsaves: 6130 - 2107] id select_type table type possible_keys key key_len ref rows 1 simple t ref tag_id tag_id 767 const 49432 using where; using index; using temporary; using filesort 1 simple u eq_ref primary,id_numsaves_ix primary 4 jcooper_whatrethebest_urls.t.url_id 1 database: create table `urls` ( `id` int(11) not null auto_increment, `url` text not null, `domain` text, `title` text not null, `description` text, `numsaves` int(11) not null, `firstsaved` varchar(256) default null, `md5` varchar(255) not null default &#

perl - Trouble with "unblessed reference" when using HTML::TokeParser -

i've been poking , can't around "unblessed reference" error. here's simplified code: #!/usr/local/bin/perl use strict; use warnings; use html::tokeparser; $p = html::tokeparser->new( $argv[0] ); while (my $t = $p->get_tag('img')) { $src = $t->get_attr('src'); print "$src\n"; } and here's error message when try it: can't call method "get_attr" on unblessed reference @ m:\list_images_in_html.pl line 9. i gather somehow it's not recognizing $t token object get_attr method, don't understand why. according manual ( html::tokeparse @ metacpan ), get_tag() returns array reference, not object. you cannot call get_attr() on bog standard array ref.

php - Take what's between [code][/code] and apply changes -

i want make code box, can apply changes. if have this: $var= "word"; inside these [code] here [/code] , change $var red color , "word" green. i used preg_replace select what's between these [code] [/code] . $codebox = preg_replace("/\[code\](.*?)\[\/code\]/","$1",$string); the thing preg_replace can outsider changes (to whole code). want changes inside these [code] [/code] . like: background color, text color, text font, text font-weight , etc... that's mean need out apply changes put back. i want able use str_replace , preg_replace functions on $1 not on $string . for example change "word" green. i'll use preg_replace("/(\".*?\")/","<span style='color: #090;'>$1</span>",$string) and can't use preg_replace inside preg_replace , can i? don't know if i'm using wrong function here, or there way this. you may find patterns wrong, corre

c# - .ASPXAUTH Cookie Not Found in Request.Cookies -

i creating web application hosted under web site forms authentication enabled. have role in authentication database "admins". here controller code: [requirehttps] [authorize(roles = "admins")] public actionresult index() { return this.view(); } when go index page, if i'm not authenticated, redirects me login page enter credentials. login page redirects index page of new app, controller doesn't recognize user authenticated. i have taken authorize attribute off , looked @ request went out in chrome developer console , confirmed cookie indeed being sent. if leave authorize attribute is, , go index page, cookie collection on request in controller empty. headers collection contains header entitled "cookie", , value of header contains .aspxauth cookie. the login page calls logs in code: formsauthentication.setauthcookie(username, remember, "/"); this behavior reproducible in major browsers. what can cause cookies coll

java - Detecting if a node in a tree has child(s) or child nodes have been visited -

i struggling logic behind detecting nodes in tree exists or have been visited. i have tree nodes (a node has left , right child node). i want check 2 things on node: if there no child nodes if there child(s) nodes want check if have been visited. i have large condition hate of. there way can simplify it? public boolean finished(){ return right == null && left == null || ((right != null && right.visited && (left != null && left.visited)) } i want finished() true: if right , left node dont exist if right exists , has been visited if left exists , has been visited i think need or if right exists and visited and left null i'm bit confused :s i think may after if( (right == null || right.visited) && ( left == null || left.visited) ) so each child node if either empty or has been visited finished. this covers cases right == null; left == null; right == null; left.visited; right.visited; left

list - Using limit () and offset () in QueryBuilder (ANDROID , ORMLITE) -

@suppresswarnings("deprecation") public list<picture> returnlimitedlist(int offset, int end) { list<picture> picturelist = new arraylist<picture>(); int startrow = offset; int maxrows = end; try { querybuilder<picture, integer> querybuilder = dao.querybuilder(); querybuilder.offset(startrow).limit(maxrows); picturelist = dao.query(querybuilder.prepare()); } catch (sqlexception e) { e.printstacktrace(); } return picturelist; } i have table of pictures in database, , must return limited list, 20 lines @ time. but when use ex: querybuilder.offset(11).limit(30); i can not return list limited 20 lines. the list comes me limit. it's if offset remain value 0 ex: (0 - 30) is there other way return limited list initial index , end index? could me? this question asked 2 months ago, i'll answer if stumbled on same problem did. there's misunderstanding offset means

.net - Determine if an IXLCell is using a DateTime format -

all, in .net, i'm using closedxml read in uploaded excel file , converting cells 2d array of strings. end goal modify cells , display modified cells user. i'm having trouble handling cells store datetime values. weirdly, when read cell's data type, returns xlcellvalues.number (not xlcellvalues.datetime, expect). i've found excel stores datetimes doubles metadata saying convert date, might explain issue. i'm wondering if knows of way, using closedxml, check if excel cell's value datetime type? and, if so, how can convert value .net datetime? thanks! without looking @ file i'd cause cell contain number formatted date. valid in excel, in fact dates stored numbers. use following check if cell contains date: datetime date; if (cell.trygetvalue(out date)) { // got date }

Jquery ajax json response not showing -

hey code follows: js: $.ajax({ type: "post", url: "master.php", contenttype: "application/json; charset=utf-8", data: { "called": "reg", "fname": $("#fname").val() }, datatype: "json", success: function(data, responsetext, textstatus){ response = jquery.parsejson(data); console.log("good: " + response); console.log("good3: " + textstatus); console.log("good3: " + responsetext); }, error: function(xmlhttprequest, textstatus, errorthrown){ console.log("error: " + textstatus); } }); and master.php has: <?php $called = $_post['called']; if ($called == 'reg') { $json = array('good' => 'the value here'); header("content-type: application/json", true); echo json_encode($json); } ?&g

javascript - Get value of nth input element using eq() -

var = input.eq(2).val(); alert(parseint(i)); i'm trying value of 3rd input, returns nothing. had saying [object] [object] @ 1 point. how value of input? use jquery's .eq() api this var = $('input').eq(2).val(); alert(parseint(i)); or code looks has input variable need this var input = $('input'); var = input.eq(2).val(); alert(parseint(i)); js fiddle example

android - Offline use of google maps -

i want use google maps api in android application.( the application not require internet connection ) possible download map file of city, make available offline use? it's not possible google maps tiles, may try integrate android api v2 openstreetmap or other tiles.

python - Different ways of calling class functions -

say have code: class classstylea(object): def functiona(self): print "this style a." class classstyleb(object): def functiona(self): print "this style b." class instancestylea(classstylea): def functionb(self): print "this style a." instancestyleb = classstyleb() if want call, example, functiona , instancestylea , need type this: instancestylea().functiona() if want call functiona instancestyleb , need type this: instancestyleb.functiona() i need add set of parentheses after instancestylea in order call 1 of functions, otherwise error: typeerror: unbound method functiona() must called instancestylea instance first argument (got nothing instead) similarly, if try add parentheses after instancestyleb when calling 1 of it's functions, error: typeerror: 'classstyleb' object not callable why case? why treated differently if both instances of class? in example code, have 3 cla

ruby - How do I kill a process whose PID is in a PID file? -

i have variable pidfile , stores pid of process. how can kill pid in pidfile programmatically using ruby, assuming know filename, , not actual pid in it. process.kill(15, file.read('pidfile').to_i) or even process.kill 15, file.read('pidfile').to_i now, like: system "kill `cat pidfile`" # or `kill \`cat pidfile\`` however, approach has more overhead, vulnerable code injection exploits, less portable, , more of shell script wrapped in ruby opposed actual ruby code.

perl - Why will Storable load some classes, but not others? -

i'm having problem frozen objects in storable. when storable thaws object, it's supposed load class. true, isn't. here's sample code... #!/usr/bin/env perl -l use strict; use warnings; use storable; if( fork ) { } else { print "in child."; # load modules in child process parent not have them loaded require foo; print $inc{"foo.pm"}; print $foo::version; storable::store( foo->new("http://example.com"), "/tmp/tb2.out" ); require datetime; print $inc{"datetime.pm"}; storable::store( datetime->new(year => 2009), "/tmp/uri.out" ); exit; } wait; print "child done."; print "------------------------------"; print "datetime not loaded" if !$inc{"datetime.pm"}; $datetime = storable::retrieve("/tmp/uri.out"); print $inc{"datetime.pm"}; print $datetime->year; print "foo not loaded" if

php - jQuery not working on elements created by jQuery -

i dynamically adding list items list in jquery through ajax call called every second. below code ajax call. $.ajax({ url: 'php/update_group_list.php', data: '', datatype: 'json', success: function(data) { var id = data.instructor_id; group_cnt = data.group_cnt, group_name = data.group_name, group_code = data.group_code; (i = current_row; < group_cnt; i++) { //setinterval(function() { $('#group-list-div').load('php/group_list.php'); }, 5000); $('#group-list').append("<li><a href='#' data-role='button' class='view-group-btns' id='"+group_code[i]+"' value='"+id+"' text='"+group_name[i]+"'>"+group_name[i]+"</a></li>"); $('#delete-group-list').append("<fieldset dat

Error in PHP file uploader -

now, getting problem.... trying upload file code :- <form action="up.php" method="post"> <input type="hidden" name="max_file_size" value="200000" /> choose file upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" name="submit" value="upload!"/> </form> here up.php:- if(!isset($_files["uploadedfile"])) die("hacking attempt"); in above code, says hacking attempt... why isnt having file?? for start mysql_ functions deprecated - use mysqli_ or pdo try following identify error: $q = mysql_query($query,$c); if (!$q) die(mysql_error());`

python - Implement zeromq publisher in django with celery (Broker redis) -

i need implement zmq publisher in django , celery redis broker. client doesn't receive anything. tasks.py celery import task import zmq try: context = zmq.context() publisher = context.socket(zmq.pub) publisher.bind('tcp://192.168.0.14:9997') except: pass def app_delivery(): publisher.send("testid : task ") return "passed" @task.task(ignore_result=true) def add(): print "i going push message " return app_delivery() views.py from django.http import httpresponse notification_core.tasks import add def resp(request): param = request.get.get('param') param = int(param) i=0 while i<param: add.delay() i+=1 return httpresponse("done") then running workers using command-- python manage_back.py celery worker --loglevel=info workers console output [2013-04-20 10:37:06,400: warning/poolworker-2] going push mes

jquery - Add to cart not working -

i working on theme magento , have 2 problems. 1 when click item see page , click adding cart, doesn't add up. when looked in console found "productaddtocartform undefined" when go checkout step-by-step accordian isn't working. believe these 2 things interlinked? how can fix it? check if jquery confilcting prototype. use noconflict that. i think solve

html - Show/Hide element with jquery -

i have element (div), named: element1, element2, element3 by default : element1 visible, element2 visible, element3 hidden here code use <script type="text/javascript"> $(document).ready(function () { $('#element3').hide(); $('#element1').click(function () { $('#element3').toggle(400); }); }); </script> i use code above make element3 visible when click on element1. my question how make element2 hidden , element 3 visible when click on element1? how can revert default after click again in element1? try $(document).ready(function () { $('#element3').hide(); $('#element1').click(function () { $('#element3').toggle(400); $('#element2').toggle(400); }); }); demo: fiddle

html - how to get a title of a webpage using php? -

this question has answer here: get meta information, title , images of webpage using php 2 answers get title of website via link 10 answers i wrote following code title of webpage. code doesn't work , output error message: object of class domelement not converted string $html = file_get_contents("http://mysmallwebpage.com/"); $dom = new domdocument; @$dom->loadhtml($html); $links = $dom->getelementsbytagname('title'); foreach ($links $title) { echo (string)$title."<br>"; } could please show me example?

javascript - How to check if certain extjs panel is loaded -

i have add add javascript code after panel loaded (i have use panel id). how can check panel rendered , can access id using document.getelementbyid. thanks you should consult documentation . for each of questions: you can 1 of many events exposed. there afterrender event. you set id of panel accordingly. components have id property result of inheritance abstractcomponent , see docs on this . this code: var mypanel = ext.create('ext.panel.panel', { id : 'thisisyourid', //<<set renderto: ext.getbody() }); mypanel.on("afterrender", function() { //this code run after panel renders. });

python - Matplotlib: make final figure dimensions match figsize with savefig() and bbox_extra_artists -

i'm producing graphics publication matplotlib , want precisely sized figure output. need can sure figure won't need resized when inserted latex document, mess font size in figure want keep @ consistent ratio font size in main document. i need use bbox_extra_artists argument savefig because have legend down bottom gets cut off figure if don't. problem having haven't found way have original figure dimensions specify figsize when creating plot honoured after calling savefig bbox_extra_artists . my call savefig looks this: savefig(output_file, bbox_inches='tight', pad_inches=0.0,dpi=72.27,bbox_extra_artists=(lgd,tp,ur,hrs)) the figure width specify figsize is: 516.0 * (1/72.27) = 7.1398 inches = 181.3532 millimeters the output pdf width using savefig() call above 171 millimeters (not desired 181.3532 millimeters). the solution i've seen proposed in other questions here on make call tight_layout() . so, above savefig() call, put fol

c# - Font error in formula box in Excel? -

i have excel file (.xls), has 1400 rows, there rows displayed in correct font (both in sheet cells , in formula box docked @ top). there rows displayed right font in sheet cells if select , @ formula box, displays text of selected row in wrong font (some kind of error or unsupported font). my excel file's content contains unicode text, laptop installed common unicode fonts (simply language need unicode display , have many unicode fonts installed). i'm using excel 2013, don't think problem related missing font... maybe formula box , sheet cell use different fonts. noticeable point cells have contents displayed wrong font in formula box (i call these cells group b cells) formatted different font other cells (i call these group cells). i've tried changing font of group b cells font of group cells contents displayed wrong font (both in cells , in formula box) then. if every work handles excel file only, there not big problem, have project has import excel file datab

iphone - AVPlayer set initial playback time iOS -

added kvo avplayer when play video queueplayer avplayer [self.queueplayer addobserver:self forkeypath:@"status" options:0 context:null]; observer method : -(void)observevalueforkeypath:(nsstring *)keypath ofobject:(id)object change:(nsdictionary *)change context:(void *)context { if ([keypath isequaltostring:@"status"]) { if (self.queueplayer.status == avplayerstatusreadytoplay) { nsinteger step = (nsinteger)(starttimeforvideo/0.04); [self.queueplayer.currentitem stepbycount:step]; //cmtime seektime = cmtimemake(starttimeforvideo*timescale,timescale); //if (cmtime_is_valid(seektime)) // [self.queueplayer seektotime:seektime tolerancebefore:kcmtimepositiveinfinity toleranceafter:kcmtimepositiveinfinity]; //else // nslog(@"in valid time"); [self.queueplayer play]; } else if (self.queueplayer.status == avplayerstatusfailed) { /* error encountered */ } }

haskell - An example of a type with kind * -> * which cannot be an instance of Functor -

i'm haskell novice, apologies if answer obvious, i'm working through typeclassopedia in effort better understand categories. when doing exercises section on functors, came across problem: give example of type of kind * -> * cannot made instance of functor (without using undefined). my first thought define kind of infinitely recursing definition of fmap, wouldn't same if undefined used in definition? if explain answer appreciated. thanks! source of original exercise here, section 3: http://www.haskell.org/haskellwiki/typeclassopedia#introduction a simple example is data k = k (a -> int) here's ghci tells try automatically derive functor instance k : prelude> :set -xderivefunctor prelude> data k = k (a -> int) prelude> :k k k :: * -> * prelude> data k = k (a -> int) deriving functor <interactive>:14:34: can't make derived instance of `functor k': constructor `k' must not use typ

c++ Function to return an enum? -

so have namespace called paddlens class called paddle, inside paddlens have enum known colour namespace paddlens { enum colour {white = 0, red = 1, purple = 2, blue = 3, green = 4, yellow = 5, orange = 6}; } class paddle : public entity { private: paddlens::colour colour; public: void nextcolour(); void previouscolour(); void paddlecolour(paddlens::colour col) { colour = col; } }; now then, wondering how go creating function return colour there easier way return in text form instead of value or better of using switch figure out colour is? just return enum value: class paddle : public entity { // before... paddlens::colour currentcolour() const { return colour; } };

how to passing value of session from page 2 to page 1 in asp.net? -

i have listbox , button on page 1 , when click on button, page 2 open in new tab. in page 2, i'm uploading photos folder , set session["filename"] value. want when close page 2, names of uploaded images displayed in listbox. note: session["filename"] = names of uploaded images. does have idea? please me. thank you. my upload class: public void processrequest(httpcontext context) { if (context.request.files.count > 0) { // applications path string uploadpath = context.server.mappath(context.request.applicationpath + "/temp"); (int j = 0; j <= context.request.files.count - 1; j++) { // loop through uploaded files // current file httppostedfile uploadfile = context.request.files[j]; // if there file uploded if (uploadfile.contentlength > 0) { context.session["filename"] = context.sessi

Cannot run knitr on Lyx for MacBook -

i using last version on lyx 2.0.5.1 , rstudio 0.97.318. have installed knitr in r, /usr/bin/rscript in path prefix in lyx, still fail run example files knitr.lyx. error is: an error occurred while running: rscript --verbose --no-save --no-restore "/applications/lyx.app/contents/resources/scripts/lyxknitr.r" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/t/lyx_tmpdir.jl9170/lyx_tmpb... i changed lyxknitr.r other versions listed on official cite, not work them either. when did similar things on windows 7, runs ok. tried reinstall lyx, did not help. else can do? thanks! update: installed stringer package in r, reconfigured, lyx still gives , error: 12:24:25.747: rscript --verbose --no-save --no-restore "/applications/lyx.app/contents/resources/scripts/lyxknitr.r" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/t/lyx_tmpdir.jl2777/lyx_tmpbuf3/""knitr.rnw" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/t/lyx_tmpdir.jl2777/lyx

git branch - Git: see many branches in a single view -

is there way see changes many branches in git in single view. example if project consists of scripts part , c code part, can have them on 2 separate branches still see changes in single view? to create such "view", create third branch , merge branches care about: git checkout -b view branch1 git merge branch2 # 'view' sees contents of both branches view show branch contents @ time of creation. update view, add new merged content: git checkout view # switch view git merge branch1 branch2 # ...and merge new branch contents if file names in branches disjoint, merges should never have conflicts. if there conflicts on common files (such readme ), trivially resolved, , resolution confined (and remembered by) view branch. the same logic applies more 2 branches, merge command accepts arbitrary number of branches merge.

javascript - smooth scroll by x pixels using arrow keys up and down -

i trying make whole html page smooth scrolling hitting arrow keys , down exact amount of pixels. (example: hit arrow down , page scrolls down 300px hit arrow again , scrolls again 300px, hit arrow key , scrolls 300px...) founded these posts: similiar post similiar post 2 but dont know how make arrow keys working it. can please me? i don't know whether helps or not..but suggestion go through this(jscrollpane.kelvinluck.com) site scroll, have modified web pages have simple scrolls of this..

How can I update meta tags in AngularJS? -

i developing application using angularjs. want update meta tags on route change. how can update meta tags in angularjs can shown in "view source" on page? here html code - <!doctype html> <html ng-app="app"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="fragment" content="!" /> <meta name="title" content="test app"> <meta name="description" content="test app"> <meta name="keywords" content="test,app"> <link rel="stylesheet" href="css/jquery-ui-1.10.2.custom.min.css" /> <link rel="stylesheet" href="css/extra.css" /> <script src="js/libs/jquery-1.8.3.min.js"></script> <scrip

byte - Swig unsigned char* to short[] -

%apply (char* string,size_t length) { (char* databuffer, int size) }; this used convert char* byte[] . but need convert unsigned char* short[] %apply (unsigned char* string,size_t length) { (unsigned char* databuffer, int size) }; this apply isn't working? how can fix it?

Magento - how to hook into order reorder -

when customer reorders need include reference original order id on new order. can see how add attribute in sales_flat_order , sales_flat_quote (i think!), can't see how hook reorder. the reorder quite simple , done in app\code\core\mage\sales\controller\abstract.php->reorderaction . copies order items cart , opens cart. how can hook add orderid crossreference? i can copy local , edit (correct?) that's not smart way of doing because i've taken done in abstract.php , made local copy of it. i guess create custom module reorder , point "reorder" link custom module. again, that's bit hacky , i'd prefer hook process if possible. thanks. you can hook controller_action_predispatch_sales_order_reorder event , order id parameter on observer $oldorderid=mage::app()->getrequest()->getparam('order_id'); create new column quote , order table on sql installer $installer = new mage_sales_model_resource_setup('core_setup&#

javascript - Chromeless window in Chrome extension? -

Image
so i've come across webapp on chrome web store called type fu. amazed me created true chromeless window. i'm thinking if can in chrome extension because in parts use same apis. however, can't find let me effect. chrome.tabs.create not useful @ all. it madness if can't in extension because in opinion, extension should have more "power" webapp (a webpage basically). i couldn't press ctrl + shift + or right-click on it. it's real native program on computer. some buttons open floating chromeless window. ...in parts use same apis chrome extensions designed interact browser. chrome packaged apps designed standalone , operate independently browser. apis have now diverged . take @ api listings apps , the equivalent listing extensions , , you'll see quite different. in case, type fu uses chrome.app.window api, particularly frame: 'none' option of create function. as name of app.window suggests, it's ava

How To Stop at the End of a Function (Without Exiting it) In GDB? -

please consider following code: main() { .... retval = func(); } suppose put breakpoint on given function: gdb$ b func now, breakpoint gets hit & 'finish' in function func(): gdb$ fin my problem is: doing 'finish' brings me main(), here: retval = func(); i want stop @ end of func() without exiting func(). can please suggest generic way (independent of no. of lines of code in func()) achieve this? thanks. there no way it. compilers don't emit needed bit of debuginfo (there's gcc bug open this); , if did, gdb wouldn't read it; , if did need new syntax able specify breakpoint location. i don't remember offhand if there gdb bug this, there ought be.

How to handle redirect by httpClient fluent? -

i'm writing acceptance tests httpclient fluent api , have trouble. @when("^i submit delivery address , delivery time$") public void i_submit_delivery_address_and_delivery_time() throws throwable { response response = request .post("http://localhost:9999/food2go/booking/placeorder") .bodyform( param("deliveryaddressstreet1", deliveryaddress.getstreet1()), param("deliveryaddressstreet2", deliveryaddress.getstreet2()), param("deliverytime", deliverytime)).execute(); content = response.returncontent(); log.debug(content.tostring()); } this code works when use post-forward strategy, exception thrown when use redirect instead. org.apache.http.client.httpresponseexception: found what want getting content of redirected page. idea appreciate, in advance. the http specifi

sql - Impact: Delete a View, Create table with same name -

so there view in oracle named xyz , says, going replace table of same name. what kind of impact can create existing sql's written on view? syntax querying view same table? by "... replace table ..." assume mean table created same data view referencing. in other words, new table redundantly contains data other tables (those view referencing). select-statements not need changed - syntax same. but: view reflect changes in underlying tables. table not - have kept in sync triggers or application logic. depending on view, might rather big change. more if view updateable. example: suppose view defined ... select a.key, b.name a,b b.key = a.b_ref then selecting view reflect changes tables a , b . if replace table, have update new table every time update table a or b .

Are there any ASP.NET / Razor-friendly HTML and CSS Validators? -

i use w3.org validators html , css (and jsfiddle jquery), find in case of html , css, have modify markup , style rules removing razor code (the "@" stuff) such as: .ui-widget-header .ui-icon { background-image: url('/@configurationmanager.appsettings["thisapp"]/content/images/ui-icons_228ef1_256x240.png'); } (yes, name of image) ...and: @html.labelfor(m => m.begintime) also, since asp.net can have "pieces parts" of html distributed (some in layout file, in current file, etc.) html validator @ http://validator.w3.org/ thinks html missing things head section, etc. of course, 1 gather html - guess running page , selecting "view source" generated html - when page not running, , that's why you're trying validate track down problem, that's not option. so: there validator css and, more importantly, html, "understands" asp.net / razor? then images why don't use: '../content/images/ui-

tsql - Get max value within an inline view having a TOP clause -

i trying max value within inline view , returning me maximum value within inline view if inline view had no top clause. the table dbo.details in query below contains 650 records. need max value top 200 records, query below gets me max value on records in details table batchnumber = 341. is there subtle point missing? goal max value within top(200) records. using sql server 2008 r2. select max(a.detailsrecordid) (select top(200) npd.detailsrecordid, npd.batchnumber dbo.details npd npd.batchnumber = 341) top 200 based on nothing. there no order by. even table clustered pk there no guaranteed order without order by.

android - Configure build path suggestion when trying to extend ActionBarActivity -

i’m trying extend class actionbaractivity , cant, tried every possible way know. i’m importing android.support.v7.app.actionbaractivity; want add lib without resource instructed on android developer’s site. , every time same error....i upload photos this error: description resource path location type project not built since build path incomplete. cannot find class file android.support.v4.app.actionbardrawertoggle$delegateprovider. fix build path try building project xxx unknown java problem a busy cat http://img29.imageshack.us/img29/1032/qlei.jpg a busy cat http://img43.imageshack.us/img43/6339/n4cj.jpg thanks the problem has been fixed me after adding android support library. right click -> android tools -> add support library

c - NDIS filter driver' FilterReceiveNetBufferLists handler isn't called -

Image
i developing ndis filter driver, , fount filterreceivenetbufferlists never called (the network blocked) under condition (like open wireshark or click "interface list" button of it). when start capturing, filterreceivenetbufferlists normal (network restored), strange. i found when mannually return ndis_status_failure ndisfoidrequest function in oid originating place of winpcap driver (biocqueryoid & biocsetoid switch branch of npf_iocontrol), driver won't block network (also winpcap can't work). is there wrong ndisfoidrequest call? the deviceio routine in packet.c originates oid requests: case biocqueryoid: case biocsetoid: trace_message(packet_debug_loud, "biocsetoid - biocqueryoid"); // // gain ownership of ndis handle // if (npf_startusingbinding(open) == false) { // // mac unbindind or unbound // set_failure_invalid_request(); break; } // extract request lis

c# 4.0 - Library Design for Custom Performance Counters in c# -

for 1 of requirement, told create custom performance counters our window service. after analysis google page came know miccrosoft .net library system.diagnostics. i using db tables store categories , counters information master entry category , counters name description, category type (single/ multiple), datatype of counters etc. now know whether should create new separate wrapper dll load information database create category , counters? correct design? second: ideally should load database? caller program or actual program (which creating counters , category)? please me design?

terminal - mate . command is not working in MAC OSX -

i trying open content of directory using text mate mate . command. but, getting message : -bash: mate: command not found i tried following command fix : ln -s /applications/textmate.app/contents/sharedsupport/support/bin/mate /usr/local/bin/mate but, unfortunately did not trick me. gives me message : ln: /usr/local/bin/mate: file exists how fix problem ? ln -s /applications/textmate.app/contents/sharedsupport/support/bin/mate /usr/local/bin/mate worked me after installing mac 10.9

registry - Clover for integration testing -

i using clover generate coverage integration test coverage. clover db file(.db) in directory .clover when running testcases, generates following files in .clover dir. <clover3_1_6>.dbvayht_hke3br0q <clover3_1_6>.dbvayht_hke3br0q.1 <clover3_1_6>.dbkkhjl_hke66gs6.1 <clover3_1_6>.dbkkhjl_hke66gs6 <clover3_1_6>.db.liverec. when try merge these , following error error writing new clover db @ .clover/clover3_1_6.db": file ".clover/clover3_1_6.dbvayht_hke3br0q" not valid clover registry file (file magic number invalid - expected 0xcafefeed 0x3b4e0341). please regenerate. i tried regenerate .db file , re-run test cases. when try clover-merge still fails , same error. my clover merge target <target name="merge-clover" description="clover database merge"> <clover-merge initstring=".clover/clover3_1_6.db"> <cloverdbset dir=".clover"> <ex

java - Get bytes from the Int returned from socket intputStream read() -

i have inputstream , want read each char until find comma "," socket. heres code private static packet readpacket(inputstream is) throws exception { int ch; packet p = new packet(); string type = ""; while((ch = is.read()) != 44) //44 "," in iso-8859-1 codification { if(ch == -1) throw new ioexception("eof"); type += new string(ch, "iso-8859-1"); //<----does not compile } ... } string constructor not receive int, array of bytes. read documentation , says read(): reads next byte of data input stream. how can convert int byte ? using less significant bits (8 bits) of 32 bits of int ? since im working java, want keep full plataform compatible (little endian vs big endian, etc...) whats best approach here , why ? ps: dont want use ready-to-use classes datainputstream, etc.... the string constructor takes char[] (an array) type += new string(new byte[]