Posts

Showing posts from April, 2015

html - ng-click/onClick not working on <object> -

i'm not able invoke functions when click on image present in tag. particularly, want zoom , pan image. these functions work image tag not object tag. i've put debugger on functions called 'on click' , have put alert pop ups on click none of them seem work. how can them working? below code. <object ng-click="zoomservice.activatezoomandpan();" tb-refresh-graphic="tocservice.acti‌​ve_node.activegraphic"> </object>

sprite kit - How Do I Reconfigure Coordinate Plane in Swift -

i experimenting spritekit. template, opens override fun touchesbegan(touches: set<nsobject>, withevent event: uievent) it creates variable stores touch position on screen. when click on screen in area should (0,0) cgpoints off near 120? how can recalibrate , position scene @ (0,0)? after experimenting bit have found fix issue. scene size default (1024, 768) , view size default (667, 375). this code fixes problem: scene?.size = self.view!.frame.size i concerned should have configure , feel missing configuration setting on creation of project. forgot set default xcode or missing something?

selenium - Practice webdriver , need application -

i need application practice selenium webdriver. can suggest me applications can work offline. note: please don't refer actitime. there issue installing it. for offline try https://github.com/eviltester/seleniumtestpages for online http://www.toolsqa.com/automation-practice-form/ http://www.way2automation.com/demo.html hope helps you..

javascript - Find closest element by attribute -

i have vote snippet, , i'd add disabled class other button user press. example if user vote + on id 1 post - button disabled class, not id 2 ones. <span class="pull-right"> <a href="javascript:void(0)" class="vote" data-id="1" data-type="up">+</a> <span id="votes-1">0</span> <a href="javascript:void(0)" class="vote" data-id="1" data-type="down">-</a> </span> <span class="pull-right"> <a href="javascript:void(0)" class="vote" data-id="2" data-type="up">+</a> <span id="votes-2">0</span> <a href="javascript:void(0)" class="vote" data-id="2" data-type="down">-</a> </span> i tried several things .closest()...

css - Why are my link texts different colors? -

