Posts

Showing posts from August, 2014

javascript - Using jQuery to populate ValidatorHookupControl -

i have following form items: medications: <asp:radiobuttonlist id="meds" runat="server" repeatdirection="horizontal"> <asp:listitem value="1">yes (list below)</asp:listitem> <asp:listitem value="0">no</asp:listitem> </asp:radiobuttonlist> medication list: <asp:customvalidator id="val_medslist" runat="server" clientvalidationfunction="check_medslist" onservervalidate="val_medslist_servervalidate" validationgroup="groupsave" validateemptytext="true" errormessage="required" controltovalidate="medslist" enableclientscript="true"> </asp:customvalidator><br /> <asp:textbox id="medslist" cssclass="jquerymedslisttarget" textmode="multiline" runat="server" width="500" maxlength="500" wrap="true" rows

sbt version varies per project directory, on the same OS -

when run sbt on 1 project directory, issues detected sbt version 0.12.1 when starting off. typing about , repeats version. however, running sbt in different project directory identifies version 0.11.3 . this reproduces within same terminal session. version varies per project directory. couldn't find explicit part in build.sbt file cause this. what explain this? in case i'd use sbt 0.12.1 in both cases, how can force version being used later project? the project sbt multi-project , since each subproject separate project can use project/build.properties set different versions of sbt. command project-specific. jacek:~/sandbox/stackoverflow $ mkdir sbt-sample-project jacek:~/sandbox/stackoverflow $ cd sbt-sample-project jacek:~/sandbox/stackoverflow/sbt-sample-project $ tree . 0 directories, 0 files jacek:~/sandbox/stackoverflow/sbt-sample-project $ sbt [info] loading global plugins /users/jacek/.sbt/0.13/plugins [info] set current project sbt-sam

OPENCV convolution for big kernels with size nearly equal to image -

my image of size 107x149. , filter kernel of size 75x75. best way(in terms of speed) convolve image kernel? note : filters non-separable. generic cv::filter2d enough such case. uses dft-based algorithm sufficiently large kernels.

HTML, CSS : Why does my layout mess up on different resolutions? -

i trying make portfolio kind of thing html , css , layout looks on resolution of 1920 * 1080 when change resolution moves around , looks bad. can point out me going wrong code , provide me solution problem? --- edited new code how looks on 1920 * 1080: http://screencast.com/t/mq8h3babxii so have changed advised things i'm still getting that, example, when change screen resolution of 1920 * 1080 1280 * 1024 test how looks comment areas pull on top of grey 'contact me' box ends me picture on link: http://screencast.com/t/xzewsgwdqp <html> <head> <link rel="stylesheet" type="text/css" href="portfoliostyles.css" /> </head> <body> <div id="pagetitlecontact"> contact me</div> <div id="sidebar"> </div> <div id="commentsidebar"> </div> <div id="logos">

ruby on rails - Devise Admin works locally but not on Heroku -

i'm creating app using ruby on rails , devise. i've created user model , admin model , have app working fine when run locally when run on heroku i'm having problems. trouble when try create new admin i'm shown error message says "we're sorry, went wrong." i've done rake db:migrate , heroku run rake db:migrate. when check heroku logs see this: 2013-04-08t19:34:49+00:00 app[web.1]: started "/admins/sign_up" 98.154.183.5 @ 2013-04-08 19:34:49 +0000 2013-04-08t19:34:49+00:00 app[web.1]: processing admins::registrationscontroller#new html 2013-04-08t19:34:50+00:00 app[web.1]: rendered devise/registrations/new.html.erb within layouts/application (431.3ms) 2013-04-08t19:34:50+00:00 app[web.1]: actionview::template::error (undefined method `name' #<admin:0x00000005207678>): 2013-04-08t19:34:50+00:00 app[web.1]: completed 500 internal server error in 549ms 2013-04-08t19:34:50+00:00 app[web.1]: 2013-04-08t19:34:50+00:00 app[web.1]:

Issue with C++ using getline and vector -

