Posts

Showing posts from May, 2010

csv - How can I automate exporting of an Oracle table/view? -

i have table in oracle need export file, xls, csv or otherwise. attempting using sqlplus export view csv in shell script setup cronjob. this seems inelegant separators, line size , pagesize seem create lot of errors in data. is there better way accomplish sqlplus? i'm not sure sql*plus configuration elements should causing problems output -- if are, open second question on it. one method can explore using dbms_scheduler-driven pl/sql program write data out utl_file. if consider export process part of database functionality route go. i'd want know want data? exported data on own using disk space. are importing system? if so, more robust connect database system , pull data using sql, writing data disk fraught issues concerning date formats, presence of cr lf in data, number formats, etc.

java - sheet.getLastRowNum() gives different values -

i have 2 excel files single row. trying last row number of file. first file gives value 0 , second 1 1. idea why there inconsistency in this? read documentation (from here ): gets number last row on sheet. owing idiosyncrasies in excel file format, if result of calling method zero, can't tell if means there 0 rows on sheet, or 1 @ position zero. case, additionally call getphysicalnumberofrows() tell if there row @ position 0 or not.

jquery - Inline textarea filling remaining width -

i'm trying make element editable when user clicks on it, i'm having difficulties placing new textarea properly. here's work far: $.fn.replacewithpush = function(a) { var $a = $(a); this.replacewith($a); return $a; }; $(document).ready(function(){ $(".editable").click(function(event){ event.preventdefault(); switchtotextarea($(this)); }); function switchtotextarea(element) { var mnxx = element.height(); var replaced = element.replacewithpush('<textarea name = "' + element.attr('id') + '" class = "editable" rows = "1" columns = "26">' + $(element).text() + '</textarea>'); $(replaced).css({"min-height": (mnxx + 20) + "px"}); $(replaced).focus(); $(replaced).parent().addclass('editable'); $(replaced).focusout(function(){ var data = {id: author }; data[$(replaced).attr('name'

ubuntu 14.04 - Unknown attribute "Max-Daily-Session" Freeradius -

im working radius application , i'm having issues max-daily-session. ive been getting error " unknown attribute "max-daily-session" requires hex string, not "3600" been looking many articles related issue cant figure out im missing. this article states have declare attributes, problem dont know put or declare it. ive been looking freeradius dictionary, cant still solve it. looking forward positive inputs. thanks this article have helped me solved issue. added attribute max-daily-session 3003 integer in /etc/freeradius/dictionary.

ember.js - Sending an action from a child component and catching it in a parent component -

ember: 1.13.2 i can't seem working. parent/child widget (gridster-container/gridster-widget) {{#gridster-container}} {{#each model |widget|}} {{#gridster-widget sizex=widget.sizex sizey=widget.sizey action="addwidget"}} ... {{/gridster-widget}} {{/each}} {{/gridster-container}} gridster-widget export default ember.component.extend({ tagname : 'li', sizex : 1, sizey : 1, widget : null, didinsertelement : function() { var sizex = this.get('sizex'); var sizey = this.get('sizey'); //this.get('parentview').addwidget(this, sizex, sizey); //this.send('addwidget', this, sizex, sizey); //this.sendaction('action', this, sizex, sizey); //this.attrs.action(this, sizex, sizey); //this.get('gridstercontainer').send('addwidget', this, sizex, sizey); //this.action(this, sizex, sizey); this.sendaction('action', this,

codeigniter - Unexpected AUTO_INCREMENT behaviour -

we have server running php 5.6.7, mariadb 10.0.17-mariadb. have codeigniter application, in have 2 tables: point_trigger , trigger_filter , connected point_trigger_id , one-to-many. both have id column set integer auto_increment (so no composite keys). heppened: a client removed 1 of point_trigger s web interface. sa called controller removed row point_trigger , row (just 1 in case) trigger_filter . call logged, ends /delete/235 , meaning point_trigger_id used locate rows deleted set 235 . far good. couple of days later client goes web interface again , adds new point_trigger . client calls because point trigger created behaves unexpectedly. we check database, and... point_trigger table not have gap in ids, meaning point_trigger user created has the same id 235 . check associated trigger_filter table , 1 doesn't have gap , autoincremented id table next one. what know (or think know) both delete , add went ok in terms of removing rows. think because point_tr

javascript - node.js upload and download pdf file -

