Posts

Showing posts from September, 2015

javascript - IE11 incompatibility with jQuery's 'readonly'? -

the code i'm running has no issues in firefox, or chrome. user typing 1 textbox, tabs next , can continue typing that. when run webpage on ie11, user tabs next textbox , can't type in. textbox has double-clicked before user can insert anything. i've googled , seems ie give problems when using older jquery (i.e. prefers 'prop' 'attr' ). in code below jquery's readonly keyword being used in way ie11 no longer recognise/accept? i assume issue readonly , removeclass('ignore') working expected. //when focus on textbox 1 $("#field1").focus(function() { //remove readonly property textbox 1 $('#field1').prop('readonly', false).removeclass('ignore'); //add readonly property other textboxes $('#field2, #field3, #field4') .prop('readonly', 'readonly').addclass('ignore').val(''); }); i'm using jquery 2.1.3

php - Negate a $regex for mongodb in Yii2 -

i use $regex inside aggregation pipeline $match instruction in php. need find record "does not contain" string. i'v found out online $not operator used such cases, if try this: $regex = "/.*".$sometext.".*"; $use['$not'] = $regex; also 1 not work: new \mongoregex("/.*".$sometext.".*") $use['$not'] = $regex; in short need find text not contain string

c - Saving regex matched strings to an array of strings -

so im starting pick c end goal write function searches string regular expression , returns array of matches. the biggest problem i'm having saving strings memory can return or referenced in pointer passed in parameter. i'd way tell how many matches there c# equivalent; if(matches.count() > 0) { /* have match! */ } resulting string of each match group depending on pattern i'll pass in. i know isn't correct , has other errors in practice here code walked away trying figure out reading on pointers, structs, char arrays..etc typedef struct { char *match; } matches; int main() { regex_t regex; int reti; char msgbuf[100]; int max_matches = 10; regmatch_t m[max_matches]; char str[] = "hello world"; reti = regcomp(&regex, "(hello) (world)", reg_extended); if( reti ) { fprintf(stderr, "could not compile regex\n"); exit(1); } reti = regexec(&regex, str, (size_

dart - Weird DartEditor behavior / bug? -

Image
i'm working on little website using dart. have 1 project server, , client app (see picture below) in server app serve client app client project this runserver() { var statichandler = createstatichandler(r"c:\users\lukasz\dart\linkshepherdclient\web\", defaultdocument: 'linkshepherd.html',servefilesoutsidepath: true); var handler = new cascade() .add(statichandler) .add(routes.handler) .handler; io.serve(handler, internetaddress.loopback_ip_v4, 8080).then((server) { print('listening on port 8080'); }).catcherror((error) => print(error)); } everything worked fine. changes in client project stopped affecting site served server (a site still loads, older version, different styling, importantly older .dart script file). when run client directly it's project date. opening , closing editor not help. dart editor creating sort of cache? the cache might dart:

mysql - How to get last 3 data of last 3 week days from a table -

i have table consisting of stock market's daily data. consists of various number of rows each day.i have column named 'high' in table. need calculate max(high) last 3 week days. ex:- if today wednesday need calculate max of last week's friday , week's monday,tuesday. know can if know date manually using query this. select max(high) table_name date>='date' but don't want want automate program written in php. how can achieve in both either php or sql appreciable. table has 6 columns date,time,open,high,low,close say suppose if table this date time open high low close 2015-05-06 09:30:00 2012.50 2020.5 2016.5 2014.0 2015-05-06 09:31:00 2013.50 2021.5 2014.5 2016.0 2015-05-06 09:32:00 2014.50 2021.75 2017.5 2013.0 2015-05-07 09:30:00 2011.50 2019.5 2018.5 2014.0 2015-05-07 09:31:00 2014.50 2022.5 2016.5 2015.0 2015-05-07 09:32:00 2012.50 2026.5 2017.5 2016.0 2015-05-08

unix - Calling python scripts from anywehre -