i have issue reading line file using getline , using stringstream separate different variables using comma delimiter. issue standard cout of variables shows seatdes properly, using vector name instead of seatdes. not sure why happening. a standard line in file: jane doe,04202013,602,1a #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <cstdlib> #include "reservation.h" int main(int argc, char **argv) { std::ifstream flightfile; std::string name, date, seatdes, flightnum, line; int error = 0, conflightnum; flightfile.open("reservations.txt"); if(!flightfile) { //returns error value if there problem reading file error = 1; return error; } else { //start reading files , sticks them class object , sticks object vector set while (std::getline(flightfile, line)) { std::istringstream ss(line); std::getline(ss, name, '

Does creating an offline package for Visual Studio 2012 Update 2 include updates from Update 1? -

i downloaded vs2012.2.exe , ran via: vs2012.2.exe /layout to offline version of installer. now i'm wondering whether includes whole set of updates ever since rtm of visual studio 2012 or since update 1. the description on download page isn't unambiguous: this update latest in cumulative series of feature additions , bug fixes visual studio 2012. cumulative makes sense, baseline isn't mentioned. from: http://support.microsoft.com/kb/2797912 visual studio 2012 update 2 cumulative release includes new features , fixes delivered in visual studio 2012 update 1.

watir - Concatenating strings with variables with Ruby -

i writing test script opens file list of urls without "www" , "com". i trying read each line , put line url. check see if redirects or exists. my problem when read line file , assign variable. compare what's in url after loading , put in there, seems adding return after variable. basically saying redirect because puts " http://www.line \n.com/". how can rid of "\n"? counter = 1 file = file.new("data/activesites.txt", "r") while (line = file.gets) puts "#{counter}: #{line}" counter = counter + 1 browser.goto("http://www." + line + ".com/") if browser.url == "http://www." + line + ".com/" puts "did not redirect" else puts ("redirected " + browser.url) #puts ("http://www." + line + ".com/"

angularjs - How to separate groups in ng-repeat -

i have items want show, using ng-repeat. want show in order (easy), whenever ordered attribute changes, want html in-between. example: ( fiddle ): <div ng-app ng-controller="main"> <div ng-repeat="item in items | orderby:'role'"> {{item.role}} - {{item.name}} </div> </div> function main($scope){ $scope.items = [{name: 'first', role: 1}, {name: 'second', role:2}, {name: 'third', role: 1}, {name: 'fourth', role: 2}]; } i want print: 1 - first 1 - third (some separator kode) 2 - second 2 - fourth you want create function in scope. $scope.currentrole = 'something'; $scope.createheader = function(role) { showheader = (role!=$scope.currentrole); $scope.currentrole = role; return showheader; } and in html: <div ng-app ng-controller="main"&g

math - Intersecting rectangles with Python -

given 2 rectangles r1 , r2 try test if 2 intersect. why don't following 2 functions produce same output? function 1: def separate_helper(r1, r2): r1_left, r1_top, r1_right, r1_bottom = r1 r2_left, r2_top, r2_right, r2_bottom = r2 if r1_right < r2_left: separate = true elif r1_left > r2_right: separate = true elif r1_top > r2_bottom: separate = true elif r1_bottom < r2_top: separate = true elif contains(r1, r2): separate = false else: separate = false return separate function 2: def separate_helper2(r1, r2): r1_left, r1_top, r1_right, r1_bottom = r1 r2_left, r2_top, r2_right, r2_bottom = r2 separate = r1_right < r2_left or \ r1_left > r2_right or \ r1_top > r2_bottom or \ r1_bottom < r2_top or \ not contains(r1, r2) return separate function check if rectangle 1 contains rectangle 2: def contains(r1, r2): r1_left, r1_top, r1_right, r1_bottom = r1 r2_left, r2_top, r2_righ

c# - Difference between HttpResponse: SetCookie, AppendCookie, Cookies.Add -