framework : node.js/express.js/busboy/gridfs-stream(mongodb) i using busboy upload files , use gridfs-stream store files in mongodb gridfs. req.pipe(req.busboy); req.busboy.on('file', function (bus_fieldname, bus_file, bus_filename) { var writestream = gfs.createwritestream({ filename: bus_filename, }); bus_file.pipe(writestream); writestream.on('close', function (file) { res.redirect('/xxxxx/'); }); }); download simple: use gridfs-stream's createreadstream read contents mongodb , use following code send browser. gfs.findone({_id: attachmentid}, function (err, file) { if (err || !file){ res.send(404); }else{ var filename = file.filename; var readstream = gfs.createreadstream({_id: attachmentid});

excel - VLOOKUP / CONCATENATE "#N/A" error -

i trying put 2 columns , value sheet. if hardcode numbers vlookup works concatenate #n/a . both columns general format. not understand doing wrong. this doing, in excel 2010: =vlookup(concatenate($w26,w$1),sheet2!$a$1:$b$200,2,false) any ideas? =vlookup(concatenate($w26,w$1)+0,sheet2!$a$1:$b$200,2,false) someone sent me , works great. everyone.

How to make Bootstrap buttons in separate forms inline (horizontally aligned)? -

i'm trying following bootstrap buttons on same horizontal line: <a class="btn btn-success btn-lg checkout" href="/foo/buy"> <i class="glyphicon glyphicon-shopping-cart"></i> $50.00 </a> <form action="/subscriptions" accept-charset="utf-8" method="post"> <div class="btn-group"> <button class="btn btn-default btn-lg" type="submit"> <i class="glyphicon glyphicon-eye-open"></i> watch </button> <a class="btn btn-default btn-lg" href="/foo/watchers"> <span>1</span> </a> </div> </form> <form action="/wishlists" accept-charset="utf-8" method="post"> <div class="btn-group"> <button class="btn btn-default btn-lg" type="submit"> <i class="glyp

c++ - How to use a library with headers and .so files? -

i'm new c , wanted use library ( mlt multimedia framework ) i've built , produced following directories: include lib share inside lib there .so .a .la files inside include there .h files now, i'm instructed this: #include <framework/mlt.h> inside include/mlt/framework/ questions: why need place header file contains function prototypes? real functions then? linked someway ones included in lib directory? where place own files , how compile it ? how learn more topics: dynamic/static libraries building / making / installing how use c library if don't have function prototypes, how compiler know functions exist in library? short answer is: doesn't. longer answer: compiler doesn't care library files, static (files ending in .a ) or shared (files ending in .so ), cares current translation unit . it's linker handle resolving undefined references. when use libraries, include header files contain needed declarati

php - How to get a contact list from a gmail account within Yii framework 2.0 -

i have created google app. want contact list gmail account yii 2.0 website. saw 2 interesting classes yii 2.0 provides: yii\authclient\clients\googleoauth yii\authclient\clients\googleopenid can use above classes contact list gmail account? if yes, how implement it, because in yii 2.0 docs there not sample code using these classes. if no, 1 know tutorial approach goal? working yii framework 2.0

c++ - std::unique_ptr structure member to the structure type -

is struct { std::unique_ptr<a> a; }; allowed standard? don't think container types std::set there special unique_ptr ? yes, it's explicitly allowed. c++14 (n4140) 20.8.1/5: ... template parameter t of unique_ptr may incomplete type. it allowed std::shared_ptr , std::weak_ptr , using similar wording.

php - Yii Framework: Pagation Callback Method -

