Posts

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...