there different ways create multi value cookies in asp.net: var cookie = new httpcookie("mycookie"); cookie["information 1"] = "value 1"; cookie["information 2"] = "value 2"; // first way response.cookies.add(cookie); // second way response.appendcookie(cookie); // third way response.setcookie(cookie); when should use way? i've read setcookie method updates cookie, if exits. doesn't other ways update existing cookie well? and following code best practice writing single value cookies? response.cookies["mycookie"].value = "value"; when should use way? it's depends on cookie operation want do. note add , appendcookie doing same functionality except fact appendcookie you're not referencing cookies property of response class , it's doing you. response.cookies.add - adds specified cookie cookie collection. response.appendcookie - adds http cookie intrinsic

layout - Android different button size on real device vs emulator -

Image
my android app looks different on real device (samsung galaxy mini http://www.gsmarena.com/samsung_galaxy_mini_s5570-3725.php ) on emulator. i have latest sdk, avd set 240x320 ldpi (120ppi) my layout: have vertical linerlayout 4 items: 4x horizontal linerlayout <linearlayout android:id="@+id/linearlayoutmainlines" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <linearlayout android:id="@+id/linearlayoutmainline1" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="horizontal" > </linearlayout> .... <linearlayout android:id="@+id/li

xamarin.ios - IOS drawing a simple image turns out blurry using Xamarin C# -

Image
i'm developing in xamarin , draw simple circle text "circle" inside , display image in uiimageview. problem circle , text appear blurry. i've read bit subpixels don't think that's problem. here's blurry image , code, hoping has ideas :) uigraphics.beginimagecontext (new sizef(150,150)); var context = uigraphics.getcurrentcontext (); var content = "circle"; var font = uifont.systemfontofsize (16); const float width = 150; const float height = 150; context.setfillcolorwithcolor (uicolor.red.cgcolor); context.fillellipseinrect (new rectanglef (0, 0, width, height)); var contentstring = new nsstring (content); var contentsize = contentstring.stringsize (font); var rect = new rectanglef (0, ((height - contentsize.height) / 2) + 0, width, contentsize.height); context.setfillcolorwithcolor (uicolor.white.cgcolor); new nsstring (content).drawstring (rect, font, uilinebreakmode.wordwrap, uitextalignment.center); var image = uigraphics.getim

matlab - Low-pass filter in carrier modulation and demodulation -

i'm designing project in array passed through quadrature amplitude modulation (qam) modulator, , carrier modulation, make playable sound() command, demodulate qam demodulation. firstly, have used standard way of qam modulation: m = 16; x = randint(5000, 1, m); y = modulate(modem.qammod(m), x); then, wrote own carrier modulation function: function [out] = carriermodulation(x) fs = 16000; t = 1.0 / 4000; fc = 8000; q = real(x); = imag(x); t = 0:t:(size(x))*t; c1 = zeros(size(x), 1); c2 = zeros(size(x), 1); = 1:size(x) c1(i) = i(i)*sin(2*pi*(fc)*t(i)); c2(i) = q(i)*sin(2*pi*fc*t(i) + pi/2); end out = c1 + c2; no problem far. when done demodulation function, found result different original value (the qam modulator output). function [out] = carrierdemodulation(x) fs = 16000; t = 1.0 / 4000; fc = 8000; t = 0:t:(size(x))*t; a1 = zeros( size(x), 1); a2 = zeros( size(x), 1); = 1:size(x) a1(i) = x(i)*sin( 2*pi*(fc)*t(i)); a2(i) = x(i)*cos( 2*pi*(fc)*t(i));

python - xlrd error when opening Excel files with named ranges -

i'm getting following error message when attempting open workbook using xlrd 0.9.1 on python 3.2.4. tested see causing issue , i've troubleshooted spreadsheet having named ranges. traceback (most recent call last): file "c:\users\mandroid\desktop\xltest.py", line 5, in <module> book = open_workbook(pth) file "c:\python32\lib\site-packages\xlrd\__init__.py", line 416, in open_workbook ragged_rows=ragged_rows, file "c:\python32\lib\site-packages\xlrd\xlsx.py", line 725, in open_workbook_2007_xml x12book.process_stream(zflo, 'workbook') file "c:\python32\lib\site-packages\xlrd\xlsx.py", line 251, in process_stream meth(self, elem) file "c:\python32\lib\site-packages\xlrd\xlsx.py", line 346, in do_defined_names self.do_defined_name(child) file "c:\python32\lib\site-packages\xlrd\xlsx.py", line 335, in do_defined_name nobj.formula_text = cooked_text(self, elem) file

php - preg match on image -

i wondering, have project in person copies link form. link has image , of use guys never trust user input. i narrowed down preg_match() can check there image on link can displayed on site. my question how make sure when checking form, image , not virus .jpg @ end of extension. $url = 'http://foo.bar.com/path.jpg?arg=value#anchor'; if (preg_match("/\.(jpg|png)$/",parse_url($url, php_url_path)){ // code here } this matches filename ends .jpg or .png.... add in parentheses extensions want allow (separated | symbol)

sql - ASP.NET Error: 'System.Data.DataRowView' does not contain a property with the name 'ID' -

this question exact duplicate of: system.data.datarowview' not contain property name 'id' i'm getting weird error after completed steps listed in website below previous problem. 'system.data.datarowview' not contain property name 'id' this error linked gridview after put in datakeynames="id" previous problem: databinding: 'system.data.datarowview' not contain property name the error message telling column called 'id' not present in results set returned select query in sqldatasource assigned gridview. you either need add 'id' column select query (if exists)... select id, <column name>, ..., <column name> <table> etc or alternatively assign datakeynames name of primary key column results set returned sqldatasource assigned gridview.

xaml - How to show custom dialog from Callisto WinRT toolkit? -

my question that. how should show customdialog control callisto toolkit? have following xaml: <controls:layoutawarepage x:name="pageroot" x:class="heronclientwindowsstore.views.suggesteventdialogpage" datacontext="{binding defaultviewmodel, relativesource={relativesource self}}" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:heronclientwindowsstore.views" xmlns:controls="using:heronclientwindowsstore.controls" xmlns:callisto="using:callisto.controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d"> <page.resources> </page.resources> <callisto:customdialog x:fieldmodifier="public" x:name="suggesteventd

java - No text area in JOptionPane window -

is there anyway have joptionpane window without text area scroll bar, jtextarea listbox = new jtextarea(alinefromfile); jscrollpane scroll = new jscrollpane(listbox); listbox.setlinewrap(true); listbox.setwrapstyleword(true); scroll.setpreferredsize(new dimension(200, 400)); joptionpane.showmessagedialog(null, scroll, "dictionary enteries", joptionpane.plain_message); i don't want white background behind text want scroll bar. or anyway make text in text area uneditable. "or anyway make text in text area uneditable."... try: listbox.seteditable(false); also, might better off using jlabel rather jtextarea.

css - html5shiv not working in IE8? -

i can't styles pick in ie8 html5 elements. i've trawled stackoverflow , google, no suggestions i've tried work. i started more elaborate page (i'm converting xhtml framework html5) , wasn't concerned in slightest, after seeing 0 results in emulated , f12 ie8 standards mode ie... here's simple code can't working: <!doctype html> <html> <head> <meta http-equiv="x-ua-compatible" content="ie=edge" /> <meta charset="utf-8" /> <title>template</title> <style type="text/css"> header { display: block; border:1px solid red; } </style> </head> <body> <header> html5 header </header> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> </body> </html

java - What is a good practice of checking InterruptedException? -

i'm new java world, bear me if dumb question. i saw code in run() method of runnable object. try { if (thread.interrupted()) { throw new interruptedexception(); } // if (thread.interrupted()) { throw new interruptedexception(); } // if (thread.interrupted()) { throw new interruptedexception(); } // , on } catch (interruptedexception e){ // handle exception } { // release resource } how often, , should check thread interruption, practice it? it's not sprinkle throughout code. however, if expecting able cancel asynchronous task, may necessary periodically check interruption. in other words, it's typically add after fact when identify body of code needs more responsive interruption.

jquery mobile - Android webview after onJsAlert not responding taps -

i have override webchromeclient's onjsalert behavior like: webchromeclient wvcc = new webchromeclient() { @override public boolean onjsalert(webview view, string url, string message, final jsresult result) { //... return true; } } my application handle js alerts , suppressed original alert. however, after alert event, can no long click buttons(in list-items of listview) on web page in webview. using jquery mobile build web. is there else should aware of? i faced same problem. wanted generate custom android dialog instead of alert, final solution: mywebview.setwebchromeclient(new webchromeclient() { @override public boolean onjsalert(webview view, final string url, string message, jsresult result) { alertdialog.builder builder = new alertdialog.builder( mainactivity.this); builder.setmessage(message) .setneutralbutton("ok", new onclicklistener() {

c# - Getting data from SSAS cube using ADOMD XMLReader -

i have cube , trying retrieve data using following code. don't know number of columns , rows query return. i want read value of each column going on each row. void outputdatawithxml() { //open connection local server. adomdconnection conn = new adomdconnection("data source=localhost"); conn.open(); //create command retrieve data. adomdcommand cmd = new adomdcommand(@"with member [measures].[freightcostperorder] [measures].[reseller freight cost]/[measures].[reseller order quantity], format_string = 'currency' select [geography].[geography].[country].&[united states].children on rows, [date].[calendar].[calendar year] on columns [adventure works] [measures].[freightcostperorder]", conn); //execute command, retrieving xmlreader. system.xml.xmlreader reader = cmd.executexmlreader(); **// how values form each column here ???? // want

c++ - Recursive Function Scanning String to Add ASCII -

so i'm trying figure out how this: write recursive function sum of char's within c string. i'm little rusty in doing normally, got work normal loop: int countstr(string s) { int sum = 0; if(s.length() == 0) { exit(0); } (unsigned int = 0; < s.size(); i++) { sum += s[i]; } return sum; } i can go inside main , this: int main () { cout << "this word adds " << countstr("hello") << " in ascii " << endl; } and works should, counting , adding characters in string via ascii numbers. problem i'm having trying figure out how typed works recursively. know need forgo loop in lieu of calling function itself, don't know use instead of sum += s[i]; have going in loop. i've been looking around in c string library, don't see can replace [i] loop calls up. know should using this? i'm not looking answer in code, need in should using make happen.

Is between two elements in R -

this question has answer here: check elements of vector between elements of 1 in r 4 answers i want check elements of vector = c(0.15, 1.5, 11, 15, 22) is between elements of vector b =c(0, 3, 5, 10, 20, 25) which means second element of vector a between second , third elements of vector b or not, ... not checkig first element of a . how can in r? the following gives want: larger <- a[1:length(a)] > b[1:(length(b)-1)] smaller <- a[1:length(a)] < b[2:length(b)] between <- larger & smaller between[1] <- false a[between] first check whether or not elements in smaller corresponding elements in b. select if smaller next element in b. combine both , remoe unwanted first. tada.

MySQL Error - Unknown column 'xyz' in 'on clause' -

i upgraded mysql version 4 5 , error.. error no : 1054 error : unknown column 'c.city' in 'on clause' `select b.expirydate, a.ben_changed, a.amlnotes, a.processdate, c.phone beneficiaryphone, cpstate.statename collectionpointstate, cpcity.cityname collectionpointcity, cp.agentname collectionpointname, cp.agentaddress collectionpointaddress, cp.agenttelephone collectionpointphoneno, b.postcode customerpostcode, co.countryname bencountryname, st.statename benstatename, ct.cityname bencityname, a.depositbankname depositbankname, b.address customeraddress, b.phone customerphone, a.releasedate, a.releasedby, a.collectiontype, b.mobile customermobile, c.mobile beneficiarymobile, a.releasemessage, a.releaseorder, a.amlnotes, bf.bankname, a.branchname, a.accountno, a.ordertime, h.agentname payingagentname, a.cashcommission, d.agentname officename, a.orderdate, a.orderid, a.orderamount, a.agentcommission, e.username orderby, g.currencycode fromcurrency, f.c

dom - PHP memcache internal objects -

i have googling while , found nothing. when dealing internal objects such dom or pdo, possible cache them using memcache? i understand pdo irrelevant because connection closed @ end of script - changed persistent connections -- making caching more feasible??? whats bothering me though, lack of documentation on whether possible cache in-memory representation of dom objects. xml config files quite verbose , loading these per request, constructing dom, way heavily on server resources. anyone have experience caching, dom objects? should opt php implementation of dom re-parsing, initializing dom isn't necessary each request? you can cache pdo instance. have extend pdo class , implement __wakeup , __sleep magic method. the __sleep() method called before serialize() , __wakeup during unserialize() (it's not precised when on manual). you use __wakeup method reestablish connection after unserialization memcache. i don't think there lot of interest i

iphone - ios--When the system displays high-quality pictures -

in app, using iphone 6 simulator , xcode 4.6. i've added background imageview app, here have 2 pictures, mypic.png(320*480) , mypic@2x.png(640*960), system displays mypic.png pictures when system displays high-quality pictures. can tell me,thanks! when run project on retina display display 2x image instead small image. , have write code this. uiimageview * imageview = [[uiimageview alloc] initwithframe:cgrectmake(270, 17, 30, 30)]; imageview.image = [uiimage imagenamed:@"mypic"]; dont write extension of image display image according screen.

CodeIgniter, Having problems locating thumbnail image after resize on Amazon EC2 Instance -

i having problems generating thumbnail image on amazon ec2. it works fine on local machine, error occurs when deployed amazon ec2 the error/warning try upload thumbnail amazon s3 , original image upload fine. severity: user warning message: s3::inputfile(): unable open input file: /tmp/file_name_thumb.jpg filename: libraries/s3.php line number: 263 the code controller is //this config first image $config['upload_path'] = sys_get_temp_dir(); // tried switching '/tmp'; $config['allowed_types'] = 'jpg|png'; $config['max_size'] = '500'; $config['max_width'] = '0'; $config['max_height'] = '0'; $config['overwrite'] = true; $this->load->library('upload', $config); $this->load->library('image_lib'); //then upload $data = array('upload_data' => $this->upload->data()); // 2nd config resize $config = array( 'source_image' => $data[&

php - Date stored in excel becomes a number while reading and storing in mysql -

this question has answer here: date excel changes when uploaded mysql 1 answer i'm using script read data excel file , store in mysql database table. it's working fine except field 'date' store in excel in "mm-dd-yy" format. problem "02/26/2014" becomes "41696" when comes php.. i want store field in "mm-dd-yy" format in mysql database table.. how can fix this? highly appreciated.. in advance. what formatting date date function , convert string strtotime ? something like: $str = '02/26/2014'; $date = date('y-m-d h:i:s',strtotime($str)); echo $date; this output: 2014-02-26 00:00:00 in case need use function in different way: $str = '02/26/2014'; $date = date('m-d-y',strtotime($str)); echo $date; this output instead: 02-26-2014 this way dates ready

asp.net - How to access webservice hosted in lIS from LAN connected Other PC? -

i have created 1 webservice have hosted in iis, want access or call webservice lan connected pc. so please me out. things have tried : ping check connectivity using ipaddress tried access other pc - errors have got - connection timeout unable connect host e.g : http://192.168.100.157/newwebservice/webservice1.asmx try adding following code in config file: <client> <endpoint address="http://192.168.100.157/newwebservice/webservice1.asmx" binding="basichttpbinding" contract="classabc" bindingconfiguration ="httpbinding" name="basichttpbinding_iabc" /> </client>

c# - How can I catch a bound data updated event? -

i writing app windows 8 , have ui class called groupeditemspage inherits layoutawarepage contains data : this.defaultviewmodel["groups"] = sampledatagroups; each item in sampledatagroups binded tile in ui , sampledatagroups class inherits bindablebase , each property set using set{this.setproperty(ref this._property, value); } what able catch general event in ui class groupeditemspage each time property in sampledatagroups changed (so can rewrite sampledatagroups file). i've done research , i've found how notify event caught sampledatagroups, not if want sampledatagroups notify groupeditemspage ? your page should not writing data file. it's more of duty of view model or model rather. if have though need subscribe propertychanged event declared type of sampledatagroups variable , handle event in page object.

Extract number from string using regex in java -

i fail extract (double) number pre-defined input string using regular expression. string is: string inputline ="neuer kontostand";"+2.117,68"; for parsing number need suppress leading + while keeping optional - . in addition must cut off " before/after number. of course multi-step string-operations, know how in more elegant way using 1 regular expression? what tried far: pattern p = pattern.compile("-{0,1}[0-9.,]*"); matcher m = p.matcher(inputline); string substring =m.group(); pattern.compile("-?[0-9]+(?:,[0-9]+)?") explanation -? # optional minus sign [0-9]+ # decimal digits, @ least 1 (?: # begin non-capturing group , # decimal point (german format) [0-9]+ # decimal digits, @ least 1 ) # end non-capturing group, make optional note expression makes decimal part (after comma) optional, not match inputs -,01 . if expected input always has both parts (before , after

google maps - GoogleMaps JS API v3 not working in iOS -

i using google maps java script api v3 in ios. first created sample html hello world example in page https://developers.google.com/maps/documentation/javascript/tutorial i used proper google maps api business client id. working fine when launch html page. but same not working when load same html page in ios project creating webview , loading view html page. i getting following error "google has disabled use of maps api application. site not authorized use google maps client id provided. if owner of application, can learn more registering urls here: https://developers.google.com/maps/documentaion/business/guide#urls " do nee ios projects ? as mentioned in previous comments, in order use google maps business webview within ios or android app, have register appropriate urls in google console. these urls begin 'file://' , @ time cannot entered users. google representative can these urls registered on behalf. are: <= ios7 -- file:///var/mobile

c# - Why can Controls be found on an OnClick Event, but not in Page Load? -

so i'm assuming has page lifecycle, , maybe controls aren't yet bound on page load? i'm still learning asp.net page lifecycle, when binding occurs, when can access data , when it's early/late, etc. i'd explanation on why following won't work. assuming method recursively searches controls, beginning repeateritem, looking textbox, so... private void findmytextbox() { foreach (repeateritem repeated in myrepeater.items) { textbox txtpercentage = (textbox)findcontrolrecursive(repeated, "txtpercentage"); . . . } } ....where.... public static control findcontrolrecursive(control root, string id) { if (root.id == id) { return root; } return root.controls.cast<control>() .select(c => findcontrolrecursive(c, id)) .firstordefault(c => c != null); } ...why work called method bound onclick event, like.... <asp:button id="btnsubmit" runat=&

bitbucket - Get list of pull requests in Repository -

i want pull requests in repository seems impossible. able find pull requests comments ( https://confluence.atlassian.com/display/bitbucket/pullrequests+resource ) how 1 use resource if cannot request ids? there way pull requests? the new api out , list of pull requests works fine https://bitbucket.org/!api/2.0/repositories/your_name/repo_name/pullrequests

php - How Can I access Database From One server -

i have website abc runing on 1 server online , , have library inventry system 'xyz' in php runing on server have static ip 203.215.166.77, question how can access database abc xyz in php mysqli $mysqli = new mysqli('10.0.0.1', 'user', 'password', 'db', 'port ( imporant external connection '); mysql $link = mysql_connect('10.0.0.1:port', 'user', 'password'); you need open port database other server. can in firewall ( default port 3306 )

android - Corona will generate native code? -

does corona generate native code both iphone , android or interpret lua code.can tell me in detail. from faq : the corona client requires internet connection build because part of build process happens on corona labs servers. lua script precompiled bytecode (stripping out comments, debug information, etc) before gets sent our server. server embeds data corona engine, never saves or archives it. end of online build process, have .app bundle or .apk file if had used ios or android sdk yourself.

privacy - How to start vim in "private mode" -

modern browsers have feature called "private mode" or "incognito mode". trying same thing vim, i.e. run in way no traces of activities left behind. way able e.g. use vim open file containing sensitive information stored in encrypted volume without having worry information leaked. here's have done far: alias vim_private="vim -i none --cmd 'set noswapfile' --cmd 'set nobackup'" i have in .bashrc. rationale above: -i none no filenames or register contents leaked through .viminfo --cmd 'set noswapfile' prevent creation swap file --cmd 'set nobackup' no backup files is there else i'm missing? there other ways vim leak information? your settings fine. i'm not sure whether plugins loaded when invoke vim vi , several plugins (that e.g. provide mru functionality) store information (usually in ~/.vim... files), too. load can avoided through --noplugin . also, paranoid, $viminit , :set exrc

sencha touch 2 - How to add values in existing array dynamically in senchatouch2 -

using push() method added values in array,but when add again using push() values added in separate array..how add values in existing array dynamically?kindly provide sample piece of code declare array globally var arr = []; then add values inside array using push() method like, arr.push(ext.getcmp('id').getvalue()); like can add values in existing array dynamically..

Using AngularJS within Haml views of a Rails app -

i have rails app haml views. want add angularjs parts of application, problem haml views rendered server-side , angularjs code not working, because rendered client-side. let's have in index.html.haml: !!! %html{"ng-app" => "test"} %head %script{:src => "http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.js"} :javascript function clock($scope) { $scope.currenttime = new date(); } %title welcome angularjs %body %h1 hello, world. %p{"ng-controller" => "clock"} current time {{currenttime | date:'h:mm:ss a'}}. so currently, it's printing out within curly brackets without processing it. there solutions situations complete view replaced angularjs template. want use angularjs small bits of functionality in rails app. ideas how solve this? john, i have edited code bit here: http://codepen.io/anon/pen/vkiwh %html{"ng-app"=>true

sql - subtract values of two rows and inserting it into a new column (not subsequent rows) -

relevant previous question here: how insert subtract of each 2 subsequent rows , inserting new column i have question. in following table; want calculate amount of time have passed each user's last winning in competition. in fact should subtract last winning date current date. (place=1) indicative of winning. the current table: http://www.8pic.ir/images/75206897877200828586.jpg the result want: http://www.8pic.ir/images/78832309907063712878.jpg i wrote following query question (according answer got previous question here ) ! problem many duplicate rows! have 4000 rows, when run query 40,000 rows! problem! please me. , negative value users have not won before. want these fields null. ;with [cte15853354] ( select [user-name], [submissions], [date], [place], [recency], row_number() on (order [user-name], [date] desc) [rownumber] dbo.[top-design1] ) select t.[user-name], t.[submissions], t.[date],

java - Unable to convert client value 'null' back into a server-side object -

this question tapestry components issue. i'm looking solution of issue , not workaround or alternative ways, how implement interface. consider ajaxformloop element on tapestry form: <tr t:type="ajaxformloop" t:id="items" source="getitems()" value="item"> ... </tr> getitems() method inside class returns synthetic combination ( list interface) of persisted objects , not-yet-persisted newly added items (with null id inside them). when submitting form receive error: unable convert client value 'null' server-side object this error occurs before onsuccessfromsave() method ( save id of submit link). i wonder, how can manage such not-persisted objects ajaxformloop prevent such error. actually, want save (in db) these items inside onsucceccfrom...() method. what have missed here? actually i've missed custom valueencoder ajaxformloop container. mentioned error produced default enco

php - why my script doesn't get value that I purpose -

in web there table content give static value this <?php include 'config/koneksi.php'; ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>lay out penempatan produk uht area gudang rak a-f</title> <link rel="icon" href="http://localhost/wifi/images/rsup.png"> <link rel="stylesheet" type="text/css" href="css/popup-window.css" media="screen"> <script type="text/javascript" src="js/popup-window.js"></script> <script type="text/javascript" src="js/jquery-1.8.3.js"></script> <script> function setvalue(values) { document.getelementbyid('posisi').value = values; } </scrip