i have clistview on page , every time navigate page 2 or other page want call method formats view. not seem work every time navigate page. the javascript method want call called updatedivs() here list view widget $this->widget('zii.widgets.clistview', array( 'dataprovider' => $dataprovider, 'itemview' => '_customview', 'id' => 'bannerslist', 'ajaxupdate' => true, 'afterajaxupdate' => ' updatedivs()', 'enablepagination' => true, 'itemscssclass' => 'row banners-list', 'summarytext' => 'total ' . $pages->itemcount . ' results found',

Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 -

i new maven, want install artifacts local maven, when tried run script.got bellow error. [info] scanning projects...downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom [warning] failed retrieve plugin descriptor org.apache.maven.plugins:maven-clean-plugin:2.5: plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or on e of dependencies not resolved: failed read artifact descriptorfor org.apache.maven.plugins:maven-clean-plugin:jar:2.5 please in resolving issue. need in setting.xml, proxy ip need give poxy been disabled on system.

Get double variable when sent variable to next viewcontroller swift -

i create global variable after import statement: var kontenid = "" var judulkonten = "" then sent freetiles view controller (other view controller) through tableview , prepareforsegue: func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { //let cell = tableview.dequeuereusablecellwithidentifier(reusecontentfreeidentifier, forindexpath: indexpath) as! freetableviewcell var contentku = contents[indexpath.row] contentmodel kontenid = contentku.id judulkonten = contentku.title performseguewithidentifier("lemparkonten", sender: self) } override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { // new view controller using segue.destinationviewcontroller. // pass selected object new view controller. if (segue.identifier == "lemparkonten") { var svc = segue.destinationviewcontroller as! freetiles; svc.idcontent = kontenid svc.namacont

go - Correct use of XML annotations, fields and structs in custom UnmarshalXML function -

consider following struct: type mystruct struct { name string meta map[string]interface{} } which has following unmarshalxml function: func (m *mystruct) unmarshalxml(d *xml.decoder, start xml.startelement) error { var v struct { xmlname xml.name //`xml:"mystruct"` name string `xml:"name"` meta struct { inner []byte `xml:",innerxml"` } `xml:"meta"` } err := d.decodeelement(&v, &start) if err != nil { return err } m.name = v.name mymap := make(map[string]interface{}) // ... mxj magic here ... - temp := v.meta.inner prefix := "<meta>" postfix := "</meta>" str := prefix + string(temp) + postfix //fmt.println(str) mymxjmap, err := mxj.newmapxml([]byte(str)) mymap = mymxjmap // fill mymap //m.meta = mymap m.meta = mymap["meta"].(map[string]interface

ggplot2 - R - different font sizes when using atop -

creating plot y-axis has 2 lines. i'm using atop function follows: plot + ylab(expressions(atop("line 1","line 2"))) wondering whether possible change line 1's font size i.e., make larger line 2? thanks! the mechanism make specific sections of fonts smaller using plotmath scriptstyle function. there's make-even-smaller version of it. @ ?plotmath page full list of plotmath functions. don't know of plotmath strategy making fonts larger. plot + ylab(expression( atop(line~1, scriptstyle(line~2)) )) note there no expressions function , converted text real r expression. might @ theme() settings element_text features axis.title.y increase text size. plot + ylab(expression( atop( line~ 1, scriptstyle( line~ 2) ))) + theme(axis.title.y = element_text( size = rel(2) ) )

Excel recorded SQL database query not working -

i've recorded macro query database, , when record macro, query runs properly. however, when try run macro again on same sheet or on different one, error: runtime error 1004, "sql syntax error" on line .refresh backgroundquery:=false". below recorded macro. sub macro3() activesheet.querytables.add(connection:= _ "odbc;dsn=substation prod;srvr=subp;uid=u326357;", destination:=range("a1")) .commandtext = array( _ "select fact_monthly.time_stamp, fact_monthly.system_number_val0, fact_monthly.substation_number_val0, fact_monthly.mva_max_out_val0, fact_monthly.mw_max_out_val0, fact_monthly.mvar_max_out_val0, fact_" _ , _ "monthly.mw_min_out_val0, fact_monthly.mvar_min_out_val0, fact_monthly.pf_max_val0, fact_monthly.pf_min_val0, fact_monthly.top_oil_tank_max_val0, fact_monthly.load_factor_val0, fact_monthly.ph1_tap_max" _ , _ "_drag_val0, fact_

javascript - Trouble with Wordpress Ajax Login System - 302 -

i'm trying create simple ajax login system wordpress. unfortunately, every time "wp_signon" function fired, system failed , information have 1 : post myurl/wp-admin/admin-ajax.php - 302 found myurl/?login = failed - 200 found so, whether try log in informations or not, js script goes in "error part" of ajax function. can tell me doing wrong? appreciated! many thanks! js : jquery(document).on('submit', loginform, function(event) { event.preventdefault(); var usernameval = jquery('.modal-login .login-form #user_login').val(); var passwordval = jquery('.modal-login .login-form #user_pass').val(); var remembermefield = jquery('.modal-login .login-form #rememberme'); var securityval = jquery('.modal-login .login-form #security').val(); if ( remembermefield.prop('checked') ) { var remembermeval = 'true'; } else { var remembermeval = 'false';

Change string to hash with ruby -

i have ugly string looks this: "\"new\"=>\"0\"" which best way converting hash object? problem "\"new\"=>\"0\"" not hash. first step should manipulate hash: "{" + + "}" # => "{\"new\"=>\"0\"}" now once have hash looking string can convert hash this: eval "{" + + "}" # => {"new"=>"0"} however there still 1 issue, eval is not safe , inadvisable use . lets manipulate string further make json-like , use json.parse : require `json` json.parse ("{" + + "}").gsub("=>",":") # => {"new"=>"0"}

android - Dynamically put values to a text view in a Layout and put that layout inside another layout. -

i tried , getting java:null pointer exception @ line try put 1 layout another. this mainactivity.java: import java.util.arraylist; import java.util.set; import android.os.bundle; import android.app.activity; import android.content.context; import android.content.sharedpreferences; import android.content.sharedpreferences.editor; import android.view.layoutinflater; import android.view.menu; import android.view.view; import android.widget.spinner; import android.widget.tablelayout; import android.widget.textview; public class mainactivity extends activity { private sharedpreferences sp; private tablelayout enterstocktablelayout; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); arraylist<itemdata> list= new arraylist<itemdata>(); list.add(new itemdata("indian rupee",r.drawable.india)); list.add(new itemdata("us dollar",r.drawable

java - Running Eclipse from usb -

Image
i have put necessary files on usb pen drive, java development kit , eclipse files. have created .bat file reads @echo off set path=\32 bit\jdk32\bin;%path% cd "32 bit\eclipse" start eclipse.exe exit however when run batch, eclipse launches , brings error as far can tell trying use old path variable jni shared library. me problem please. it turns out there simple solution this. amended .bat file @echo off set path=%~dp032 bit\jdk32\bin;%path% cd "32 bit\eclipse" start eclipse.exe exit explanation this works getting path of executing batch file using command %~dp0 . where d drive (in case n:\ ) p path ( code\java\eclipse mars\ ) 0 name of executing batch file this path n:\code\java\eclipse mars\32 bit\jdk32\bin sets java version correctly , removes error had above

bluetooth lowenergy - connecting issue with android ble -

i have issue ble getting disconnecting, below code changes based on answer earlier used response show data ble device phone , but after code change can not data device think has "enable_indication_value" , "enable_notification_value" can call both @ same time public void setcharacteristicnotification(bluetoothgattcharacteristic bluetoothgattcharacteristic, boolean flag) { if(mbluetoothadapter == null || mbluetoothgatt == null) { log.w(tag, "bluetoothadapter not initialized"); } else { mbluetoothgatt.setcharacteristicnotification(bluetoothgattcharacteristic, flag); bluetoothgattdescriptor bluetoothgattdescriptor = bluetoothgattcharacteristic.getdescriptor(uuid.fromstring(samplegattattributes.client_characteristic_config)); if(bluetoothgattdescriptor != null) { bluetoothgattdescriptor.setvalue(bluetoothgattdescriptor.enable_notification_value); mbluetoothgatt.writedescriptor(

ios - Setting background color apply on part of screen -

i using swift set background color viewcontroller: self.view.backgroundcolor = uicolor.blackcolor() but part of screen still painted in white why that? make sure have assigned class (.swift file) viewcontroller in storyboard. double check in storyboard not have added view whole screen(controller).

c - How to find memory leaks with Clang -

i have installed clang in machine (ubuntu) in order find memory leaks in c code. wrote sample code in order check working of follows: /* file: hello.c leak detection */ #include <stdio.h> #include <stdlib.h> void *x; int main() { x = malloc(2); x = 0; // memory leak return 0; } i found options in internet compile like $ scan-build clang --analyze hello.c and $ scan-build clang -fsanitize=address hello.c but none of them showing signs of memory leak. scan-build: using '/usr/bin/clang' static analysis scan-build: removing directory '/tmp/scan-build-2015-07-02-122717-16928-1' because contains no reports. scan-build: no bugs found. can kindly tell how correctly use clang memory leak detection. interestingly, clang static analyzer finds memory leak if declare void *x inside main : int main() { void *x = malloc(2); x = 0; // memory leak return 0; } analyzing code running: scan-build clang -g hello.c giv

liferay - How to add SELECT ALL function in Search Container? -

Image
i want have select all function in search container this: this code of search container : <liferay-ui:search-container delta="5"> <%-- <c:choose> <c:when test=""> </c:when> <c:otherwise> </c:otherwise> </c:choose> --%> <liferay-ui:search-container-results results="<%= reguseraccountlocalserviceutil.getreguseraccounts(searchcontainer.getstart(), searchcontainer.getend()) %>" total="<%= reguseraccountlocalserviceutil.getreguseraccountscount() %>" /> <liferay-ui:search-container-row classname="com.pmti.bir.triu.model.reguseraccount" keyproperty="acctid" modelvar="areguseraccount" > <liferay-ui:search-container-column-text> <input name="rowchecker" type="checkbox" value="<%=areguseraccount.getacctid()%>" /> </liferay-ui:search-container-column-text> <liferay-ui:search-container

How can I use R to remove a file extension that is not alphanumeric extension -

this example of file name mod09a1.a2000049.h19v11.005.2006268194400.hdf.sur_refl_day_of_year initially mod09a1.a2000049.h19v11.005.2006268194400.hdf.sur_refl_day_of_year.tif i used function file_path_sans_ext remove ".tiff" still want remove ".sur_refl_day_of_year". need file name mod09a1.a2000049.h19v11.005.2006268194400.hdf only. try: sub("(\\.hdf).*", "\\1", myfilename)

performance - Reason why Odoo being slow when there is huge data inside the database -

we have observed 1 problem in postgresql doesn't uses multi core of cpu single query. example, have 8 cores in cpu. having 40 million entries in stock.move table. when apply massive query in single database connection generate reporting & observe @ backend side, see 1 core 100% used, other 7 free. due query execution time takes longer , our odoo system being slow. whereas problem inside postgresql core. if anyhow can share query between 2 or more cores can performance boost in postgresql query execution. i sure solving parallel query execution, can make odoo performance faster. has kind of suggestions regarding ?? ----------- * editing question show answer postgresql core committee *--------- here posting answer got 1 of top contributor of postgresql database. ( hope information useful) hello hiren, it expected behave. postgresql doesn't support parallel cpu single query. topic under high development, , probably, feature in planned release 9.6 ~

hadoop - Clean AWS EMR to allow reuse -

i have several task i'm preforming on aws emrs don't share data , use same emr perform them 1 after another. there way clean running emr initial state (remove hive tables, clean hdfs files etc.) avoid collision of data? i want reuse emr several reasons: creation of new emr can take 5-10 minutes. my task relative shorts, 20-25 minutes. once emr created paying full hour. we didn't find "quick , clean" api achieve behaviour. instead consolidate simple work methodology promise can clean data. we work on specific db instead of default one. we put our internal data files under specific location in hdfs. so every time task started, first delete specific db if exists , recreate , recursively delete data under specific location in hdfs.

android - Unpublished application Still getting Showing Warning from Google Play -

i published android application on 31 march 2012 , unpublished android application google play on 1 jun 2015. but, 2 days got warning alert playstore unpublished application. security alert we wanted let know application statically linking against version of openssl has multiple security vulnerabilities users. please migrate app updated version of openssl 7 jul 2015. starting on date, google play block publishing of new apps , updates use older, unsupported versions of openssl (see below details). reason warning: violation of dangerous products provision of content policy , sections 4.4 of developer distribution agreement. the vulnerabilities fixed in openssl versions beginning 1.0.1h, 1.0.0m, , 0.9.8za. confirm openssl version, can grep via: $ unzip -p yourapp.apk | strings | grep "openssl" for more information vulnerability, please see openssl security advisory. confirm you've upgraded correctly, upload updated version of app developer

How to get AIC, BIC for fitted lee carter in demography package in R? -

i have trouble finding bic , aic values lee carter fitted using lca command in demography package, how fitted model: uklcam<-lca(data=uk, series="male", years=1950:2011, max.age=100, adjust = "dxt", chooseperiod=false, scale = true, restype = "logrates", interpolate = false) can help? bic() command give following errors > bic(uklcam) error in usemethod("loglik") : no applicable method 'loglik' applied object of class "lca"

css3 - CSS - Keeping Navigation Tab Move In Place or Top -

have tweaked coding found - prefer tab navigation - keep div in place , not flip top , lose placement. so when clicking on navigation tab - pops area , puts headers/tabs above things are. keep navigation clean , stationary... any ideas/thoughts appreciated.. <script type="text/javascript" src="addclasskillclass.js"></script> <script type="text/javascript" src="attachevent.js"></script> <script type="text/javascript" src="addcss.js"></script> <script type="text/javascript" src="tabtastic.js"></script> <style type="text/css"> .tabset_tabs { margin:0; padding:0; list-style-type:none; position:relative; white-space:nowrap } .tabset_tabs li { margin-left: 1%; padding:2px; display:inline } .tabset_tabs { font-family: verdana; font-size: 12pt; font-weight: normal; color:#fff ! important; <cfoutp

java - Cannot Upload a file using Jax-RS -

i want use jersey framework. i´m running web service, using ant app, on java ee7. application server glassfish my method this: package mypackage.service; ... import org.glassfish.jersey.media.multipart.formdatacontentdisposition; import org.glassfish.jersey.media.multipart.formdataparam; @post @path("createsomething") @consumes(multipart_form_data) @produces(application_xml) public response createsomething(@formdataparam("upload") inputstream is, @formdataparam("upload") formdatacontentdisposition formdata, @queryparam("some") string some, @context httpservletrequest request) { string filelocation = "c:\\uploadfile\\" + formdata.getfilename(); //more things, not matter try { ctrl.savefile(is, filelocation); string result = "successfully file uploaded on path " + filelocation;

java - Xwiki convert Demo sample -

trying work demo xwiki in java standalone class, not working. using xwiki 7.0 version. tried out? http://rendering.xwiki.org/xwiki/bin/view/main/demo?inputsyntax=xhtml%2f1.0&outputsyntax=xwiki%2f2.1&input=%3ch3+id%3d%22hhelo%22%3e%3cspan%3ehelo%3c%2fspan%3e%3c%2fh3%3e#hdemo public class htmltoxwikitest { private converter converter; private wikiprinter printer; @test public void testhtmltomarkdown() throws componentlookupexception, conversionexception, parseexception, componentrepositoryexception { wikiprinter printer = new defaultwikiprinter(); converter.convert(new stringreader("<h3 id=\"hheader3\"><span>header 3</span></h3>"), syntax.xhtml_1_0, syntax.xwiki_2_1, printer); system.out.println(printer.tostring()); assertthat(printer.tostring(), containsstring("===")); } @before public void setup() throws componentlookupexception, conversionexception { embeddablecomponentmanager componentma

python - My code is inefficent, multiples of 3 and 5 from Project Euler but with a 10 second timeout conditon -

problem statement this problem programming version of problem 1 projecteuler.net if list natural numbers below 10 multiples of 3 or 5, 3, 5, 6 , 9. sum of these multiples 23. find sum of multiples of 3 or 5 below n. input format first line contains t denotes number of test cases. followed t lines, each containing integer, n. output format for each test case, print integer denotes sum of multiples of 3 or 5 below n. constraints 1≤t≤105 1≤n≤109 sample input 2 10 100 sample output 23 2318 i'm doing first project euler question time constraint challenge. if process takes more 10s autofail. here sample input: 2 # number of test cases 10 # first test case 100 # second test case here code: test_case = int(input()) x in range(0, test_case): # loops after every test case stop_value = int(input()) answer = 0 threes = 0 while threes < stop_value: # checks 3s answer += threes

What happens when accessing an attribute from a Class vs an instance in python? -

i trying understand access of attributes class vs object. experiment this: >>> class test(): x = 1 y = 2 def __init__(self, a, b): self.x = self.y = b >>> test.x, test.y (1, 2) >>> t = test(3, 4) >>> (t.x, t.y) (3, 4) # looks class attributes , instance attributes completed unrelated, ... >>> del t.x >>> del t.y >>> t.x, t.y (1, 2) # looks instance attributes shadows class attributes, # accessed when instance attrs not present, ... >>> t.x = 5 # expected class attributes changed, ... >>> test.x 1 # class attribute not changed >>> t.x 5 what happens when try access attribute (read/write/delete)? and why python designed way? you're correct instance attributes shadow class attributes. in __init__ method , in t.x = 5 , you're adding attributes instance. way create instance attributes.

android - Collapsing toolbar animation doesn't move -

i implementing collapse toolbar in app , should right bar not restricted .. not move nothing !!! this layout.xml <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/coordinatorlayout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="192dp" android:fitssystemwindows="true" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width=&q

ios - correct autolayout constraint for UIButton -

i have button on view must positioned in top left corner throughout different screen sizes, proportionate margins , scaled accordingly. had success in doing several other ib objects using aspect ratio, , x/y centering, button seems not complying. constraints should add?

javascript - declare function properties inside -

i know can set function property below function f(){} f['a']=1;//setting function property outside alert(f.a)//alert 1 but possible set property of function below or there other similar way of declaring properties inside function,rather outside? function f() { a: 1 } alert(f.a); //get 1 output edit: looking way not use object creation function constructor or use prototypes no, there not. inside function goes body, i.e. code executed when function called. function literal / declaration not object literal, if both use curly braces. if you're looking more declarative way assignment put static properties on function, use kind of extend functionality: var f = object.assign(function f() {}, { a: 1 }); (all of _.extend , $.extend , object.assign work purpose - otherwise use f.a = )

javascript - How to get ID of input field from form using jQuery element selector -

i have form each input field unique id , have attached jquery on 'input' form. want id of field on user change value using jquery function. missing puzzle in following code in alert(".... statement $(document).ready(function () { $("#createstudentprofileform").on('input', function () { alert($(this).find().closest().attr('id')); }); }); html form <input class="form-control text-box single-line valid" data-val="true" data-val-number="the field student uwl id must number." data-val-range="only number allowed" data-val-range-max="2147483647" data-val-range-min="0" data-val-required="require student uwl id" id="studentnumber_uwlid" name="studentnumber_uwlid" value="" type="number"> i have many instances of input field above how if attach event each field individually? $(document).ready(func

excel - Searching for data that is not present -

Image
i have 2 sets of data ranges. 1 range in sheet 1 (8000 rows, 6 columns) master range , other range in sheet 2 (5000 rows, 6 columns). how can display other 3000 rows on new sheet (sheet 3) not in sheet 2 in sheet 1? i can make macro, first, let me know if you're looking for. here's sample data used, in 3 sheets. sheet 1 called "master" following, starting in a1: name birthday month age batman january 35 superman march 32 catwoman april 37 joker june 28 harley quinn september 33 rorschach july 35 dr. manhattan august 41 aquaman october 22 ms. jupiter october 23 penguin july 39 and in sheet2: name birthday month age batman january 35 superman march 32 catwoman april 37 joker

php - Common lib on symfony2 -

before using symfony2, used have common lib lot of simple useful functions (for instance, function takes "azè_rtï" in argument , returns "aze-rti"). so, well, created bundle: commonlibsbundle. but.. have 1 or 2 php files. not make sense me use controller / view / model in kind of situation. should do? may erase folders in new bundle (controller, dependencyinjection, resources, tests... + commonlibsbundle.php) , put lib.php in it? many thanks, bliss unless need tap symfony framework - configuration or define services, doesn't need bundle - it's library. give reasonable namespace, , call required other component or library. even if wanted add symfony-specific services call, there said still have external simple library - usable anywhere, wrapped thin bundle add symfony-specific (or laravel, or zf, or whatever) services , configuration required.

excel - Multiple cells selecting and copying to a single row on another worksheet -

i've been looking around past couple days , can't seem find me accomplish i'm trying do. i have sheet contains data in multiple cells user inputs - when user hits submit button vba macro copy data multiple cells , paste worksheet on single row (last row) can pull data later , make changes if needed. worksheet has unique id on top , when searched pull data worksheet , make edits , save again. when record macro , try multiple select doesn't let me copy code supplies select sub copy() ' ' copy macro ' union(range( _ "j22:k22,m22,i24:j24,k24:l24,m24,i26:j26,k26:l26,m26,b29:d29,e29:g29,b30:d30,b31:d31,b33:d33,e33:g33,i29,j29:k29,m29,i31:j31,k31:l31,m31,i33:j33,k33:l33,m33,b36:d36,b37:d37,b38:d38,e36:g36,b40:d40,e40:g40,i36,j36:k36,m36" _ ), range( _ "i38:j38,k38:l38,m38,i40:j40,k40:l40,m40,b2:f3,b2:f3,b6:e6,f7:g7,b7:e7,b8:e8,b9:e9,b11:c11,d11:e11,b13:c13,d13:e13,i3:l3,l2,m1,i6:l6,i7:l7,i8:l8,i9:l9,m7,i11:j11,k