i have collection of python scripts import each other. if want use these in location scripts not physically present, how can this. tried adding path of dir scripts $path got no joy. appreciated, thanks. python doesn't share own path general $path , able you're looking for, must add scripts in $pythonpath instead.

java - archive for required library can not be read -

i created first maven project , java build path problem in it. description resource path location type archive required library: 'c:/users/simran/.m2/repository/org/glassfish/extras/glassfish-embedded-web/3.1.1/glassfish-embedded-web-3.1.1.jar' in project 'restfulmessenger' cannot read or not valid zip file restfulmessenger build path build path problem this jar present in location mentioned, tried deleteing there , cleaning project , updating maven nothing fixed error. what seems wrong? you should try doing maven -> update project , make sure check force update of snapshots/releases

java - Real Time Scenarios to use singleton class in android -

i know singleton class. want know real time scenarios use singleton class in android . can give me examples in android use , benefits of scenario.. two real scenarios extend application class , use it's instance access app context within class sql database idea singleton class here example of app usage import android.app.application; public class myapplication extends application { private static myapplication instance = null; public static myapplication getinstance() { return instance; } @override public void oncreate() { if (instance == null) { instance = this; } } } access string in r public class dummyclass { private void getappstring(){ string r = myapplication.getinstance().getstring(r.string.app_name); } }

javascript - Creating a slider between two numbers -

so i've been working on re-producing slider found here https://www.skylight.io/ ( scroll down find price slider ). far ive managed create similiar, numbers hard coded, making difficult change , not re-usable. i've been researching around , think need use math.log() , math.exp() achieve in link above i'm not sure. heres jsfiddle of have far https://jsfiddle.net/7wrvpb34/ . i feel maths part of problem halting me think, appreciated. javascript code below: var slider = document.getelementbyid("slider") var sliderfill = document.getelementbyid("slider-fill") var knob = document.getelementbyid("knob") var mousedown; var mousepos = {x:0}; var knobposition; var minprice = 20; var price = 0; var minrequests = 50; var requests = 50 + ",000"; var incrementspeed = 2; var incrementmodifier = 20; var incrementvalue = 1; var minmillioncount = 1; var millioncount = 1; var previousrequestamount = 0; document.getelementbyid("pr

c# - Adding Dynamic Controls to Web Forms -

