Posts

Showing posts from July, 2011

java - Font Awsome on JButton -

java - Font Awsome on JButton - i trying display font awesome icons on jbutton . did following font font = null; seek { font = font.createfont(font.truetype_font, new file("../icons/fontawesome-webfont.ttf")); font = font.derivefont(18f); graphicsenvironment ge = graphicsenvironment.getlocalgraphicsenvironment(); ge.registerfont(font); } grab ( fontformatexception ex ){ex.printstacktrace();} grab ( ioexception ex ){ex.printstacktrace();} private jbutton save_btn = new jbutton(); save_btn.setfont(font); save_btn.settext("\uf0c7"); save_btn.setpreferredsize( buttondimension ); but if utilize font with jtextarea, works fine : jtextarea t = new jtextarea(); t.setrows( 2); t.setcolumns( 12); t.setfont( font ); t.settext( "\uf0f3 \uf1ec \uf0f3 \uf1ec"); buttonpanel.add(t); i my guess button dimensions little displaying symbol want display , button reverts showing "..." don't seem have repres

Groovy DSL: How I can overload any() in Groovy, when I create internal DSL -

Groovy DSL: How I can overload any() in Groovy, when I create internal DSL - i create internal dsl , overload any() method defaultgroovymethods. class rulesprocessor { } live cell fewer 2 live neighbours dies the lastly line dsl. tried propertymissing, methodmissing, create class, rulesprocessor.metaclass.any, defaultgroovymethods.metaclass.any, doesn't work. how can write code take dsl? first step 'any' word complicated me. if can set in closure, delegate object responds any method or, in example, invokemethod : class dsl { def params = [] def invokemethod(string method, args) { params << [method, args] } def propertymissing(string prop) { prop } } = { live cell fewer 2 live neighbours dies } dsl = new dsl() a.delegate = dsl a() assert dsl.params == [ ['any', ['live']], ['cell', ['with']], ['fewer', ['than']], ['two', ['live']], ['ne

php - Using Layouts setRoot() in standalone \Zend\View -