my web page has css: html.light .auth .authinput .authlink { color: #007fff; } and html: <a class="authlink" .... ></a> what notice in 1 place link blue , in place link purple. can tell me why different color? because purple 1 stands visited . make go away add :visited pseudo selector this: html.light .auth .authinput .authlink:visited { color: #007fff; } this ensure link same color after you've visited it. , visited mean clicked on it. generally want cover entire "love hate" of links: html.light .auth .authinput .authlink:link { color: #007fff; } html.light .auth .authinput .authlink:visited { color: #007fff; } html.light .auth .authinput .authlink:hover { // color } html.light .auth .authinput .authlink:active { // color } "love hate" means should define :link , :visited , :hover , :active in correct order. it's helper reminding order specify them in. (lvha)

python - Django doesn't recognise keyword blank on child of forms.Form -

i'm trying create form receive empty strings in of values. form not backed model object. i've defined thus: class searchform(forms.form): device = fields.charfield(blank=true) min_release_date = fields.charfield(blank=true) price_range = fields.charfield(blank=true) has_in_app_purchases = fields.charfield(blank=true) except when try run test: def test_valid_no_data(self): webanalytics.web.search import any_price, default_dates, has_iap_ids form_data = { 'price_range': any_price[0], 'min_release_date': default_dates[0], 'has_in_app_purchases': has_iap_ids[0] } search = searchform(form_data) self.asserttrue(search.is_valid()) i following exception: error: failure: typeerror (__init__() got unexpected keyword argument 'blank') ---------------------------------------------------------------------- traceback (most recent call last): file "/usr/local/lib/python2.7/dist-pac...

Rotate compass in smooth way issue android -

this code use sensor class , other activity but want compass rotate in smooth way use bitmap image on canvas bitmap not rotate in smooth way public class compassview extends view { private int mwidth; private int mheight; private float position = 0; private bitmap mycompasspointer; public compassview(context context) { super(context); mycompasspointer=bitmapfactory.decoderesource(getresources(), r.drawable.pin_finder); } @override protected void ondraw(canvas canvas) { int cx = (mwidth - mycompasspointer.getwidth()) >> 1; int cy = (mheight - mycompasspointer.getheight()) >> 1; if (position > 0) { canvas.rotate(position, mwidth >> 1, mheight >> 1); } //it set bitmap cx,cy position canvas.drawbitmap(mycompasspointer, cx, cy, null); canvas.restore(); } public void updatedata(float position) { this.position = position; invalidate(); } protected void onmeasure(int widthmeasuresp...

mysql - How to write if else condition in sql -

in following sql, how can add if-else control structure. select tblcabbooking.id id, concat(tblcabstatus.`status`,' ', ifnull(concat("(inr",tblbookingcharges.totalbill,")"),'')) `status`, tblcomplaint.id com_id, tblcomplaint.statusid com_status, tblcabbooking.csr_id emp, concat(tblcabbooking.dropaddress,tblcabbooking.droparea) drop_area, tblbookingcharges.totalbill, tblcabbooking.booking_reference ref, tblmasterpackage.master_package booking_type, concat(tblcabbooking.pickupdate," ",tblcabbooking.pickuptime) ordertime, concat(tblclient.clientname," ",tblappid.`type`) partner, concat(tblcablistmgmt.name,', ',tbldriver.firstname,"(",tbldriver.contactno,")") vehicle, concat(tbluserinfo.firstname,"(",tbluserinfo.mobno,")") clientname, concat(tbldriver.firstnam...

android - Disable dragging in MPAndroidChart PieChart -

how can disable dragging gesture in piechart . want chart static image. try chart.settouchenabled(false); more details can found here .

wcf - Where is the request model in this vendor WSDL? -

i'm attempting create user accounts vendor tool in batches. asked vendor how turn on mex endpoint creating single account , adjusted config file accordingly. i able create service reference, have in visual studio client , 2 interfaces. can't tell how create request. client has invokeservice method, takes object. i replicated vendors class structure in code, service didn't type. so, updated classes use vendor's original namespace, service still didn't it. type 'life.businessservice.basebusinessdatamodel.businessrequest' data contract name 'businessrequest:http://schemas.datacontract.org/2004/07/life.businessservice.basebusinessdatamodel' not expected. consider using datacontractresolver or add types not known statically list of known types - example, using knowntypeattribute attribute or adding them list of known types passed datacontractserializer. here's wsdl service. i'm not strong in wcf, i'm hoping guidance. thanks! <...

django - Url paramter with a value with two words -

i have problem calling url, want know whats way pass value 2 words argument or if question not possible i have in url.py: url(r'^tiendas/([\w-]+)/$', mostrartiendas.as_view(), name='mostrartiendas'), i want pass value called name_tienda field have 2 word , django return error: page not found (404) request method: http://localhost:8000/tiendas/tienda%20amiga thank all change url regex this: url(r'^tiendas/(?p<name_tienda>[-\w]+))', mostrartiendas.as_view(), name='mostrartiendas'),

updating a record at runtime using jdbc -

i have problem updating password @ runtime. gives no error doesn't work. please . in advance! here code: //here problem part not working try { system.out.println("id : "+j); system.out.println("what want new password be?"); scanner s8=new scanner(system.in); string s7=s8.nextline(); class.forname("com.mysql.jdbc.driver"); connection con5=drivermanager.getconnection("jdbc:mysql://localhost:3306/login","root","q"); preparedstatement ps=con5.preparestatement("update pass set password=? id=?"); ps.setstring(1,s7); ps.setint(2,j); } catch(exception e) { system.out.println(e); } you miss execution of statement using preparedstatement.executeupdate() . javadoc executes sql statement in preparedstatement object, must sql data manipulation language (dml) statement, such insert, update or delete; or sql statement returns nothing, such ddl state...

php - Column value's string length reduced by one when the value has a Quote -

hi have table "comments" , here has field called "comment_text" , insert comment table $query="insert `comments` (`id`, `comment_text`, `date`) values ('', '".sprintf("%-70s",mysql_real_escape_string(ucwords(trim($strtitle63_5))))."', '$date')"; as can see setting comment length fix 70 characters (always original comment less 70 characters.) everything works fine unless insert value quote , if insert comment quote , in database table can see 69 characters . example : i insert these 2 comments comment 1 : "flat rate overlaps flat rate code" comment 2 : "claim details don't match bsi/bri guidelines" later when try check string length . comment 1 70 , comment 2 69. there reason ? every comment has quote gives me issue . :( . thanks in advance . update my code model function get_coc5_comment_details() { $this->db...

android - My TabHost HAS a FrameLayout with that id -

this code: tabhost = (fragmenttabhost) findviewbyid(r.id.tabhost); tabhost.setup(this, getsupportfragmentmanager(), r.id.tabcontent); tabhost.addtab(tabhost.newtabspec("tab1").setindicator("lengüeta 1"), tab1.class, null); tabhost.addtab(tabhost.newtabspec("tab2").setindicator("lengüeta 2"), tab2.class, null); tabhost.addtab(tabhost.newtabspec("tab3").setindicator("lengüeta 3"), tab3.class, null); in xml: <android.support.v4.app.fragmenttabhost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <tabwidget ...

sql - How to apply aggregate function only on contiguous rows? -

on postgresql 9.4, i'm trying achieve i'll call "aggregate function" on contiguous rows. example: input data: recipe prod1 prod2 timestamp 0 5 4 2015-07-02 08:10:34.357 0 2 7 2015-07-02 08:13:45.352 0 7 0 2015-07-02 08:16:22.098 1 3 2 2015-07-02 08:22:14.678 1 9 4 2015-07-02 08:22:56.123 2 2 6 2015-07-02 08:26:37.564 2 1 7 2015-07-02 08:27:33.109 2 0 8 2015-07-02 08:31:11.687 0 3 5 2015-07-02 08:40:01.345 1 4 2 2015-07-02 08:42:23.210 desired output: recipe prod1_sum prod2_avg timestamp_first timestamp_last 0 14 3.6666 2015-07-02 08:10:34.357 2015-07-02 08:16:22.098 1 12 3 2015-07-02 08:22:14.678 2015-07-02 08:22:56.123 2 3 7 2015-07-02 08:26:37.564 2015-07-02 08:31:11.687 0 ...

android - Calling a fragment method inside a custom view -

so background i've tried call method have in fragment (that's hosting custom view) within custom view. i've tried using interface , implementing in fragment. i've tried getting instance of fragment in customview , calling method way. whatever reason, null pointers both ways. way #1 public surveyview(context context, attributeset attrs) { super(context, attrs); setorientation(vertical); options = new arraylist<>(); //updatepolls interface. updatepolls = new multiplechoicepollfragment(); } public interface updatepolls { void update(); } then call method in onclicklistener: v.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { (int p = 0; p < options.size(); p++) { if (options.get(p) == v) { setanswers(p); updatepolls....

How to concatenate two class arrays to an allocated space in c++ -

i have 2 class arrays, each 1 pointer pointed to. wonder possible concatenate these 2 arrays new allocated space. in mind std::copy(). possible use copy()? or other idea? just create new array , iteratively copy each old array new array using loops

How to dynamically deny access using .htaccess -

i familiar denying access based on ip, block of ips, browser, url etc... problem here is, let me state, how deny access if came ip address, @ least 3 times second long period of time. here, don't know ip address unless @ access file. time found out ip address it's drawn of bandwidth. you can't use htaccess doing this. out-of-box apache directives can't handle browsing sessions. you'll need install sort of log parser, maybe fail2ban ? or can cook set of iptables rules blocking lots of connections 1 ip: https://askubuntu.com/questions/437059/linux-command-to-prevent-dos-attack-by-using-netstat-and-iptables

android - How to handle SharePhoto result with Callbackmanager? -

my users posting photos facebook , want know that. in last sdk used code callback: uihelper.onactivityresult(requestcode & 0xffff, resultcode, data, new facebookdialog.callback() { @override public void oncomplete(facebookdialog.pendingcall pendingcall, final bundle data) { iscomplete = facebookdialog.getnativedialogdidcomplete(data); (bitmap bitmap : images) { getridofbitmapifneeded(bitmap); } //get rid of stored references bitmapss images.clear(); if (iscomplete) { string completiongesture = facebookdialog.getnativedialogcompletiongesture(data); if (completiongesture == null || facebookdialog.completion_gesture_cancel.equals(completiongesture)) { //show publish cancel toast log.d("facebook iscomplete", "user canceled"); setreadytoclick(); } else { string id = data.getstring(...

yii - how to serve the CSS as a result of a controller action in yii1 -

i want users have feature users can select color, font ,font size, font color etc. below theme.php file php file containing css. <?php header('content-type:text/css'); ?> <style> .btn-default.btn-icon.btn-lg i{padding:10px 10px;font-size:<?php echo $size; ?>;line-height:1.33;border-radius:3px;color:<?php echo $color; ?>} </style> how call this, values of $color, $size can taken database. have table called templates fields parameter name , parameter value. want use values table. in controller or view file, can add: $css = <<<eof .btn-default.btn-icon.btn-lg i{padding:10px 10px;font-size:{$size};line-height:1.33;border-radius:3px;color:{$color}} eof; yii::app()->getclientscript()->registercss('your-color', $css);

javascript - Using HTML file to Query a Google Spreadsheet using a Textbox for Query, using App Script -

i have spreadsheet have more 1000 lines, each column field, 1 of columns has field called domain, "which value need query", application using html need query using text box html function, search spreadsheet , return values of same line in html. now here html code: <html> <head> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/0.10.0/angular-material.min.css"> <link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.blue-green.min.css" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.js"></script> <script src="//ajax.googleapis.com/ajax/libs/a...

ruby on rails - How to call a helper method in view -

i have code in helper: def app_state(app) state = app.operator_apps.map(&:is_production) if state.include?(true) , state.include?(false) "sandbox/production" elsif state.include?(true) "production" else "sandbox" end end and in view have done this: <%= app.app_state %> i following error: actionview::template::error (undefined method `app_state' #): please me out in solving this. the error getting persist unless app_state method defined somewhere within app 's model. try calling helper method so: <%= app_state(app) %> now app object being passed in argument of app_state method, instead of method being called on object itself. hope helps!

sql - How to select values as a list in PostgreSQL and Oracle Database? -

i have table values given below: name app_pgm_apply status p1 ap p3 dn p5 ap b p2 pe b p3 ap c p1 ap d p2 dn i want select user applied program list. a {p1,p3,p5} b {p2,p3} c {p1} d {p2} can tell me how retrieve values list? i saw in sql here . didn't how use postgresql postgres has array_agg function: select name, array_agg(app_pgm_apply) mytable group name oracle, on other hand, has listagg function: select name, listagg(app_pgm_apply, ',') within group (order app_pgm_apply) mytable group name

join - Using a Spring RowMapper in order to populate a field of type Collection from a JDBC resultset -

i trying map jdbc resultset pojo using spring rowmapper follows: public class advertisementmapper implements rowmapper<advertisement> { @override public advertisement maprow(resultset rs, int rownum) throws sqlexception { advertisement advertisement = new advertisement(); advertisement.setid(rs.getlong("id")); advertisement.setadvertisementtype(advertisementtype.valueof(rs.getstring("advertisement_type"))); advertisement.setneed(need.valueof(rs.getstring("need"))); advertisement.setchildcareworkertype(childcareworkertype.valueof(rs.getstring("childcare_worker_type"))); advertisement.setchildcaretypes(null);//collection! advertisement.setdaytotimeslots(null);//collection! advertisement.setlanguages(null);//collection! advertisement.setdescription(rs.getstring("description")); advertisement.setcreationdate(rs.getdate("creation_date...

Android: keyboard numeric changes automatically to keyboard text alone -

i have simple item renderer standard listview. in item renderer have 2 edittext configure that: <edittext android:layout_width="40dp" android:layout_height="wrap_content" android:inputtype="number" android:selectallonfocus="true" android:text="8"/> when click first on 1 of these edittext, numeric keyboard appears 1 second, changes automatically standard text keyboard... don't know why! if click new time on 1 of these, numeric keyboard appears , it's ok (no change). actually, problem appears if there no open keyboard. have got idea? thank much! how check if java code have setinputtype() on edit first? if still have no clues, try method profile app or keyboard , check who's calling setinputtype() kind-a method can helpful.

python - Does precondition assertion testing replace assumptions in a function specification or vice versa? -

i'm confused when use assertion testing in python functions. if specify assumptions regarding input arguments function, should assume correct input being fed function or should use assertions check conditions on input args enumerated in specification? if you're writing "public" function, believe pythonic way check arguments (using if , not assert ), and, if they're invalid, raise exception type , info / message designed provide info possible. if you're writing function designed internal use, using assert check arguments seems idea me.

How do I share ansible variables across hosts using vars_prompt -

in ansible, code on remote machine, , want use result vars_prompt again on different host. i've searched around, , docs make sound should use {{ hostvars.local_server_name_in_vagrant_group.local_username }} , using example below set context. however, says index dictionary doesn't exist when referencing hostvars . instead, shown below, vars_prompt twice. gross! tips? btw, there's discussion on whether or not using vars_prompt great idea. have confirmed usage, indeed, want use vars_prompt. thanks! - hosts: vagrant vars_prompt: local_username: "enter desired local username" ... remote task activity using local_username... - hosts: localhost connection: local vars_prompt: local_username: "enter desired local username, again (please) ... host task activity, using local_username ... as said in comment question : you can use set_facts register variable fact of current host , access different one. not think standard ...

vba - How can i set the name of a textbox in publisher? -

i want set name of text box can accessed code. e.g i looking editing field similar this thanks there's properties window can accessed each of controls on ui. there may rename controls. (since not seem have vba code yet , want rename control ui) the other alternative. record macro, changes textbox (e.g. resize, change text etc). check programme assigned default name of textbox vba editor. said, can access control via default name , utilizing vba code (as said), rename textbox.

javascript - Passing parameters to Anonymous function inside click event -

var div_raw_id = 'acf-download-link'; var div_id = '#' + div_raw_id; var chapter_index = 1; var chapter = 'chapter-' + chapter_index; $('button[name=addnewchapter]').click(function(chapter, div_id ,div_raw_id){ $(div_id).append('<div class="acf-input-wrap"><input id="' + div_raw_id +'" class="text" name="fields[field_55951fb44c1d6][' + chapter + '][]" value="" placeholder="" type="text"><span class="remove_btn"></span></div>'); return false; }); the problem cannot pass div_id , chapter_index , chapter parameter anonymous function inside click event. used debugger , debugger represents them undefined values though defined in above code. seems there variable scope problem, however, cannot figure out other way pass defined variables parameter anonymous function inside click event. you don't need...

How can I do an explode in GridView in Yii framework, PHP? -

Image
this query: select p.name p_name, p.id pid, p.description p_description, group_concat(r.id separator ',') rids, group_concat(r.name separator ',') rnames `profiles` p left join rights r on p.id = r.profile_id p.app_id = 8 group p_name and gridview: $this->widget('gridview', array( 'dataprovider' => $apps_list, 'id' => 'my_grid_view', //'filter' => $filtersform, 'itemscssclass'=>'table', 'columns' => array( array( 'name' => 'rights', 'type' => 'raw', 'value' => 'chtml::tag("div",array(),"<span>".$data["rnames"]."</span>")', // 'value'=> 'chtml::encode($data["rnames"])', ...

android - How to get image name from imageview -

i have imageview has image loaded in it. way // create bitmap resource bitmap bm = bitmapfactory.decoderesource(getresources(), r.drawable.profile_blank_xlarge); // set circle bitmap imageview mimage = (imageview) layout.findviewbyid(r.id.image); mimage.setimagebitmap(getcirclebitmap(bm)); i want able find out name of image in imageview once application run. i tried doing mimage.gettag() name of image in imageview crashes app. correct way name of image in imageview crash details --------- beginning of crash 07-02 13:11:37.259 2096-2096/com.example.kmi_dev.fbloginsample e/androidruntime﹕ fatal exception: main process: com.example.kmi_dev.fbloginsample, pid: 2096 java.lang.runtimeexception: unable start activity componentinfo{com.example.kmi_dev.fbloginsample/com.example.kmi_dev.fbloginsample.myactivity}: java.lang.nullpointerexception: attempt invoke virtual method 'java.lang.string java.lang.object.tostring()' on null object reference ...

Why decorator-style context manager in Python doesn't catch exception within Tkinter window? -

there simple code decorator-generated context manager via contextlib. when press button exception raised , not handled context manager. why it? from tkinter import tk, button contextlib import contextmanager def close_window(): window.destroy() raise exception @contextmanager def safe(): try: yield except: print 'exception catched' safe(): window = tk() button = button(window, text='press me', command=close_window) button.pack() window.mainloop() why exception still raise? upd use python 2.7 the tkinter main process loop not brought down exceptions , not propagate them further. hence, exception never reaches till with statement (since tkinter catches , reports exception , stops execution). you need create decorator catch exception , log them or whatever logic want do. example - from tkinter import tk, button contextlib import contextmanager class exceptioncatcher: # <---the decorator ...

excel vba - NumberFormat VBA With User-Defined Data -

Image
i working on workbook has set number of template calculations used multiple times across scope of copied workbook. form object created user enter identifier each calculation set meets specific format. follows "aaa-##0.00" 'aaa' string of 1 3 letters. form has combo box cleared , populated on activation contains 258, customer-provided text possibilities (to reduce probable user error) text box adjacent entering digits. when "execute" button clicked, identifies selected calculations required user form, copies template worksheet(s) end of workbook, , populates identifier information @ bottom of list on contents page. here relevant code: dim prefix string dim locmp double 'the digits entered in txtlocmp locmp = val(txtlocmp.value) 'mpprefixlst combo box, 'prefix' being desired custom format prefix = mpprefixlst.text & "-#0.00" when debugging, values stored in 'locmp' , 'prefix' appear satisfactory locmp bei...

c# - Linq XML add new parent -

with linq xml possible add new father existing nodes? take xml excerpt: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <items> <book> <title>title 1</title> <author>author 1</author> </book> <book> <title>title 2</title> <author>author 2</author> </book> <car> <model>tesla</model> </car> </items> is possible add new father "books" book this: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <items> <books> <book> <title>title 1</title> <author>author 1</author> </book> <book> <title>title 2</title> <author>author 2</author> </book> </books> <car> <model>tesla</model> </car> </items> this not working because cl...

java - What does node class do in LinkedList class -

Image
i trying understand how java creating nodes i.e. making linked list.so checking linkedlist.java file , saw inner node class in linked list class inner node class responsible creating nodes? also when use class object created linkedlist class or node class? public class linkedlist<e> extends abstractsequentiallist<e> implements list<e>, deque<e>, cloneable, java.io.serializable { private static class node<e> { e item; node<e> next; node<e> prev; node(node<e> prev, e element, node<e> next) { this.item = element; this.next = next; this.prev = prev; } } p.s not duplicate trying understand node class doing in built in linkedlist class double linked list .in other question creating new singly linked list the innner node class not responsible creating nodes. is node, or represents node in linked list. since items can , linkedlist wants link items (know before , ne...

regex - How to block all accesses, except three IPs, to an absolute URL with htaccess? -

how block accesses, except 3 ips, absolute url htaccess? example data: http://subdomain.example.com/url/i/want/to/block ips: 10.10.10.10 10.10.10.11 10.10.10.12 this code: rewritecond %{request_uri} http://subdomain.example.com/url/i/want/to/block rewritecond %{remote_addr} !=10.10.10.10 rewritecond %{remote_addr} !=10.10.10.11 rewritecond %{remote_addr} !=10.10.10.12 rewriterule ^.*$ /index.php [r=302,l] and it's not working. i'm accessing url ip. you can't match protocol , port etc in request_uri . have way: rewritecond %{http_host} =subdomain.example.com rewritecond %{remote_addr} !=10.10.10.10 rewritecond %{remote_addr} !=10.10.10.11 rewritecond %{remote_addr} !=10.10.10.12 rewriterule ^url/i/want/to/block /index.php [r=302,l,nc] or using regex character class: rewritecond %{http_host} =subdomain.example.com rewritecond %{remote_addr} !^10\.10\.10\.1[0-2]$ rewriterule ^url/i/want/to/block /index.php [r=302,l,nc]

c# - Why it always shows the error index is out of array bounds? -

i'm crafting app in c#, here problem stopped me. database table has 7 columns , takes 7 while running application. in line singlerow[c] = data[0].tostring(); shows me error telling me index out of bounds of array. please suggest. code below. public string[] rowonly() { string[] singlerow = new string[] { }; conn = new oledbconnection(connstr); conn.open(); cmd = new oledbcommand(query, conn); data = cmd.executereader(); messagebox.show(data.hasrows.tostring()); int = data.fieldcount; while (data.read()) { (int c = 0; c < i; c++) { singlerow[c] = data[0].tostring(); } } conn.close(); return singlerow; } string[] singlerow = new string[] { }; is creating array of length 0 do this: string[] singlerow = new string[i]; (you'll have move after line initializes i ) i.e: int = data.fieldcount; string[] singlerow = new string[i]; tip: use...

matplotlib basemap - How can I change anaconda's python version to 3.3 from 3.4 -

i've been used anaconda 2 months , it's fantastic tool me. at first, i'd started anaconda 2 (w/ python 2.7) changed latest version, has python 3.4 , anaconda version 2.2.0. and, because should install basemap library googled , found answer anaconda can support basemap using it's conda tool. but, when finished conda install basemap, saw messssage conflict occured python 3.4 below. fetching package metadata: not connect https://repo.continuum.io/pkgs/free/win-64/ not connect https://repo.continuum.io/pkgs/pro/win-64/ not connect https://repo.continuum.io/pkgs/free/noarch/ .could not connect https://repo.continuum.io/pkgs/pro/noarch/ ... solving package specifications: .. error: unsatisfiable package specifications. generating hint: [ complete ] |#################################################| 100% hint: following combinations of packages create conflict remaining packages: - python 3.4* - basemap i understand message should change python ...

ios - Change title and button size for search bar -

i want change name's button seaarch bar , found examples , 1 it's works : -(bool)searchdisplaycontrollerdidbeginsearch:(uisearchdisplaycontroller *)controller { uibutton *cancelbutton; uiview *topview = self.search.subviews[0]; (uiview *subview in topview.subviews) { if ([subview iskindofclass:nsclassfromstring(@"uinavigationbutton")]) { cancelbutton = (uibutton*)subview; } } if (cancelbutton) { [cancelbutton settitle:@"annuler" forstate:uicontrolstatenormal]; cancelbutton.titlelabel.font = [uifont systemfontofsize:12]; } return yes; } but problem : when start editing , firstly "cancel" it's showed , after annuler appears. font size 12 cancel . this how change name of button search bar :cancel annuler uibarbuttonitem *searchbarbutton = [uibarbuttonitem appearancewhencontainedin:[uisearchbar class], nil]; [searchbarbutton settitle:@"annuler...

php - access static parametr of class in static paramter of a different class -

i'm trying access static paramter of class, witch instance stored in static paramter of class. how looks like. parent::$model = new $model(); parent::$model::$lang = $lang_id; php respoding "unexpected '::'" on line i'm trying store $lang_id. please tell, if posiible in php , how do it. thank in advance.

c# - newbie, changing foreground color in visual studio -

i've been doing 1 of tutorial , i've messed console application foreground color. how original code supposed look, monkeyed around , exit half way thru, no dark magenta color on both c# , python projects, hard read =((( // preserve current console text color; consolecolor oldcolor = console.foregroundcolor; // change console text color console.foregroundcolor = consolecolor.gray; console.writeline("test color"); // cleaning console.foregroundcolor = oldcolor; i've tried changing this, seemed change console color, when debug in python project, @ same time when no debag of same project in python still brings back. console.foregroundcolor = consolecolor.gray; console.writeline("test color"); i've tried it various orders, , checking creating new projects nothing helped =( i'm not understanding here, if need magenta, can't change: console....

c# - ASP.NET Identity - Custom Implementation with Multi-Provider -

i'm working on big project car dealers , have dilemma. should use asp.net identity or old school formsauthentication? i need able login via 2 providers. first, user in database, check if ldap user, if so, authenticate via ldap (i use webservice has login method). here's login method: [httppost] [allowanonymous] [validateantiforgerytoken] public async task<actionresult> login(loginmodel model) { if (modelstate.isvalid) { var userindb = this.db.users.firstordefault(u => u.username == model.username); if (userindb != null) { // user exists if (userindb.isldap) { try { // ldap powered, ignore password in db using (var ws = webserviceclient.factory(model.getdomain())) { // make auth ...

scala-spark: How to filter RDD after groupby -

i have started rdd has pipe separated string. have processed data , gotten following format: ((0001f46468,239394055),(7665710590658745,-414963169),0,1420276980302) ((0001f46468,239394055),(8016905020647641,183812619),1,1420347885727) ((0001f46468,239394055),(6633110906332136,294201185),1,1420398323110) ((0001f46468,239394055),(6633110906332136,294201185),0,1420451687525) ((0001f46468,239394055),(7722056727387069,1396896294),1,1420537469065) ((0001f46468,239394055),(7722056727387069,1396896294),1,1420623297340) ((0001f46468,239394055),(8045651092287275,-4814845),1,1420720722185) ((0001f46468,239394055),(5170029699836178,-1332814297),0,1420750531018) ((0001f46468,239394055),(7722056727387069,1396896294),0,1420807545137) ((0001f46468,239394055),(4784119468604853,1287554938),1,1421050087824) just give high level view on description of data. can think first element in main tuple (first tuple) user identification, second tuple product identification, , third element user's prefe...

.net - TFS build takes longer than same msbuild in command line -

i've performance issue tfs 2013. i've build definition (based on process tfvctemplate.12.xaml), builds 3 solutions (with 30 projects each, it's wpf/wcf application). build takes 45minutes, since seemed lot of time (same build on our workstation takes few minutes) i've set log level diagnostic , found when msbuild compile wpf projects spends of time in markupcompilepass1 , markupcompilepass2 tasks, here example: 1540 ms generatetemporarytargetassembly 1 calls 6353 ms corecompile 6 calls 6840 ms resolveprojectreferences 5 calls 94682 ms markupcompilepass1 1 calls 112988 ms markupcompilepass2 1 calls i've tried execute same msbuild statement in command line on same machine (same parameters, changed logfile paths) , strangely took lot less. performance log same project: 865 ms resolveassemblyreference 5 calls 1493 ms markupc...

php - How to add elements to existing HTML using DomDocument? -

i have following select drop-down <select name="set_login_redirect" id="set_login_redirect"> <option value="dashboard">wordpress dashboard</option> <option class="level-0" value="1881">activate</option> <option class="level-0" value="2109">affiliate area</option> <option class="level-0" value="429">cart</option> <option class="level-0" value="430">checkout</option> </select> how use php domdocument class add new option element select drop-down. for example, want add code below html above. how can done? <option class="level-0" value="27">the word</option> i couldn't answer wrote php function dirty regex solve it. /** * append option select dropdown * * @param string $option option add * @param string $select select dropdo...

html - Center floating div horizontally without absolute position -

i'm having trouble centering div (logo) on page. i've tried few things don't seem working. i able center logo on page setting text-align center container , using absolute position grid_4 (right: 0;). when minimizing browser, 2 divs overlap. <!-- header --> <header> <div class="container"> <div class="grid_8 center-touch full-width wow fadeindown animated"> <a href="/"> {% if settings.use_logo %} <img src="{{ 'logo.png' | asset_url }}" alt="{{ shop.name | escape }}" class="logo" /> {% else %} <h1 class="logo">{{ shop.name | escape }}</h1> {% endif %} </a> </div> <div class="grid_4 right m-t-35 m-b-10 hide-touch wow fadeindown animated"> <div class="cart"> <span class="total"...

excel formula - DAX Ranking events year over year -

Image
i have table of data has format similar following: eventid | event date -------------------- 1 | 1/1/2014 2 | 2/8/2014 3 | 10/1/2014 4 | 2/5/2014 5 | 4/1/2014 6 | 9/1/2014 what trying create dax formula rank each event in order happened year. want end this. way can compare events year on year events don't happen on regular time schedule. event date | year | rank ------------------------ 1/1/2014 | 2014 | 1 2/8/2014 | 2014 | 2 10/1/2014 | 2014 | 3 2/5/2015 | 2015 | 1 4/1/2015 | 2015 | 2 9/1/2015 | 2015 | 3 i have tried creating formula give me day number of year: day of year =(yearfrac(concatenate("jan 1 ", year([event date])),[event date])*360)+1 then using rankx on table, cant seem proper result. perhaps not understanding use of rankx or going right way. =rankx(filter(event,earlier(event[event year])=event[event year]),event[day of year]) or =rankx(all(event[event year]),[day of year],,1,dense)...

Android, In-App billing implementation, correct way of implementation -

i implementing in-app billing feature in our android app. app free app, few features 1 feature user has pay. goal make 1 of feature available people purchase via in-app billing. is correct way ship feature part of free app , hide paid feature , make feature available (unhide) paid users? or when user pays via in-app billing should have download new version/required files make feature available? if correct way, how accomplish this? yes ship functioning code, check if item has been paid before let user use it: api . https://developer.android.com/google/play/billing/index.html

IO Error 22 python -

infile1 = open("d:/p/non_rte_header_path.txt","r") infile2 = open("d:/p/fnsinrte.txt","r") line in infile1: item in infile2: eachfile = open(line,"r") for above code getting below error. infile1 contains paths of may files d:/folder/src/em.h here \n automatically @ end of path.i not sure why happens. please help. ioerror: [errno 22] invalid mode ('r') or filename: 'd:/folder/src/em.h\n' everyone has provided comments telling problem if beginner don't understand why it's happening, i'll explain that. basicly, when opening file python, each new line (when press enter key) represented "\n". as read file, reads line line, unless remove "\n", line variable read thethingsonthatline\n this can useful see if file contains multiple lines, you'll want rid of it. edchum , alvits has given way of doing ! your corrected code : infile1 = open("d:/p/...