i trying add new dynamic controls on button click not adding multiple labels, want retain state of control after postback adding textbox typed in value should there. public partial class _default : system.web.ui.page { list<string> controlids = new list<string>(); static int count = 0; protected override void loadviewstate(object savedstate) { base.loadviewstate(savedstate); controlids = (list)viewstate["controlsid"]; foreach (string id in controlids) { count++; label dynamic_typeinerror = new label(); dynamic_typeinerror.id = id; tablerow tbl_rows = new tablerow(); tablecell tbl_cell = new tablecell(); tbl_cell.controls.add(dynamic_typeinerror); tbl_rows.cells.add(tbl_cell); plc.controls.add(tbl_rows); } } protected void bt_adddynamiccontrols_click(object sender, eventargs e) { count++; label dynamic_typeinerror = new label(); dynamic_typeinerror.id = "dynami

javascript - Add a class On Click - JS Tab -

i have 3 tabs, class 'fetch_records' . when user clicks on other tab, clicked tab should activated adding new class 'years_active' , other should remain same , class 'years_active' removed if any. my code : $('.fetch_records').click(function (e) { $('.fetch_records').removeclass('years_active'); $(this).addclass('years_active'); e.preventdefault(); $('.ajax-loader').show(); var year = $(this).attr('data-year'); $.ajax({ ...do something... success: function (msg) { ...show success message... } }); }); html: <li><a data-year="2001" class="fetch_records years_active"> 2001 <a/> </li> <li><a data-year="2002" class="fetch_records"> 2002 <a/> </li> <li><a data-year="2003" class="fetch_records"> 2003 <a/> </li>

ios - Draw an Image stretched on x-dimension? -

Image
i have uiimage has frame of (0,0,100,100) now want draw image frame of size (0,0,120,100) i want image stretched. don't want stretch parts of image. want point involved. whole image should stretched proportionally. how can that? here options when comes setting contentmode of view. i shamelessly searched uiview contentmode on google images.

ios - Could not pre-launch appium and app doesn't get installed in iphone real device using appium -

Image
i using appium version 1.3.7. i have connected physical device via usb. i have launched appium server,after while appium crashed. i have pasted full log below. i have attached screen shot below. launching appium command: '/applications/appium.app/contents/resources/node/bin/node' lib/server/main.js --command-timeout "7200" --pre-launch --platform-version "8.1" --platform-name "ios" --app "/users/al/work/sample.app" --udid "f5de3fd5ccded92e40e86c652ce2a6f9414fe1a0" --device-name "iphone 4s" info: [debug] starting appium in pre-launch mode info: pre-launching app info: [debug] using local app command line: /users//al/work/sample.app info: [debug] creating new appium session 1cdc5dc0-36d2-40b9-922b-33601f28846b info: [debug] removing remaining instruments sockets info: [debug] cleaned instruments socket /tmp/instruments_sock info: [debug] setting xcode folder info: [debug] setting xcode version info:

complicated join in spark: rdd elements have many key-value pairs -

i'm new spark , trying find way integrate information 1 rdd another, structures don't lend standard join function i have on rdd of format: [{a:a1, b:b1, c:[1,2,3,4], d:d1}, {a:a2, b:b2, c:[5,6,7,8], d:d2}] and of format: [{1:x1},{2,x2},{3,x3},{4,x4},{5,x5},{6,x6},{7,x7},{8,x8}] i want match values in second rdd keys in first rdd (which in list value in c key). know how manipulate them once they're there, i'm not concerned final output, i'd maybe see this: [{a:a1, b:b1, c:[1,2,3,4],c0: [x1,x2,x3,x4], d:d1}, {a:a2, b:b2, c:[5,6,7,8],c0: [x5,x6,x7,x8], d:d2}] or this: [{a:a1, b:b1, c:[(1,x1),(2,x2),(3,x3),(4,x4)], d:d1}, {a:a2, b:b2, c:[(5,x5),(6,x6),(7,x7),(8,x8)], d:d2}] or else can match keys in second rdd values in first. considered making second rdd dictionary, know how work with, think data large that. thank much, appreciate it. join after flatmap , or cartesian makes many shuffles. one of possible solutions use cartesian

ios - How to set the same image for iPhone Retina Display and iPad non Retina -

i have developed universal app , import graphics stuff. came across following thought. if icon referred iphone retina display , file referred ipad non retina display has same size, there way not import same file different names (icon@2x.png & icon~ipad.png) twice? i not sure if there such icon size have same size iphone retina , ipad non retina device(pardon me if incorrect). if talking normal image want same iphone retina , ipad non retina, , want app automatically select same image both devices mentioned above then, no. can manually though, know.

apache - ajax not working showing forbidden error -

hi ajax code $("#ajax_login_form").on('submit',function(event){ var datastring = $("#ajax_login_form").serialize(); $.post('http://myshowcam.com//users/login', datastring, function(response){ }, 'json'); }); after submitting form below error in console. forbidden you don't have permission access /testsite/users/login on server. additionally, 404 not found error encountered while trying use errordocument handle request. apache/2.2.15 (centos) server @ myshowcam.com port 80 please help.thank in advance. ok. makes more difficult then. knowing how configure apache extremely crucial. assuming using cakephp 3, try following instructions here: http://book.cakephp.org/3.0/en/installation.html#apache . file located @ /etc/httpd/conf/http.conf . best approach use virtual_hosts location of file created here /etc/httpd/conf.d/ . example, have myshowcam.com.conf there. there plenty of virt

How to upload an image from my iOS app to a PHP server? -

i don't know php , swift can me? have server: cs.hisarschool.k12.tr/ecs.php , code: <?php $firstname = $_post["firstname"]; $lastname = $_post["lastname"]; $userid = $_post["userid"]; $target_dir = "/var/www/html/uploads"; // $myfile = fopen($target_dir, "w"); if(!file_exists($target_dir)) { echo "creating directory"; mkdir($target_dir, 0555, true); } //$target_file = $target_dir . "/" . basename($_files["file"]["name"]); $target_file = $target_dir . "/sc.jpg"; if (move_uploaded_file($_files["file"]["tmp_name"], $target_file)) { echo json_encode([ "message" => "the file " . basename($_files["file"]["name"]) . " has been uploaded.", "status" => "ok", "userid" => $_request["userid"] ]); } else { echo json_encode([

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null .

linux - what's the best way to fast copy some big file from serval servers to hunderands servers? -

there big file on serval of servers, want copy servers fast possible. below current script, there faster way this, viral distribution, example: source a, targets b c d. a->b, after b done ,then b->c , a->d (at same time) . how can improve script, sugesstion, ! #!/bin/bash set -u source_pool=(seq -f 10.10.10.%g 10 20) host_ip_list=(seq -f 10.10.10.%g 21 200) ready_flag=/tmp/ready_flag lock_flag=/tmp/lock_flag do_lock(){ ip=$1;shift 1 ssh root@$ip "touch $lock_flag" } do_unlock(){ ip=$1;shift 1 ssh root@$ip "rm -f $lock_flag" } find_source(){ while true;do source_ip in ${source_pool[@]} ping $source_ip -c 1 1>/dev/null 2>/dev/null if [[ $? -ne 0 ]];then continue fi ssh root@$source_ip "ls $lock_flag" 1>/dev/null 2>/dev/null if [[ $? -eq 0 ]];then continue fi ss

python - Untar a file and find the links(short/full) in the text -

i working on tar file, 100 mb file. need see links in text , find comments/likes/shares links. untar file , save json using python, on converting csv using import csv, json, sys input = open(input.json) data = json.load(input) input.close() output = csv.writer(output.csv) output.writerow(data[0].keys()) row in data: output.writerow(row.values()) i left 1kb file there way without converting json? or using r?

java - Object of syncronized list can't be changed from interface callback -

expected totally minusing. i'm using method, makes request server in thread : getgeocodingresults(finaldepartureurl, new ivolleycallback() { @override public void onsuccess(jsonobject jsonobject) { handlevolleyresponse(jsonobject, order, 1); ordersfragment.syncedorderslist.get(ordersfragment.syncedorderslist.indexof(order)).setdeparturepoint(order.getdeparturepoint()); ordersfragment.syncedorderslist.set(ordersfragment.syncedorderslist.indexof(order), order); }); onsuccess moght called in main thread, , set new value static syncronized list. here declaration : syncedorderslist = collections.synchronizedlist(new arraylist(orderslist)); but when check same object after callback execution, see , new value field wasn't setted - departurepoint filed null. what i'm doing wrong ? method, loop through items , call backgroung oper

javascript - css html hover only on the letter/character area -

Image
how can make hover effect work when cursor moves on « character? hover effect applied whenever cursor enters red background. need apply when cursor in area: #toolxxx { background-color: #ff0000; background-size: 10px 10px; z-index: 100; position: fixed; right:1; top: 50px; color: rgba(255,255,255,1); font-size: 50px; } #toolxxx:hover { z-index: 100; position: fixed; right:1; top: 50px; color: rgba(0,0,0,1); font-size: 50px; } <div id='toolxxx'> &#171; </div> what need wrap &#171; other element, apply hover action wrapper. example: <div id='toolxxx'> <span>&#171;</span> </div> css hover #toolxxx span:hover { color: rgba(0,0,0,1); } live demo

jquery - @Html.ActionLink adding class and id -

trying add class action link , id value, capture class , pass value controller. i have jquery capture link click: <script> $(function () { $(".actionlink").click(function (e) { e.preventdefault(); var newurl = $(this).attr("href"); console.log(newurl); $("#addsection").load(newurl); }); }); tried few different ways without success. first 1 is @html.actionlink("edit", "_editgender1", new { id = item.genderid }) which returns html: <a href="/treeview/_editgender1/1">edit</a> obviously 1 won't work assigned id correctly end of url /1 second one: @html.actionlink("edit", "_editgender1", new { @class = "addsection", id = item.genderid }) which returns: <a href="/treeview/_editgender1/1?class=addsection">edit</a> the id again added correctly, though has class=addsection

google maps - Android, InfoWindows not follow the marker postion changes -

i have changed position of marker in map. if infowindow of 1 marker shown want infowindow should remain visibile should in new position of marker , new information. infowindow update information still remain in old marker position. .... mrk.setposition(v.getpostion()); mrk.setsnippet(v.getspeed() ); //update information if(mrk.isinfowindowshown()){ mrk.hideinfowindow(); mrk.showinfowindow(); }

ios - UITableView cell's seperators disappear when selected -

when select uitableviewcell , start scrolling point cells disappear screen, seperators on cells disappear once reappear on screen. delegate: - (void) tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { [self.tableview selectrowatindexpath:indexpath animated:no scrollposition:uitableviewscrollpositionnone]; uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath]; if(cell == nil){ if(type == scene){ group *scene = [[appdata getscenes]objectatindex:lastrequestedpropertyposition]; [selectedarray addobject:scene.id]; }else if(type == product){ device *device = [[appdata getdevices]objectatindex:lastrequestedpropertyposition]; [selectedarray addobject:device.id]; } }else{ [selectedarray addobject:[nsnumber numberwithint:cell.tag]]; } } datasource: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexp

listview - Android: Can I set converted view layout in getView() -

i'm setting different height custom listview items based on screen orientation, , in code below listen screen orientation changes, , set global value according it, , when getview(...) gets called on listview items set height of converted view. my question is, there better solution this? how bad approach affect ui loading speed process? i'm targeting api14+ p.s: (200 & 300) below added here example, not fixed @ runtime, changed during runtime according screen dpi. int mconvertviewheight; @override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); if (newconfig.orientation == configuration.orientation_landscape) { mconvertviewheight = (int) typedvalue.applydimension(typedvalue.complex_unit_dip, 200, getresources().getdisplaymetrics()); } else if (newconfig.orientation == configuration.orientation_portrait) { mconvertviewheight = (int) typedvalue.applydimension(typedv

android - Toggle Button Not Working Properly on Bluetooth Adapter -

hi sir/ma'am, i'm trying enable/disable bluetooth on toggle button , there additional functionality ask password on enable/disable. toggle button taking default state of bluetooth @ launch(means if bluetooth enable, toggle set on , if bluetooth disable, toggle off). also, working fine on when enter correct password. but, main problem when enter wrong password, toggle not behave expected. what mean, suppose bluetooth on , trying disable app. when click on toggle, ask me enter password. now, if enter wrong password, bluetooth doesn't turn off, toggle button changed state turn off. here tried far:- setcontentview(r.layout.activity_main); mb = bluetoothadapter.getdefaultadapter(); tb1 = (togglebutton)findviewbyid(r.id.apptogglebtn); tb1.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub check(); } }); } publ

objective c - Add padding into UIlabel text? -

i've label in table cell , wish add padding top,bottom,left , right. cgrect initialframe = cgrectmake(10,10,100,20); uiedgeinsets contentinsets = uiedgeinsetsmake(5, 0, 5, 0); cgrect padd = uiedgeinsetsinsetrect(initialframe, contentinsets); self.rewardlabel = [[uilabel alloc] initwithframe:padd]; self.rewardlabel.backgroundcolor =[uicolor colorwithred:0.192 green:0.373 blue:0.561 alpha:1]; self.rewardlabel.layer.cornerradius = 5.0f; self.rewardlabel.layer.maskstobounds = yes; self.rewardlabel.textcolor = [uicolor whitecolor]; self.rewardlabel.linebreakmode = nslinebreakbywordwrapping; self.rewardlabel.numberoflines = 1; self.rewardlabel.font = [uifont fontwithname:@"helveticaneue" size:14]; [self.contentview addsubview:self.rewardlabel]; but seem not working.can tell me how do? there several ways on how achieve this: if not need specific background color label adjust labels frame add padding (e.g. if text sh

lua - Get value at index in table -

is possible me cycle table asynchronously without checking state? able colors[count % 6] or similar don't need check explicitly state (count) i'm at. colors = { red = {max.r,0,0}, green = {0,max.g,0}, blue = {0,0,max.b}, purple = {max.r,0,max.b}, pink = {max.r,0.1*max.g,0.8*max.b}, yellow = {max.r*0.95,max.g*0.64,0.5*max.b} } i have timer callback want go through table 1 color @ time , have if count == 0 setcolor(colors.red) ... one way use index table: local index = {"red", "green", "blue", "purple", "pink", "yellow"} then can use colors[index[count % 6 + 1]] . downside is, if keys of colors modified, index needs updated manually.

multiprocessing - Killing a process launched from a process that has ended - Python -

i trying kill process in python, being launched process , unable find correct place place ".terminate()". to explain myself better post example code: from multiprocessing import process import time def function(): print "here creating function need kill" processtokill = process(target = killme) processtokill.start() def killme(): while true: print "kill me" time.sleep(0.5) if __name__ == '__main__': process1 = process(target = function) process1.start() my question is, can place processtokill.terminate(), ideally without having change overall structure of code? you can hold onto processtokill object can kill later: from multiprocessing import process import time def function(): print "here creating function need kill" processtokill = process(target = killme) processtokill.start() return processtokill def killme(): while true: print "kill me

java - How to perform big numbers on axis (for example, 10^3 format) in chart? -

using big space performing long numbers not decision. if have graph medium scale 50 000, on y axis written "50 000, 60 000, 10 000". can perform there 50 * 10^3 or else? it's necessary charts several scales here use ticklabelformatter on axis. example: numberformat format = new decimalformat("#.#e0"); yaxis.setticklabelformatter(new stringconverter<number>() { @override public string tostring(number number) { return format.format(number.doublevalue()); } @override public number fromstring(string string) { try { return format.parse(string); } catch (parseexception e) { e.printstacktrace(); return 0 ; } } }); complete example: import java.text.decimalformat; import java.text.numberformat; import java.text.parseexception; import javafx.application.application; import javafx.scene.s

ruby - How to call model method in rails controller -

hi have call model method in controller , view. had done this: category.rb def self.category_list category = self.all.collect { |m| [m.name, m.id] } return category end products_controller.rb def new @product = product.new @category = category.category_list end and in products/new.html.erb <%= form_for @product, action: "create", :html => {:class => "form-group"} |f| %> <div class="fields"> <%= f.label :model_name %> <%= f.text_field :model_name, :class => "form-control" %> </div> <div class="fields"> <%= f.label :model_number %> <%= f.text_field :model_number, :class => "form-control" %> </div> <div class="fields"> <%= f.label :model_number %> <%= f.select(:category_id, @category, :prompt => 'select&

Walking a directory to process two file types in Python -

after checking , processing particular file type (say typea) in directory, if processed typea file outputs txt file (typeb) how concentrate , process typeb txt file before moving next original file typea processing? to clarify have directory of logs like... file1.typea file2.typea file3.typea when run file1.typea file through function generates txt files in same directory, looking process txt files , grab whatever data need , go next original file type file2.typea @ start of loop , repeat process. i have code walking directory, seems unnecessary , bit messy directory walk looking txt files after first typea file processed, see below. for root, subfolders, files in os.walk(path): filename in files: if filename.endswith('.typea'): run_processor_to_txt() root, subfolders, files in os.walk(path): filename in files: if filename.endswith('.txt'): stuff here...

php - How do you send an email from within an AIR Desktop Application? -

i trying allow user send email within air desktop application. @ first tried: navigatetourl(newurlrequest("mailto:someone@example.comsubject=hello&body=sometext"); but opens empty tab in default internet browser. then tried use php file, uploaded on server. php code is: <?php $to = ($_post['recipientemail']); $subject = ($_post['sendername']); $message = ($_post['sendermesssage']); $headers = "from: " . $_post['sendername'] . " <" . $_post['senderemail'] . ">\n"; if(@mail($to, $subject, $message, $headers)) { echo "answer=ok"; } else { echo "answer=error"; } ?> and uploaded on following address: http://xespoofer.comxa.com/mail.php the actionscript side is: var myvars:urlvariables = new urlvariables(); myvars.sendername = settings.companyname; myvars.senderemail =string(settings.settingsxml.setting.@senderemail);; myvars.sendermesssage =

Attach AngularJS directives to live content from jQuery.html() -

i've run issue i've dismay had use update view via jqueries .html function, looks like $('#directory-view').html( response.html ); this adds items table, markup follows <tr data-marked="0" id="file-49" data-id="49" data-folder="0" data-readonly="0"> <td width="30"> <span class="action file"></span> </td> <td class="filename"> readme.txt </td> <td width="200" class="uk-text-center"> text/plain </td> <td width="200" class="uk-text-center"> <span data-uk-tooltip title="15/05/2015 11:17:53">8 minutes ago</span> </td> <td width="100" class="uk-tex

python - Zero or one quantifier (`?`) does not seem to be greedy -

given these 2 test strings: 'eitherxory.' 'justy.' i match 'x' (or nothing, if 'x' not present) , 'y', respectively: ('x', 'y') (none, 'y') the pattern i've come (x)?.*?(y) matches are: (none, 'y') (none, 'y') what doing wrong? i'm using python ( import re; re.search(pattern, line).groups() ) question generic. one option use: (?:(x).*)?(y) we want match .* if have found x , can group them , move optional quantifier outside. avoids case when .* eats characters start of string. keep in mind won't work if x occurs after y in string. use this: (?=.*(x)).*(y)

Facebook event picture resolution Graph Api bug? -

i want event picture by: http://graph.facebook.com/ {eventid}/picture and worked fine while ago (few months ago guess), , set resolution, , resolution of image. now not work, biggest resolution can 200x200 when set type:large. , picture cropped square. what going on? graph api bug? how can download normal picture in usable resolution? the cover field ought full size picture... http://graph.facebook.com/ {eventid}?fields=cover

python - Why does my code continue? -

this code supposed take user input type of shape. take input of height print shape made of *'s (triangle/square now) the code works until user types in bad input start, correct function name , tries close it. ideas how fix it? error: enter shape draw (q quit): sad unknown shape. please try again enter shape draw (q quit): triangle enter size: 6 * ** *** **** ***** ****** enter shape draw (q quit): q goodbye enter size: #this should not there the whole code """ shape programme jordan hampson""" def main(): """main boss function""" shape = input("enter shape draw (q quit): ").lower() if shape == "q": print("goodbye") return else: get_valid_shape(shape) call_shape(shape) main() def call_shape(shape): """calls shape""" size = int(input("enter size: ")) get_valid_

google maps - how to create markers at different point between source and destination in android? -

{ "routes" : [ { "bounds" : { "northeast" : { "lat" : 12.8481608, "lng" : 77.632796 }, "southwest" : { "lat" : 12.7033123, "lng" : 77.5885469 } }, "copyrights" : "map data ©2015 google", "legs" : [ { "distance" : { "text" : "20.0 km", "value" : 19950 }, "duration" : { "text" : "40 mins", "value" : 2383 }, "end_address" : "unnamed road, billiganakuppe, karnataka 562112, india", "end_location" : { "lat" : 12.7033123,