php - Using Layouts setRoot() in standalone \Zend\View - what need i needed templating engine little site , decided seek using \zend\view . i'm not using zend framework though. so want info processing in custom scripts outside of zend, , pass variables \zend\view , create render templates. what i've tried i referring next manual: zend.view.quick-start.html. basic implementation (where utilize \zend\view\renderer\phprenderer , \zend\view\model\viewmodel only) works expected. run errors when seek more complex, such using mutual layout. if got right, \zend\view\model\viewmodel s can nested, , can phone call kid ones using predefined placeholders (zend.view.quick-start.html#nesting-view-models). there should 1 primary viewmodel serve root (zend.view.quick-start.html#dealing-with-layouts), contain skeleton html page doctype , whatever pass headtitle() , headmeta() etc. i tried create viewmodel, point root layout using settemplate() , pass setroot() f

active directory - kinit(v5): Client not found in Kerberos database while getting initial credentials -

active directory - kinit(v5): Client not found in Kerberos database while getting initial credentials - i'm working on configuring sso in obiee 11.1.1.7.14, in i'm facing issue in step while configuring krb5.conf , executing kinit command. few notes regarding active directory we have more 1 domain controller , balance request maintaing load balancer port 3269. and integration between obiee , msad done load balancer name host , port 3269. and few certificates have been added in demotrust.jks , ovd store , ssl enabled in new provider. keytab file generated , placed in obiee domain home, krb5.conf , krb5login.conf file modified accordingly. i have created keytab file , placed in obiee domain home, modified krb5.conf keeping kdc 1 of ip address of domain controller , admin-server name of domain controller. , while executing kinit -v -k -t /location/keytabfile.keytab http/obiee_host_name i have got , error "kinit(v5): client not found in kerberos database while

Ruby-on-rails development and production on same server -

Ruby-on-rails development and production on same server - is possible (or normal) have ror development , production on same server? , ok have sqlite development , postgreesql production? it not normal, possible - , needed - debug problems showing in production. couple of examples assets (javascripts, images, etc) served differently in development opposed production due asset pipeline. area caching tends different in production , disabled in development. in ruby on rails there (at least) 3 modes server can run in. these referred 'environments'. development. local machine , utilize locally during development tests. used when run tests , test suites. production. mode used actual production servers on remote server. sometimes want/need run local development server in 'production mode' , in these cases inline with rails_env=production rails server or rails server -e production or rails server -e production 3001 # specify port (dev

matlab - Unique combinations of a beaded necklace -

matlab - Unique combinations of a beaded necklace - this question has reply here: generate possible combinations of elements of vectors (cartesian product) 3 answers so i'm writing programme determine unique combinations of beaded necklace, can't seem right. rules can't have same necklace forwards , backwards, , can't have same necklace 1 bead beingness slid around other end. i've attached pictures clarify. i wrote code it, , thought had achieved trying do, it's not working correctly. n = [1 2 3 4 2 4]; % greenish = 1 % bluish = 2 % yellowish = 3 % reddish = 4 p = perms(n); total = max(size(p)); = 1:max(size(p)) q = p; q(i) = []; j = 1:max(size(q)) if isequal(p(i),fliplr(q(j))) total = total - 1; elseif isequal(p(i),circshift(q(j),[1,1])) total = total - 1; elseif isequal(p

php - Detect device information like browser name, device name ,device version -

php - Detect device information like browser name, device name ,device version - i have been looking reliable way have (at to the lowest degree less obscure ones) : the name of browser version , platform (os) on maybe more info 3 info above enough. not finish reply guess pointing in right direction. can info user's browser , platform in javascript using code below alert(navigator.useragent); you have create list of known browsers , platforms, , have compare useragent string them identify respective browser/platform. php jquery

Rebuild each definition list () as a table using JQuery -

Rebuild each definition list (<dl>) as a table using JQuery - i having want convert table format help of jquery. please reply html: current <div id="item"> <dl> <dd>a</dd> <dt>b</dt> <dd>c</dd> <dt>d</dt> <dd>e</dd> <dt>f</dt> </dl> </div> html desired <table> <tr> <td>a</td> <td>b</td> </tr> <tr> <td>c</td> <td>d</td> </tr> <tr> <td>e</td> <td>f</td> </tr> </table> class="snippet-code-js lang-js prettyprint-override"> $(document).ready(function() { var table = $('<table/>'), tbody = $('<tbody/>'), tr = $('<tr/>'), tds = $('#item').find('dd,dt').cl

javascript - Cut data from array of JSON objects -

javascript - Cut data from array of JSON objects - i have array of json objects this: [ { id: 841, when: 'date', who: 'asd', what: 'what', key1 : 'a key', key2 : 'a key' _id: 544034ab914ae3b9270545c1, __v: 0 }, { id: 841, when: 'date', who: 'asd', what: 'what', key1 : 'a key', key2 : 'a key' _id: 544034ab914ae3b9270545c1, __v: 0 } ] i want cutting key1 , key2 from objects , want see this: [ { id: 841, when: 'date', who: 'asd', what: 'what', _id: 544034ab914ae3b9270545c1, __v: 0 }, { id: 841, when: 'date', who: 'asd', what: 'what', _id: 544034ab914ae3b9270545c1, __v: 0 } ] how can cutting keys , values? my method not working. (pseudo) : var new_array old_array.length delete old_array[i].key1 delete old_array[i].key2 new_array.push(

intellij idea - pycharm auto unstashing changes after rebase -

intellij idea - pycharm auto unstashing changes after rebase - after rebase (git plugin) pycharm has unstash lastly stashed changeset. causes merge conflicted files etc. did not find related settings configure it. how can turned off? in main menu vcs -> update project in area, specify method save changes while cleaning working tree before update. changes restored after update completed. available options are: using stash(git native) , using shelve(idea native) so using shelve avoid issues stashed info (i not using shelve files no conflicts) intellij-idea pycharm

Self defined field? SQL Server -

Self defined field? SQL Server - i'm getting started on sql server , have little problem need "license" column "clients" table self defines it's cells follows: auto incremented number + "-" + 3 lastly numbers of "id" + 'f' if " gender"='female ' or "m" if " gender"='male ' ideas? you can utilize computed column purpose here how can added autoid auto inremented number can used in computed column. create table table1 ( autoid int identity(1,1), id int, gender varchar(5), license cast(autoid varchar(20))+ '-' + cast(id%1000 varchar(20))+ (case when gender ='female' 'f' else 'm' end) ) sql sql-server sql-server-2008-r2 sql-server-2012

How to solve Exception in thread “main” java.lang.ArithmeticException: / by zero? -

How to solve Exception in thread “main” java.lang.ArithmeticException: / by zero? - here code : import java.io.file; import java.io.filenotfoundexception; import java.io.ioexception; import java.util.scanner; public class prob_c { public static void main(string args[]) throws ioexception { scanner x = null; seek { x = new scanner(new file("prob_c.in")); } grab (filenotfoundexception ex) { system.out.print("file not found!"); } (int = 0; < 10; a++) { int counter = 0; int n = x.nextint(); int r = x.nextint(); counter++; long res = 1; res = getfact(n) / (getfact(n - r) * getfact(r)); system.out.println(res); } } public static long getfact(int j) { long f = 1; (int = j; >= 1; i--) { f *= i; } homecoming f; } } to deal big factoria

c++ - destruction of object with vector member -

c++ - destruction of object with vector member - i encountered weird bug when coding classes vector member. bug introduced myself runtime result shocked me. simplified illustration shown below. basically bug in constructor h2 has size of dimension_ rather dimension_*dimension_ , leads out-of-range access of h2 in void a::set() , double a::get() . admit it's bad have such kind of bug. think should happen h[2] , h[3] in void a::set() access random memory address or in reserved range of vector h2 . has happened when destructor called free() error raised, follow lot of dummy backtrace rather not list here. *** glibc detected *** ./a.out: free(): invalid next size (fast): 0x0000000001637040 *** but if don't access h[3] in void a::set() , won't happen. question happening vector , destructor? vector's destructor know elements have accessed? think vector knows size , deallocate memory when destructor called. thought appreciated. thanks. the next sampl

Applet is not able open socket connection in JRE 8 was working in JRE 7 and below -

Applet is not able open socket connection in JRE 8 was working in JRE 7 and below - it working fine jdk 1.7 or before versions, 1 time test jdk 8 getting next exception exception in thread "cth" java.security.accesscontrolexception: access denied ("java.net.socketpermission" "ip:port" "connect,resolve") @ java.security.accesscontrolcontext.checkpermission(unknown source) @ java.security.accesscontroller.checkpermission(unknown source) @ java.lang.securitymanager.checkpermission(unknown source) @ java.lang.securitymanager.checkconnect(unknown source) @ sun.plugin2.applet.securitymanagerhelper.checkconnecthelper(unknown source) @ sun.plugin2.applet.awtappletsecuritymanager.checkconnect(unknown source) @ java.net.socket.connect(unknown source) @ iyp.simplegameapplet.d.f.a(unknown source) @ iyp.b.a.b$c.run(unknown source) we have applet, open socket connection communicate server socket application here applet code used open

osx - Mass unzipping of files containing signs to be escaped and renaming of created folders using regexp -

osx - Mass unzipping of files containing signs to be escaped and renaming of created folders using regexp - i need create simple bash 1 line sript follow: find zip files in folder unzip each file rename result folders. the first part quite easy: find . -type f -name '*.zip' the problem comes next, files looks way: ab_firstname_somestring_a!1.zip ab_secondname_somestring_a!1.zip ab_thirddname_somestring_a1.zip etc. problem comes when using xargs - when doesn't receive escaped filenames not extract them. lastly problematic step renaming - result folders have exact same name original zip file without .zip @ end, , rename during process part remains: firstname secondname thirdname the thing known - name between first _ , sec _. to expand on comments above. think looking like class="lang-sh prettyprint-override"> find . -type f -name '*.zip' -exec bash -c \ ' tar -xzf "$1" && f=$1 && f

php - xml xpath does not return node value -

php - xml xpath does not return node value - i have test file i'm trying parse xml string using simplexml's xpath method. when seek access nodes values straight using xpath empty output, when utilize xpath grab elements , loop through them works fine. when @ documentation, seems syntax should work. there i'm missing? <?php $xmlstring = '<?xml version="1.0" encoding="iso-8859-1"?> <users> <user> <firstname>sheila</firstname> <surname>green</surname> <address>2 st</address> <city>campbelltown</city> <country>australia</country> <contact> <phone type="mobile">1234 1234</phone> <url>http://example.com</url> <email>pamela@example.com</email> </contact> </user> <user> <firstname>bruce</firstname> <surname>smith</

c# - Auto detecting Baud Rate of Arduino -

c# - Auto detecting Baud Rate of Arduino - i'm trying observe baud rate of arduino mega2560 using c#. code below: serialport sp=new serialport(); sp.baudrate = 115200; baudrate specified constant this, automatically observe it. for instance, if arduino code includes serial.begin(xxxx), programme should declare sp.baudrate = xxxx. how can it? c# arduino baud-rate

css - Column flexbox fitting within another column flexbox -

css - Column flexbox fitting within another column flexbox - i'm trying ui looks this: in image pretend top bar "new york..." , "book it" button fixed , stuff between scrollable. the html have far (note .button , .form divs seek maintain illustration simple possible) <div class="wrapper"> <div class="sidebar"> <!-- hidden ui unless swipe left right --> </div> <div class="inner-wrapper"> <div class="header">title here</div> <div class="balance-bar">$0</div> <div class="app-content"> <div class="body-content"> <div class="form"> <input type="text"><br><br> <input type="text"><br><br> <input type="text"><br><br> <input ty

Oracle SQL Output to Excel - Date format issue -

Oracle SQL Output to Excel - Date format issue - i ran sql query oracle consists of invoice date , check date. when these info copied on excel spreadsheet text, it's dispayed ex: "13-10-31" (oct 31, 2013). however, when converted date format, it's displayed "10/13/1931". i've tried different date types recognizes first part of text day, month, year. need these values setup date format need calculate days payable outstanding , other related ratios. is there way convert these values excel recognizes day, month, , year correctly? there macro automate process existing info , info added in future? thank in advance. firstly, hope info type of date column date . secondly, date should have year yyyy , not yy . world has learned y2k bug. if above 2 points met, while displaying utilize to_char(date_column, 'mm/dd/yyyy') . thus, yyyy format, there won't confusion between year , other fields. excel oracle excel-vba

jquery - Stepwizards in a laravel app -

jquery - Stepwizards in a laravel app - please want utilize step wizard in ui laravel , jquery. problem in each step interface have form @ to the lowest degree 3 or 4 commom fields same validator error. the problem is: in first step , wwhen submit form ( in first step) see other form in other step validated although have disabled it. can help me how solve problem. thanks lot in advance. jquery laravel wizard

java - I got message id from gcm. but I'm not receiving on emulator -

java - I got message id from gcm. but I'm not receiving on emulator - this sender code used send message gcm. //sjsonobject obj = new jsonobject(); sender sender = new sender(google_server_key); message message = new message.builder().timetolive(120) .delaywhileidle(true).adddata(message_key, usermessage).build(); system.out.println("regid: " + regid); object result = sender.send(message, regid, 5); if (stringutils.isempty(((result) result).geterrorcodename())) { system.out.println("success"); system.out.println(result.tostring()); } else{ system.out.println(((result) result).geterrorcodename()); system.out.println(result.tostring()); } manifest file: <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.get_accounts"

javascript - Bootstrap datepicker format not working on initialization -

javascript - Bootstrap datepicker format not working on initialization - i trying utilize angular-bootstrap datepicker module in app , encountered little problem. utilize input text , button displaying date this: <div class="row" id="datepicker"> <p class="input-group"> <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="currentdate" is-open="opened" datepicker-options="dateoptions" date-disabled="disabledt(date, mode)" ng-required="true" close-text="close" show-button-bar="false" ng-init="" readonly/> <span class="input-group-btn"> <button type="button" class="btn btn-default" ng-click="open($event)"> <i class="glyphicon glyphicon-calendar"></i>

OpenCV Python HoughCircles: Circles detected outside of image boundary -

OpenCV Python HoughCircles: Circles detected outside of image boundary - i using opencv houghcircles method in python follows: circles = cv2.houghcircles(img,cv.cv_hough_gradient,1,20, param1=50,param2=30,minradius=0,maxradius=0) this seems work quite well. however, 1 thing noticed detects circles can extend outside of image boundaries. know how can filter these results out? think of each circle beingness bounded within square of dimensions 2r x 2r r radius of circle. also, centre of box located @ (x,y) corresponds centre of circle located in image. see if circle within image boundaries, need create sure box contains circle not go outside of image. mathematically speaking, need ensure that: r <= x <= cols-1-r r <= y <= rows-1-r # assuming 0-indexing rows , cols rows , columns of image. have cycle through every circle in detected result , filter out circles go outside of image boundaries checking if centre of each circle within 2 inequali

python 3.x - redis-collections basestring error -

python 3.x - redis-collections basestring error - am using redis-collections version 0.1.5 python3.4 throwing basestring errors. >>>from redis_collections import dict >>>d = dict() >>>d['answer'] = 42 >>>d traceback (most recent phone call last): file "<stdin>", line 1, in <module> file "/home/lukik/venv/py34/lib/python3.4/site-packages/redis_collections/base.py", line 296, in __repr__ info = self._repr_data(self._data()) file "/home/lukik/venv/py34/lib/python3.4/site-packages/redis_collections/dicts.py", line 171, in

php - Get the .html after the echo -

php - Get the .html after the echo - how link of .html after .$obj->product_name. ? i have tried bellow. shows link of http://.com/forbiden insted of http://.com/forbiden rice.html cuts rice.html echo '<span class="product-name"><a href=products/'.$obj->product_name ."html". 'target=_blank>'.$obj->product_name.'</a></span></br>'; try urlencode($obj->product_name) hope helps :) php

android - Read SIM card contacts -

android - Read SIM card contacts - i developping android application, , want read or sim card contacts button click. help me ? my button xml code : <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignright="@+id/third" android:layout_below="@+id/third" android:layout_margintop="30dp" android:text="read contact" android:onclick="contactsaccess"/> i need java code used within methode (contactsaccess). public class mainactivity extends actionbaractivity implements onclicklistener { button sim_btn; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.your_view); sim_btn = (button)findviewbyid(r.id.button1); sim_btn.setonclicklistener(this);

c# - How to hide Windows Phone 8.1 soft keyboard effectively? -

c# - How to hide Windows Phone 8.1 soft keyboard effectively? - i want hide soft keyboard when enter key tapped, no solutions works me properly. (windows phone 8.1 universal app) this 1 doesn't work: if (e.key == virtualkey.enter) { textbox.isenabled = false; textbox.isenabled = true; } a method this: private void losefocus(object sender) { var command = sender control; var istabstop = control.istabstop; control.isenabled = false; control.istabstop = false; control.isenabled = true; control.istabstop = istabstop; } works partially. it's hiding keyboard when i'm using textbox first time. on sec time keyboard reappearing. there direct api back upwards hide , show inputpane. don't need seek false out system. the windows.ui.viewmanagement.inputpane.tryshow , tryhide methods available on windows phone 8.1. the other alternative move focus more appropriate command when user hits enter. c# xaml windows

php - .htaccess url rewriting not working? -

php - .htaccess url rewriting not working? - i'll honest in saying have little experience .htaccess i've wanted remain away best can. however, i've wanted tidy urls , i've found it's possible through .htaccess , rewriting. basically, want rewrite url like: www.mysite.com/profile.php?id=48194 to like: www.mysite.com/profile/48194 here's code have currently: rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^(.*)$ $1.php rewriterule ^profile/(.*)/$ profile.php?id=$1 the line i'm trying utilize on bottom, rewriterule ^profile/(.*)/$ profile.php?id=$1 . rest used remove page extensions urls. i've changed $1 $2 thinking perhaps conflicting code above, nil changed. i removed code except rewriteengine on , lastly line thinking maybe codes conflicting but, again, nil changed or worked. rest of code work, removing extensions urls is, know rewrite thing on. could see

ios - Cannot connect IBOutlet of UIView declared in protocol to a xib entity -

ios - Cannot connect IBOutlet of UIView declared in protocol to a xib entity - i have iboutlet declared in protocol: @protocol someprotocol <nsobject> @property (nonatomic, strong) iboutlet uiview* view; @end then there class inherits protocol: //.h @interface someclass : nsobject <someprotocol> @end //.m @implementation tsnfactoryviews @synthesize view = _view; @ned and in xib file set someclass class owner expect see view outlet , connect appropriate xib instance. in xcode 4 had no issue concept. since xcode 5, view disappears sometime , in xcode 6 has disappeared, strangely has disappeared in xib files, application can compile , run without issue. the problem have new xib files because can not setup relationship. looks bug me. edit: the someclass in case mill class generates view instances or/and keeps instances of view. way several years without issue. connection bullet on left iboutlet uiview view;* disappeared. have many xib files file ow

javascript - Am I supposed to code a different Gulp file for every project? -

javascript - Am I supposed to code a different Gulp file for every project? - i mean – need same gulp configuration, same functions, same plugins (sass css compilation, minifying javascript, etc.). have code new gulpfile.js every time start new project? or way deploy usual gulp configuration in new project? or did totally misunderstand gulp? you might want have @ yeoman; can install various generators different types of project may want build. many of generators walk through creating new project, frameworks you'd install etc, plus generate gulpfile or gruntfile automatically. if find starting lot of projects same boilerplate worth having at. here's generator gulp powered webapp: https://github.com/yeoman/generator-gulp-webapp javascript gulp

javascript - jQuery - on('click') event doesn't work on dynamic objects -

javascript - jQuery - on('click') event doesn't work on dynamic objects - this question has reply here: event binding on dynamically created elements? 13 answers <ul id="listaatributos" class="editable isatribute"> <li>atributo 1<i class="js-remove">✖</i></li> <li>atributo 2<i class="js-remove">✖</i></li> <li>atributo 3<i class="js-remove">✖</i></li> </ul> $('#listaatributos').append('<li>atributo<i class="js-remove">✖</i></li>') $('.js-remove').on('click', 'js-remove', function(){ $(this).parent().remove() }) this code doesn't work, tell me why? bind event parent element has been nowadays on dom $('#listame

r - create function to ggplot with data.table -

r - create function to ggplot with data.table - i trying minimise code using functions regularly repeated pieces of code. have need create important number of charts wanting simplify readability. pretty of info in data.table structures wanting pass function create plot. reproducible example library(ggplot2) library(gtable) library(grid) grid.newpage() dt.diamonds <- as.data.table(diamonds) d1 <- dt.diamonds[,list(revenue = sum(price), stones = length(price)), by=clarity] setkey(d1, clarity) mybarchart <- function(data, xdata, ydata, xlabel="", ylabel="", myfill="", myscale="comma") { ggplot(data, aes(x=xdata,y=ydata, fill=myfill)) + geom_bar(stat="identity") + labs(x=xlabel, y=ylabel) + scale_y_continuous(labels=myscale, expand=c(0,0)) + scale_fill_identity(name="") + theme_bw() } mybarchart(d1, "clarity", "revenue") #or mybarchart(d1,

ruby on rails - Capistrano: Don't know how to build task 'assets:precompile' -

ruby on rails - Capistrano: Don't know how to build task 'assets:precompile' - i trying utilize capistrano deploying rails app. if seek run "cap production deploy", error "don't know how build task 'assets:precompile'" if run "rake assets:precompile" on server, same error. gemfile: source 'https://rubygems.org' # bundle border rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.1.6' # utilize sqlite3 database active record gem 'sqlite3' # utilize scss stylesheets gem 'sass-rails', '~> 4.0.3' # utilize uglifier compressor javascript assets gem 'uglifier', '>= 1.3.0' # utilize coffeescript .js.coffee assets , views gem 'coffee-rails', '~> 4.0.0' # utilize jquery javascript library gem 'jquery-rails' # turbolinks makes next links in

tableview - ios - makes appear all cell delete button by an action -

tableview - ios - makes appear all cell delete button by an action - i have table view (filled customs cells) , thought have tabbar button (such "edit button"). pressing on it, in row, button cancell appear. possible? you can create code button (you know... uibutton* button = [uibutton alloc]init]; ) in cell , set hidden = yes , add together bool check if "edit button" pressed, lets name bool editactive , when button pressed check editactive , if no hidden value of button no , reload table [yourtableview reloaddata] , otherwise, if editactive = yes , must hide "cancel button" in cell , 1 time 1 time again utilize [yourtableview reloaddata] ios tableview

python - Copy reference and concatenate lists -

python - Copy reference and concatenate lists - when have several objects , set them list, list holds references objects. need same behaviour lists themselves. so lets have: list1 = [1,2,3] list2 = [4,5,6] ... i want have alllists this: alllists = [list1, list2, ..., listn] but python this: list1 = [1,2,3] list2 = [4,5,6] ... alllists = [1, 2, 3, 4, 5, 6, ...] i tried append, insert, concatenate or utilize + operator, python copies content info of each list alllists instead of copying referencs of list1 listn , save references in alllists. is possible, references of list1 listn in alllists? you can't things way want to. you're going need create new list , append lists individually in [1]: super_list = [] in [2]: list1 = [1,2,3] in [3]: list2 = [4,5,6] in [4]: super_list.append(list1) in [5]: super_list.append(list2) in [6]: super_list out[6]: [[1, 2, 3], [4, 5, 6]] python list reference concatenation

java - InjectionUtils can not access a member of class DateTimeZoneBuilder$PrecalculatedZone -

java - InjectionUtils can not access a member of class DateTimeZoneBuilder$PrecalculatedZone - i trying send post request cxf implementation. getting java.lang.illegalaccessexception: class org.apache.cxf.jaxrs.utils.injectionutils can not access fellow member of class org.joda.time.tz.datetimezonebuilder$precalculatedzone modifiers "public" my method interface : @get @path("history") historyresult gethistory(@valid @queryparam("") historyparameters historyparameters) historyparameters has 2 joda time localdate : public class historyparameters { @notnull @queryparam("historytype") private historytype historytype; @fielddescription(title = "archive date", value = "archive date") @queryparam("archivefromdate") private localdate archivefromdate; @fielddescription(title = "archive date", value = "archive date") @queryparam("archivetoda

c++ - Struct size stays the same even after adding a new member to it -

c++ - Struct size stays the same even after adding a new member to it - when execute cout << sizeof(string); i got 8 answer. now having structure typedef struct { int a; string str; } mytype; and executing cout << sizeof(mytype); i got 16 answer. now made alter in structure typedef struct { int a, b; string str; } mytype; and executing cout << sizeof(mytype); i got 16 answer!!!. how? happening? perhaps padding happening. e.g. sizeof(int) can 4 bytes , compiler can add together 4 bytes after a sake of info alignment. layout this: typedef struct { int a; // 4 bytes // 4 bytes padding string str; // 8 bytes } mytype; typedef struct { int a; // 4 bytes int b; // 4 bytes string str; // 8 bytes } mytype; c++ string struct

html - Header affecting Inpage navigation -

html - Header affecting Inpage navigation - i've been making webpage , have given page fixed header. i've given main div margin text comes below header. yet when using links link difference part of page, text goes below header , not @ required section of page visible. html css hyperlink header webpage

java - Spring 3.2.12 looking for Spring 4.0 classes? -

java - Spring 3.2.12 looking for Spring 4.0 classes? - i have application compiles correctly spring 3.2.3. wanting more (but not ready take plunge 4.x yet) tried upgrading 3.2.12. when go that, curious compilation error aspectj: [info] --- aspectj-maven-plugin:1.3:compile (default) @ ebs-schema-jaxb-bindings --- [error] can't determine superclass of missing type org.springframework.cache.interceptor.cacheaspectsupport when batch building buildconfig[null] #files=3825 aopxmls=#0 [xlint:cantfindtype] [error] can't determine superclass of missing type org.springframework.aop.interceptor.asyncexecutionaspectsupport when batch building buildconfig[null] #files=3825 aopxmls=#0 [xlint:cantfindtype] i think understand logic here, why spring 3.2.12 referring spring 4.x interfaces? , how find subclasses causing troubles? happening in projects don't have pointcuts @ all. if utilize maven seek utilize dependency:tree find lib import spring 4 libs. and seek

javascript - jQuery How to check if the current position of a div is equal to -

javascript - jQuery How to check if the current position of a div is equal to - i stuck. working on jquery game , need know current position of object , check if equals 0. tryed different things never work.. here code: function movepoint() { $( '.point' ).each( function() { if($(this).attr('id').position().left == 0) { console.log("yay!"); } $( ).css( 'left', $( ).position().left - ( speed + (roundsclicked / 10) ) ); console.log("left position of element - " + $(this).position().left); }); } just alter code function movepoint() { $( '.point' ).each( function() { if($(this).position().left == 0) {// if($(this).css('left') == '0px') console.log("yay!"); } $( ).css( 'left', $( ).position().left - ( speed + (roundsclicked / 10) ) ); console.log("left position of element - " + $(this).positio

python - Symbol not found error when I run a py2app application on OS X 10.4 Tiger -

python - Symbol not found error when I run a py2app application on OS X 10.4 Tiger - i trying bundle python application, more specifically, django site, self-contained .app container mac os x. using py2app on os x 10.6 bundle app. the result works fine on os x 10.5 or newer, doesn't on customer's os x 10.4 tiger. fails next error: /.../binary dyld: symbol not found: ___stack_chk_guard referenced from: /.../binary expected in: /usr/lib/libsystem.b.dylib what compile binaries without references symbol, i.e., cross-compile application on os x 10.6 machines running 10.4? how can check whether binary references symbol on os x newer tiger? not have test machine os x 10.4 here. python osx py2app

android - Is it possible to inflate a CustomLayout : FrameLayout in Xamarin in its own constructors and own class methods? -

android - Is it possible to inflate a CustomLayout : FrameLayout in Xamarin in its own constructors and own class methods? - here illustration inflate... framelayout , have layout axml file... inflate layout parent of framelayout (a fragment)... want custom framelayout in other fragments. in method initialize() compiler says error cs1604: cannot assign '' because read-only (cs1604) (myproject.mono) , error cs0266: cannot implicitly convert type 'android.widget.framelayout' 'myproject.mono.viewartistalbumtrack'. explicit conversion exists (are missing cast?) (cs0266) (navi.mono) /// <summary> /// view artist album track. /// framelayout especific ... /// </summary> public class viewartistalbumtrack : framelayout { /// <summary> /// adapter. /// </summary> public expandableaatitemadapter adapter = null; /// <summary> /// plain expandablelistview /// </summary>

sql - Is it possible to open Firebird database file without installing db server? -

sql - Is it possible to open Firebird database file without installing db server? - i'd inspect existing firebird (2.5.1) database without having install server. are there tools out there allow inspection of database file? if not: there tools can run on scheme database server running take @ it? yes, can utilize embedded server. total explanations here : http://www.firebirdsql.org/manual/ufb-cs-embedded.html sql database firebird

Control which library dependency exported in SBT -

Control which library dependency exported in SBT - i looking way command library dependency exported, , not. along lines: "org.slf4j" % "slf4j-api" % "1.7.6" donotexport or perhaps @ point project imported, this: lazy val main = project(appname, file("."), settings = buildsettings) .dependson(projectref(uri("../utils"), "utils").exceptlibrarydependency(organization="org.slf4j")) is there in sbt? well, depends on configurations. default configurations expose dependencies again. similar behavior can achieved this: val compileonly = config("compileonly").hide ivyconfigurations += compileonly unmanagedclasspath in compile ++= update.value.select(configurationfilter(compileonly.name)) "org.slf4j" % "slf4j-api" % "1.7.6" % compileonly note technique descibed in reply add compile time dependency in sbt. this question should closed duplicate, b

Javascript - Why Functions Vs Code Blocks are Needed Sometimes -

Javascript - Why Functions Vs Code Blocks are Needed Sometimes - okay, way explain example. in javascript can such as: if(condition) { } the { , } used identify code block. in cases such this: window.onload = function() { } you need function() included. why can't be: window.onload { } why need function() ? also, thought functions have name associated them, , when name called function runs, why in case there function no associated name? if , for , while , try , catch , etc. statements modify next statement. example, if (condition) statement execute next statement if condition look evaluates true (or truthy). block statement special type of statement used grouping multiple statements together, allowing if statement apply larger section of code. however, window.onload = function() { } expression—an entirely different construct. it's assignment look consisting of 3 parts, assignment operator ( = ) look representing value assign (in case

android - Animating 3 parts of a view -

android - Animating 3 parts of a view - i trying create app view that, when presented subtraction problem, show animation of growing rectangle (or fat line) crawls number line integer. i have things set click "show me!" , bars drawn along number line showing minuend, subtrahend , difference, i'd able have positive number's rectangle crawl in positive direction, negative 0 in negative direction. in looking through documentation there seem several different ways go this. hoping can suggest way that's reasonably simple novice implement. here different approaches i've found: this seems much person's want have bar graph bars "pop up," doesn't have answer. android animated bar chart (invalidate()) i've perused http://developer.android.com/guide/topics/resources/drawable-resource.html -- don't have "drawable" because it's beingness drawn in view. i'm thinking of making rest of number line backgro

python - NameError: global name 'imshow' is not defined but Matplotlib is imported -

python - NameError: global name 'imshow' is not defined but Matplotlib is imported - i'm writing python script plots numpy matrix containing info (which i'm not having difficulty computing). complicated reasons having how i'm creating data, have go through terminal. i've done problems 1000000 times in spyder using imshow() . so, thought i'd seek same in terminal. here's code: numpy import * matplotlib import * def make_picture(): f = open("data2.txt") arr = zeros((200, 200)) l = f.readlines() in l: j = i[:-1] k = j.split(" ") arr[int(k[0])][int(k[1])] = float(k[2]) f.close() imshow(arr) make_picture() suffice say, array stuff works fine. i've tested it, , extracts info well. so, i've got 200 200 array of numbers floating around ram , i'd display it. when run code in spyder, expecte

How to import specified cells in csv to oracle table with sql loader -

How to import specified cells in csv to oracle table with sql loader - given csv file 'example.csv' i load cell c7 column x cell c8 column y cell d7 column z of oracle table 'exampletable' and on. csv file not have orderly rows , columns, cannot load csv file new table cleanly. asking how map cells table columns loading file oracle (xe). can point me tutorial? i realize pretty elementary, please allow me know if have under-specified in question. sql*loader operates on rows of input info , shoves them table. can either append rows table, or truncate table , insert. there no updating. want load info column in input file different table columns, not do. that said, 1 able utilize 'when' clause of command file load entire row differently based on value beingness tested. so, example, 1 have parent , kid records in 1 csv info file long there input info column differentiates between 2 key off of. perhaps tricky , utilize acc

arrays - Total cost function in javascript -

arrays - Total cost function in javascript - i having issues (very lost) in making code me , friend given create. so suppose compute , homecoming average of values in given array named customerbalance, array holds amount of "what customers owe business" (i dont own business) , each item in array holds "customers balance", have utilize for() process array , calculate average , split customerbalance length, , homecoming average. here code far function average() { customerbalance for(i=0,i++) sum(customerbalance) total=sum/5 homecoming average; i know wrong, not sure on how start typing array, please don't harsh know how this. thank , have great day function average(customerbalance) { if (customerbalance.length == 0) { // prevent partition 0 later homecoming 0; } var total = 0; (var = 0; < customerbalance.length; i++) { total += customerbalance[i]; } var average = total/cu

merge - Git - master change, rebase onto complex branches? -

merge - Git - master change, rebase onto complex branches? - this question has reply here: rebasing branch including children 2 answers so have complex local branch structure: main working local branch, , 2 other branches off of it. there new alter in master want in branches. best way propagate of branches? rebasing possible? a---e---m master \ f---g---h local_branch_main |\ | i---j local_subbranch_1 \k---l local_subbranch_2 ideally, i'd want move branches reference off of new master commit (there no conflicts): a---e---m master \ f---g---h local_branch_main |\ | i---j local_subbranch_1 \k---l local_subbranch_2 you can way first do git checkout local_branch_main git rebase master if lucky , don't have conflicts reposit

Pivoting SQL Server result set -

Pivoting SQL Server result set - if have result returned follows: pktestinstanceid percent1 count1 percent2 count2 1 25 1 75 3 2 50 2 50 2 is there way pivots in such format: pktestinstanceid percent count 1 25 1 1 75 3 2 50 2 2 50 2 sorry if question totally misguided. i'm not super clear on pivoting process. help. edit should have noted percent1, count1, percent2 etc columns created based off of column (stackposition). if stackposition has 4 rows percent , count go percent4 count4. pivot or union still possible without knowledge of exact number of percent , count columns in result set. edit 2: gets bit more complicated now... i realize have include item in select statement (fkbandid). each bandid there stackposition stated above, bandid 96 stackposition