Posts

Showing posts from September, 2012

javascript - Adding left and right borders to slick slider -

javascript - Adding left and right borders to slick slider - i have slick slider , trying add together dashed border left , right of content. here's plunker: http://plnkr.co/edit/4iejdtelkfuo8ecqlpuh?p=preview i have 2 issues: the right border not showing there not plenty padding between border , text how can prepare above? html: <div class="container"> <div class="grid-wrap"> <div class="grid-col one-eighth"> <div class="your-class"> <div class="text-box">test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1</div> <div class="text-box">test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2</div> <div class="text-box">test3 test3 test3 test3 test3 test3 test3 tes...

python - mocking a function within a class method -

python - mocking a function within a class method - i want mock function called within class method while testing class method in django project. consider next structure: app/utils.py def func(): ... homecoming resp # outcome httpresponse object app/models.py from app.utils import func class mymodel(models.model): # fields def call_func(self): ... func() ... app/tests/test_my_model.py from django.test import testcase import mock app.models import mymodel class mymodeltestcase(testcase): fixtures = ['my_model_fixtures.json'] def setup(self): my_model = mymodel.objects.get(id=1) @mock.patch('app.utils.func') def fake_mock(self): homecoming mock.magicmock(headers={'content-type': 'text/html'}, status_code=2000, content="fake 200 response")) def test_my_model(self): my_m...

java - CardPile Index Out of bounds -

java - CardPile Index Out of bounds - i'm trying convert code arraylist , can't seem create work. i'm running whole programme , tells me index out bounds. i'm sure forgot add together size of array cards, don't know how add together it. help! edit: error @ bottom. also, tells me go removetop method. looks fine there. import java.util.random; import java.util.list; import java.util.arraylist; public class cardpile { private arraylist<card> cards = new arraylist<card>(); private static random r = new random(1); public void addtobottom(card c) { if (this.cards.size() == 52) { system.out.println("the cardpile full. cannot add together more card objects."); } this.cards.add(c); } public card removecard(card c) { if (this.cards.contains(c)) { this.cards.remove(c); } homecoming null; } public card removetop() { homecoming t...

sql - Do I need to issue CREATE INDEX everytime I update the database? -

sql - Do I need to issue CREATE INDEX everytime I update the database? - i have geo-map database columns of x,y,z,zoom , type. read speed slow when utilize call select image x = ... , y=... , zoom=... , type =... thanks kind help stack overflow, found indexing of (x,y,z,zoom) has helped improved read speed impressively. however, have question create index command need issue 1 time when database initialize @ first time? , database grow gradually, still enjoy read speed improvement brought indexing? or need issue create index command every time before close application(during application, database grow)? you need create index once. the database remember columns index , maintain changing index along table. if insert entry table, added index. if alter entry - modified in index. finally, if delete entry - removed index. note, index speed search operation - select on indexed columns, downgrade insert , update , delete . sql database sqlite database-desi...

knockout.js - knockout validation messages not showing up -

knockout.js - knockout validation messages not showing up - i've been working model single page app while , 1 little issue crops time time inconsistent error messages showing validated fields. jsfiddle example if play box below line on illustration before touching of links above, find works expect. but, 1 time start clicking on links edit, or add together new record, validation messages stop displaying. validation model still works though (as evidenced message i've hard coded below edit form text input). i guess i'm asking, what's deal? bug validation? result of way structuring type of page? summary of design can sense design choices here - set object (called pm) , attach bunch of elements it. 1 of elements edit observable phone call pm.item. i'm taking approach because lot of pages design load list of records people want able edit. rather having them edit record straight require maintain track of state , reset it, pass info list item edi...

Android: Squared Diamond Drawable -

Android: Squared Diamond Drawable - i'm trying create drawable utilize view background consists of single squared diamond centered. i've been playing trying create square , rotating 45 degrees, it's not working out i'd expect. wondering if has suggestions or working illustration offer help me out. i've tried making in xml, , switched trying in java, so: public class diamondview extends drawable { private paint paint; public diamondview() { paint = new paint(); paint.setantialias(true); } @override public void draw(canvas canvas) { int height = getbounds().height(); int width = getbounds().width(); rectf rect = new rectf( 0.0f, 0.0f, height / 2, height / 2 ); canvas.rotate( 45 ); canvas.translate( width / 4, 0 ); canvas.drawrect( rect, paint ); } @override public void setalpha(int alpha) { paint.setalpha(alpha); } @override public void setcolorfilter(colorfilter cf) { paint.setcolorfilter(cf); } @override p...

Localizing dates in android -

Localizing dates in android - after reading accepted reply date formatting based on user locale on android german, tested following: @override protected void onresume() { super.onresume(); string dateofbirth = "02/26/1974"; simpledateformat sdf = new simpledateformat("mm/dd/yyyy"); date date = null; seek { date = sdf.parse(dateofbirth); } grab (parseexception e) { // handle exception here ! } // localized date formats dateformat dateformat = android.text.format.dateformat.getdateformat(getapplicationcontext()); string s = dateformat.format(date); datetv.settext(s); } here dateofbirth english language date. if alter phone's language high german however, see 02.26.1974. according http://en.wikipedia.org/wiki/date_format_by_country, proper localized high german date format dd.mm.yyyy, hoping see "26.02.1974". this leads question, there way localize dates or manual process mu...

linux - Python LDAP - Move user to different OU -

linux - Python LDAP - Move user to different OU - background: have been using python-ldap module on linux machine manage user accounts on remote windows server 2008. have been able search for, create, , modify users, exception of changing user's 'ou'. i have tried using 'modify_s' , 'modrdn_s' since modrdn allows alter first part of dn, haven't had luck modifying 'ou' or moving user new 'ou'. temporarily creating new user , copying attributes able old user, deleting old user. doesn't allow me retain user creation date , other un-editable information. i have thoroughly searched net , found few solutions, but: on other operating systems: how move user different ou using python , other programming languages: active directory ldap move user different ou - ruby possible in python-ldap on linux or there work-arounds? give thanks you! you need utilize rename_s , specify newsuperior parameter. quick sample code: ...

Maps infowindow is not opening on mouseover event (coffeescript) -

Maps infowindow is not opening on mouseover event (coffeescript) - i researched , tried find solution. have admit no expert in coffeescript. maybe obvious error have no clue , happy if help. i created markers on google maps. click applisteners possible open specific htmls belongs markers. need infowindow each marker, should oben on mouseover , close when leaving. have no thought why not working. tried other solutions, worked in javascript not me in coffeescript. here code: ### define lodash : _ backbone : backbone marionette : marionette app : app parse : parse ### class mapview extends marionette.view default_center : [0, 0] default_zoom : 10 classname : "map-view" render : -> mapoptions = zoom: @default_zoom streetviewcontrol: false pancontrol: false center: new google.maps.latlng(@default_center...) maptypeid: google.maps.maptypeid.roadmap @map = new google.maps.map(@el, mapoptions) @infowindow = new g...

Facebook android SDK -

Facebook android SDK - i want utilize sdk, , can not create project existing source facebook dir. , @ importing project error: 19:32:32 - com.android.ide.eclipse.adt.internal.project.androidmanifesthelper] unable read c:\androidmanifest.xml: java.io.filenotfoundexception: c:\androidmanifest.xml (system not find file) [2010-09-25 19:32:32 - com.android.ide.eclipse.adt.internal.project.androidmanifesthelper] unable read c:\androidmanifest.xml: java.io.filenotfoundexception: c:\androidmanifest.xml (system not find file) under project->properties->android, seek selecting 'android 2.2' android facebook

unit testing - Replacing a C function from a common .o file for the scope of a single test executable -

unit testing - Replacing a C function from a common .o file for the scope of a single test executable - so, i've got library phone call init_foo() , , function bar() calls it. these live in library.o along other useful stuff both need. i want write code, bar_init_failure.t.c , test happens when init_foo() fails, without setting failure. in perl, mass of our codebase, i'd launch test::resub , replace library phone call stub returns failure code. accomplish similar in c, vaguely under impression redefine init_foo in source bar_init_failure.t.c , still link against library.o rest of code, gcc , ld complain duplicate symbols (instead of picking first one) think must wrong (and i'm pretty rusty on sort of stuff, i'm not over-confident in strategy). is there way appease linker here, or there strategy should using? (i'd prefer not have hack library.c code if can help it.) if can recompile library.c shared library, can redefine init_foo() within...

excel - Add/Delete optional personal form in VBA -

excel - Add/Delete optional personal form in VBA - what simplest/best way accomplish functionality in vba in excel: - button "add person" add together 4 rows in user specifies name..., " - button "delete person" appearing in new added entry - delete what workflow doing that? should record first? should write vba only? how maintain part can added/deleted - somewhere hidden or in vba? well simplest solution create macros; to add together person after that, need assign macro button vba ( right click , assign macro).and loop 4 times. to delete person -->1st create button , set visibility false. after need identify row number, , set button visible in vba excel vba excel-vba excel-2003

Java Not Updating Url Contents -

Java Not Updating Url Contents - i have .txt file read exclusively via url next code: public static string getfilecontents(string internetaddress) throws malformedurlexception, ioexception { url url = new url(internetaddress); inputstream inputstream = url.openstream(); stringbuffer textbuffer = new stringbuffer(); int readinteger = 0; while ((readinteger = inputstream.read()) != -1) { textbuffer.append((char) readinteger); } // prevent resource leakage inputstream.close(); homecoming textbuffer.tostring(); } usage example: string text = getfilecontents("http://www.example.com/file.txt"); when update file.txt on server via ftp client filezilla browser , filezilla show file has been updated when run java code above retrieve contents variable text not contain current info rather previous/initial. why not fetch newest info on every execution , how prepare it? there no cache on repeated ...

php - Laravel 5 request - How to show individual validation errors -

php - Laravel 5 request - How to show individual validation errors - i have created request in l5 handle saving contact looks so: <?php namespace app\http\requests; utilize app\http\requests\request; class addcontactrequest extends request { /** * determine if user authorized create request. * * @return bool */ public function authorize() { homecoming true; } /** * validation rules apply request. * * @return array */ public function rules() { homecoming [ 'category_ids' => 'required|array|exists:categories,id', 'gender' => 'required|in:male,female', 'first_name' => 'required', 'last_name' => 'required', 'company' => 'required', 'position' => 'required', 'website_url' => 'url...

angularjs - Angular animate not working with swappable divs -

angularjs - Angular animate not working with swappable divs - i'm trying create animated transitions when swapping 2 divs using ng-show , ng-hide on both. code: <div ng-show="logintoggler === 'register'"> register </div> <div ng-show="logintoggler === 'login'"> login </div> my css partial animating : .ng-hide-add { animation:0.5s lightspeedout ease; } .ng-hide-remove { animation:0.5s lightspeedin ease; } animations working when first div appearing/disappearing. none of suitable transition effects apply on sec div (it works same way when swap divs position in code - 1 before in code has transition effects applied). angularjs web jquery-animate transition

java - How Regex backreference work -

java - How Regex backreference work - i aware of fact backreference ovverride values if backtraking occurs , ovverided output new backreference. but if take regex example: ([abc]+).*\1 then string: "abc me bca" the output is: "abc me bca" can explain how possible because per steps: -[abc] matches input. -because quantifier + repeate 1 or more time , 1 time again matches b , c.then stops @ whitespace it's not either 'a', 'b' or 'c'. -.* eats input string after abc , farther goes \1(the backreference). - .* backtracking \1 fails , because .* i.e 0 or more through charecters , 1 time again + of [abc]+ backtracking. -in backtracking of [abc]+ until 'a' after removing 'b' , 'c' still no match \1 bca. so how output came "abc me bca"..? first character a , lastly character a .so match. what happens abc captured in grouping compared bca .it fails. so engine ba...

php - Possible OneToOne Doctrine Entity Mapping? -

php - Possible OneToOne Doctrine Entity Mapping? - i'm forced work fixed database schema, , wondering if possible. 2 tables, , hopeful create unidirectional onetoone mapping. simplified: /** * @orm\entity * @orm\table(name="superheroes") */ class superhero { /** * @var int * @orm\id * @orm\generatedvalue(strategy="auto") * @orm\column(type="integer", nullable=false, options={"unsigned"=true}) */ protected $id; /** * @var string * @orm\column(type="string", length=64, nullable=false) */ protected $name; } and ultimate, personal, only-they-can-use weapons: /** * @orm\entity * @orm\table(name="superhero_weapons") * */ class weapon { /** * @var int * @orm\id * @orm\column(type="integer", nullable=false, options={"unsigned"=true}) */ protected $superhero_id; /** * @var string * @orm\co...

apache - {solved}Wamp server error: The filename , directory name , or volume label syntax is incorrect -

apache - {solved}Wamp server error: The filename , directory name , or volume label syntax is incorrect - i have wamp server error: the filename, directory name, or volume label syntax incorrect this happens when seek open phpmyadmin or thing webgrind or help . how can solve this? solved i had go c:\wamp\wampmanager.conf , edit file on line 7 from navigator = "c:\windows\notepad.exe" to navigator = "c:\windows\explorer.exe" apache wamp ip-address web-hosting

xcode - CanvasCamera for iOS PhoneGap / Cordova -

xcode - CanvasCamera for iOS PhoneGap / Cordova - first of all, i'm new cordova , xcode , i'm trying create inline qr code scanner , html 5 app (or @ to the lowest degree see if it's possible plugin). i'm trying follow instructions https://github.com/daraosn/cordova-canvascamera , unsure format or how edit config.xml in project. the instructions say: "edit config.xml , add together canvascamera plugins list." dont know means or format should follow. also, when add together plugins plugin folder in project, xcode throws error saying: "'nsautoreleasepool' unavailable: not available in automatic reference counting mode". i know getusermedia isnt back upwards in safari/ios it's pushing boundaries bit. if else fails, i'll utilize input type=file , access photographic camera way. that plugin reference looks severely dated. best guess is, config.xml, add: <plugin name="canvascamera" /> once co...

python - Matplotlib inset graph scaling, coloring, -

python - Matplotlib inset graph scaling, coloring, - been fiddling insets graphs in matplotlib , have tried multiple posts , threads solve close no cigarr. work ended here: import pandas pd import numpy np import matplotlib.pyplot plt %matplotlib inline df1 = pd.dataframe(np.random.randn(10, 3), columns = ['a', 'b', 'c']) df2 = pd.dataframe(range(3, 13), columns = ['new index']) df = df1.join(df2) #this fastest way come df = df.set_index(['new index']) #set new index column in dataframe #trying add together zoomed in insets %matplotlib inline ax1 = df.plot() plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.) plt.xlim([3,12]) plt.gca().invert_xaxis() #need inverted axis c = plt.axes([0.15, 0.6, .2, .2]) plt.plot(df[::-1]) #invert axis here plt.title('zoomed a') plt.setp(c, xlim=(1,2),ylim=(-1.5, 1.5), xticks=[1, 2], yticks=[]) plt.show() and questions are: how alter linestyle or color 2 of lines , not other...

r - error when using which.min() with ave() -

r - error when using which.min() with ave() - i have data, much of na . simplicity, let's looks this: x = c(na, 3, 4, 3.5, na, na, na, na, 7, 5) bins = c(1, 1, 1, 2, 2, 2, 3, 3, 4, 4) i'm using ave( ) , which.min( ) minimum value each bin type: ave(x, segments, fun = which.min) but error: error in `split<-.default`(`*tmp*`, g, value = lapply(split(x, g), fun)) : replacement has length 0 the reason happening (i think) because bin # 3 has na values. when rectified, error disappears. utilize function like: ave(x, segments, fun = function(xx){ if(all(is.na(xx))){ return(na) } else { xx = which.min(xx) return(xx) }} ) but: 1) hacky heck. and 2) which.min(c(na, na, na)) not cause error, nor ave(c(na, na, na), c(1, 1, 1), fun=mean) - what's going on i'm missing? --> have thought of why error happens / best way around it? cheers. r

encryption - PHP CAST-256 mcrypt output differs -

encryption - PHP CAST-256 mcrypt output differs - i attempting encrypt string using cast256 , cbc, via php function mcrypt_encrypt . using key test input test , produces next code: mcrypt_encrypt(mcrypt_cast_256, 'test', 'test', mcrypt_mode_cbc); the base64 encoded version of produces (on php version 5.5.12): daypocfvfoi8ghemj0zkeg== however, comparing output against tool on http://www.tools4noobs.com/online_tools/encrypt/, , output differs significantly; site output using aforementioned cipher, mode, key, , info following: eiknqgahjsgh+11xzsa2lg== decrypting each string using opposite tool (i.e. site output decrypted php, , php output decrypted via site) gives next output: ducd000000000000 (site output) ducd000000000000 (php output) however, decrypting using same medium string encrypted gives input info ('test'). my question is, is there reason difference, such omission of iv when encrypting/decrypting or misuse of php mcry...

CentOS x86 but PHP looking for mysql in /lib64/ -

CentOS x86 but PHP looking for mysql in /lib64/ - it's straight, don't know why php maintain looking mysql.so in /lib64 because vps running centos 6.8 x86. i have double check , don't see reference to /lib64 @ all php.ini: extension_dir = "./" my.ini: extension=/usr/lib/php/modules/php_mysql.so here httpd error log, suggestion ? php warning: php startup: unable load dynamic library '/usr/lib64/php/modules/mysql.so' - /usr/lib64/php/modules/mysql.so: cannot open shared object file: no such file or directory in unknown on line 0 php mysql centos6

How to create a list view as a part of a form in android -

How to create a list view as a part of a form in android - how create listview part of form in android using listview part of form similar select alternative in html looking for. you need utilize spinner purpose. android

scala - Reusable streams from file -

scala - Reusable streams from file - how create reusable stream file in scala? have huge file, , want utilize contents multiple times, may not need read whole file completely i have tried this, without success, // file iterator val f = source.fromfile("numberseq.txt").getlines // build stream file iterator def numseq: stream[bigint] = stream.cons(bigint(f.next()),numseq) //test numseq take 5 foreach println numseq take 5 foreach println //the stream continues print next file lines instead of going first line the simplest way utilize tostream right on iterator: scala> val f = list(1,2,3,4,5,6,7,8,9,10).toiterator.tostream f: scala.collection.immutable.stream[int] = stream(1, ?) scala> f take 5 foreach println 1 2 3 4 5 scala> f take 5 foreach println 1 2 3 4 5 in concrete case, problem had whole new stream on every numseq phone call because of def used instead of val . still need def recursive definition, don't fo...

Java : Read multiple xml from a single text file and store them as a List -

Java : Read multiple xml from a single text file and store them as a List<string> - consider next text file content : <testfile> <testfile_id>654316</testfile_id> <testvin>ere</testvin> <testtype_er>fd 91 mux</testtype_er> <test_rt> <test41_long_cs>b001_001_001</test41_long_cs> </test_rt> </testfile> <testfile> <testfile_id>654317</testfile_id> <testvin>dfg</testvin> <testtype_er>fd 91 mux</testtype_er> <test_rt> <test44_long_cs>b001_001_001</test44_long_cs> </test_rt> </testfile> <testfile> <testfile_id>654318</testfile_id> <testvin>dfgd</testvin> <testtype_er>fd 91 mux</testtype_er> <test_rt> ...

Pre-fill JSF form on button before final form submit -

Pre-fill JSF form on button before final form submit - i pre-fill form, not pre-fill while loading page when user pushes button. "fill form informations product depending on id (user have write it)". can see illustration on image linked below. commandbutton "fetch data" create job , fills fields on form when submit form, values product name, weight , descriptions null, , because of jsf lifecycle (after first submit application goes steps 5 , 6 in jsf lifecycle), help me it? thanks screenshot - form example <?xml version="1.0"?> <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets" > <h:head> <...

elasticsearch - What is the use of mapping fields with "type" : "token_count" and does it help in getting better results? -

elasticsearch - What is the use of mapping fields with "type" : "token_count" and does it help in getting better results? - what mapping field "type" : "token_count" used for? have gathered stores number of tokens in string rather string fail realize why of importance, because storing number of tokens in string instead of string beats point of search. have been looking @ wrong way or there missing? elasticsearch

time series - The curious case of ARIMA modelling using R -

time series - The curious case of ARIMA modelling using R - i observed unusual while fitting arma model using function arma{tseries} , arima{stats} in r. there radical difference in estimation procedures adopted 2 functions, kalman filter in arima{stats} opposed ml estimation in arma{tseries}. given difference in estimation procedures between 2 functions, 1 not expect results radically different 2 function if utilize same timeseries. well seems can! generate below timeseries , add together 2 outliers. set.seed(1010) ts.sim <- abs(arima.sim(list(order = c(1,0,0), ar = 0.7), n = 50)) ts.sim[8] <- ts.sim[12]*8 ts.sim[35] <- ts.sim[32]*8 fit arma model using 2 function. # works fine arima(ts.sim, order = c(1,0,0)) # works fine arma(ts.sim, order = c(1,0)) change level of timeseries factor of 1 billion # introduce multiplicative shift ts.sim.1 <- ts.sim*1000000000 options(scipen = 999) summary(ts.sim.1) fit arma model using 2 functions: # wor...

java - Can you equalsIgnoreCase a Set? -

java - Can you equalsIgnoreCase a Set? - so, have program, , users target in set called 'computer'. user enters in 'computer', 'computer','computer', never finds because it's not capitalized correctly. how go taking set words = ... ... ... , taking info within of set , checking if equal 'computer', ignoring capitalization. oooor! making else lowercase, first character. example code: set<string> words= this.getconfig().getconfigurationsection("test").getkeys(false); if( allgroups.contains('computer') ) { please ignore this.getconfig().getconfigurationsection("test").getkeys(false);. looking reply prepare minecraft plugin i'm making, seems more basic java knowledge question. thank help guys you perchance utilize treeset because sorts input can take comparator. using implement behaviour want. like comparator<string> comparator = new comparator<string>() { ...

string - Is there a an array equivalent to vlookup in vba? -

string - Is there a an array equivalent to vlookup in vba? - my vba code bunch of big ranges uses worksheetfunction.vlookup find needed values. ranges can upwards of 25,000 cells, however, takes forever. there equivalent function arrays? i've seen lots of answers seem address returning true/false in there exact string match. need string's location. how ... function myvlook(arg range, target range, colidx integer) range dim idx integer if arg = "" set myvlook = [paramnothing] else idx = 1 target.rows.count if target(idx, 1) = arg if colidx < 0 set myvlook = target(idx, 1).offset(0, colidx) else set myvlook = target(idx, colidx) end if exit end if next idx end if end function [paramnothing] single cell range in worksheet containing application-specific text; otherwise works normal ...

java - Zero KeyFrame animation generated by factory, works on direct instantiation -

java - Zero KeyFrame animation generated by factory, works on direct instantiation - class define , contain libgdx animation: public class screenobject { protected int width; protected int height; protected float statetime; protected string spritesheetfile; protected int spritesheetcols; protected int spritesheetrows; protected float frameduration; protected texture spritesheet; protected textureregion[] frames; protected animation animation; public void makeanimation() { spritesheet = new texture(spritesheetfile); textureregion[][] temp = textureregion.split(spritesheet, width, height); frames = new textureregion[spritesheetrows * spritesheetcols]; int index = 0; ( int = 0; < spritesheetrows; i++ ) { ( int j = 0; j < spritesheetcols; j++ ) { frames[index++] = temp[i][j]; } } animation = new animation(frameduration, frames); ...

javascript - Angularjs ui utils highlight filter breaks application on search -

javascript - Angularjs ui utils highlight filter breaks application on search - i using angular ui-utils highlight filter , have next code: <span data-ng-bind-html="organization.level1name | highlight:vm.search"></span> when search using special character [ or (, angular exception , application breaks. syntaxerror: invalid regular expression: /(/: unterminated grouping @ new regexp (native) @ v. (http://localhost:50463/eia/source/dist/vendor.min.js:72:1157) @ (http://localhost:50463/eia/source/dist/vendor.min.js:38:92754) @ cr.| (http://localhost:50463/eia/source/dist/vendor.min.js:38:86832) @ h.constant (http://localhost:50463/eia/source/dist/vendor.min.js:38:92126) @ object.e (http://localhost:50463/eia/source/dist/vendor.min.js:38:101832) @ v.$digest (http://localhost:50463/eia/source/dist/vendor.min.js:38:57280) @ v.$apply (http://localhost:50463/eia/source/dist/vendor.min.js:38:58986) @ ...

JavaFX How to get all values of one column from TableView? -

JavaFX How to get all values of one column from TableView? - i info of 1 column tableview after button click. i found code tableposition pos = table.getselectionmodel().getselectedcells().get(0); int row = pos.getrow(); // item here table view type: item item = table.getitems().get(row); tablecolumn col = pos.gettablecolumn(); // gives value in selected cell: string info = (string) col.getcellobservablevalue(item).getvalue(); but code selected cell , have button , cells of 1 column. can help me pls? thankyou. just same thing elements of table.getitems() : tablecolumn<mydatatype, string> column = ... ; // column want list<string> columndata = new arraylist<>(); (mydatatype item : table.getitems()) { columndata.add(col.getcellobservablevalue(item).getvalue()); } where mydatatype info type of tableview . javafx

c# - How to validate an XPS document? -

c# - How to validate an XPS document? - is there c# api validate generated xps document? (i.e. create sure file valid xps file) don't know api, there microsoft tool tests file's conformity xml paper specification: http://msdn.microsoft.com/en-us/library/aa348104.aspx cheers! c# .net xps

c++ - Segmentation fault using FastDelegate -

c++ - Segmentation fault using FastDelegate - i've got problem test code. compiles well, when seek phone call delegate, programme crashes. #include "..\libs\fastdelegate\fastdelegate.h" #include <string> #include <map> #include <iostream> typedef fastdelegate::fastdelegate1 <int, int> funcptr; struct function { funcptr ptr; int param; function() {}; function (funcptr ptr_, int param_): ptr (ptr_), param (param_) {}; int operator() (int xxx) {return ptr(xxx);}; }; std::map <std::string, function> externalfuncs; bool registerfunction (const std::string& a, const function b) { externalfuncs[a] = b; homecoming true; } int foo (int bar) { std::cout << "jest gites"; homecoming 0; } int main() { registerfunction ("foo", function(&foo, 1)); externalfuncs ["foo"] (5); } callstack: #0 00000000 0x00000000 in ??() (??:??) #1 0041f209 fastdelegate::fastdelegate1<int, int...

html - Inconsistent x,y coordinates with -

html - Inconsistent x,y coordinates with <input type="image"> - i've seen varying behavior between browsers when clicking input tag image type. on browsers, returns x,y pixel offset of image in question. on chrome returns negative value y , seemingly nonsensical x values. is chrome bug, or there rhyme or reason behavior? edit: occurs in mechanical turk hit, rewrites html don't think plenty business relationship behavior. html google-chrome html-form imagemap

sql - Pulling Data with Column Names from a Different Table -

sql - Pulling Data with Column Names from a Different Table - i'm pulling info table ambiguous column names (table 1). there's table has dictionary of ambiguous column names mean (table 2). there plenty columns in info set don't want type out 'select a_name, b b_name...'. info table 1 rename columns according table 2. example table 1: id a1 a2 a3 b1 b2 b3 1 foo1 foo2 foo3 1 1 0 2 bar1 bar2 bar3 2 3 4 ... example table 2: column_ref col_definition a1 apples a2 aardvarks a3 androids b1 bears b2 beers b3 boats example output: id apples aardvarks androids bears beers boats 1 foo1 foo2 foo3 1 1 0 2 bar1 bar2 bar3 2 3 4 ... this question comes close: retrieve column names different table? except have type/copy 200 times every column. is there way can bring to...

javascript - Multiselect refresh callback function -

javascript - Multiselect refresh callback function - i utilize multiselect jquery plugin dropdowns. have requirement in refresh dropdown setting value true. takes while refresh. not issue considering content in dropdown. want know if there way know if refresh done or not, callback after refresh. javascript jquery jquery-multiselect

asp.net - Using Identity 2.0 with Oracle database -

asp.net - Using Identity 2.0 with Oracle database - ok, mention of not experience in either asp.net or oracle db, gradually learning. need utilize identity 2 oracle database in creating asp.net mvc web app. not have db not mater if utilize code first or db first. problem can not find article or tutorial explains how can accomplish this. so, if had experience , if so, guidance(or @ to the lowest degree link resources seam not find), @ all, much appreciated. asp.net oracle data-access-layer odp.net asp.net-identity-2

How instanceof is implemented in JavaScript -

How instanceof is implemented in JavaScript - this question has reply here: how instanceof work in javascript? 2 answers lets consider next code snippet: function a() {} var obj = new a(); function b() {}; obj.constructor = b; console.info("1: ", obj.constructor); //function b console.info("2: ", obj instanceof a); //true console.info("3: ", obj instanceof b); //false my guess decide if , object instance of function class or not, js engine must checking if object has same constructor property or not. not seem happening so, overriding constructor property of object not alter it's instanceof output. this link states: the instanceof operator tests presence of constructor.prototype in object's prototype chain. javascript

selenium webdriver - TestNG tests are not getting run when I execute testng.xml using POM file using maven-surefire -

selenium webdriver - TestNG tests are not getting run when I execute testng.xml using POM file using maven-surefire - 0 tests getting run, when execute testng.xml using pom file using maven-surefire. i running few selenium tests using testng.xml. when run testng.xml file testng test suite, runs fine. but, when include testng.xml file (as below) not running : <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.14.1</version> <configuration> <suitexmlfiles> <suitexmlfile>testng.xml</suitexmlfile> </suitexmlfiles> </configuration> </plugin> below pom file snippet: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd...

scala - Transform and flatten List of disjunctions -

scala - Transform and flatten List of disjunctions - case class errs(errors: list[err]) case class err(exceptionmessage: string, custommessage: string, statuscode: int, extrainfo: option[string] = none) one of functions returning val result = list[\/[errs, boolean]] in order transform/sequence , flatten result next passes done val finalres: \/[errs, boolean] = result.map(_.swap).sequenceu.map(x => errs(x.map(_.errors).flatten)).swap this looks inelegant , performance intensive (given number of passes has via multiple map calls etc) is there combinator in scalaz can create more elegant less number of passes or demands writing custom function? firstly, utilize traverseu , suggested travis brown. after that, phone call map followed phone call flatten can written flatmap . val finalres: \/[errs, boolean] = result.traverseu(_.swap).map(x => errs(x.flatmap(_.errors))).swap moreover, may consider using type alias errs . type errs = list[err]...

windows - I can't download the mongoose.exe -

windows - I can't download the mongoose.exe - the story so, wanted see little web server like, , discovered mongoose, nice, small, simple web server static sites. horrors arose when tried downloading it. tried grabbing site: http://cesanta.com/mongoose.shtml, , found chrome complained network error. had friend seek downloading it, thinking bad link, downloaded fine. thought, okay whatever, i'll have him transfer flash drive , can off there. discovered can't file off flash drive. windows file re-create dialogue hung on 75%, , jump 100% , file flicker in folder, , disappear. so, okay, maybe don't need on computer, , i'll jut run off flash drive, ran it, , windows complained saying file didn't exist, , file on flash drive disappeared. the questions why file hate me? is there wrong file system? is issue executable itself? the details my friend , both running windows 8.1 can download other files fine. try download real link windows file do...

c# - asp.net identity SetEmailConfirmedAsync -

c# - asp.net identity SetEmailConfirmedAsync - i'm having issues setemailconfirmedasync method within userstore class. everything working fine, users beingness created hashed password, tokens beingness generated confirmation email, email sending successfully. problem comes when seek verify email public async task<actionresult> confirmemail(guid userid, string token) { task<microsoft.aspnet.identity.identityresult> result = usermanager.confirmemailasync(userid, token); if (result.result.succeeded) { } else { } homecoming view(); } this calls public task setemailconfirmedasync(user user, bool confirmed) { accountservice.verifiyaccount(user.id, confirmed); homecoming task.fromresult(0); } which sets business relationship verified i'd expect. however, next thing happens findbynameasync called followed updateasync method overwirtes changes applied within setemailconfirme...

java - Why is this code keep being "terminated"? -

java - Why is this code keep being "terminated"? - i have code in eclipse: package test; import java.util.scanner; class test{ public static void main(string args[]){ scanner input = new scanner(system.in); if (input.equals("payday2")){ system.out.println(input); } } } now when seek start code/aplication, terminates itself. any ideas why happens? you instantiate scanner variable named input never seek read. your condition if (input.equals("payday2")){ will check if scanner object equals string "payday2" false, hence programme terminate. if want read, need input.nextline() . i dont know eclipse, netbeans give warning "equals on incompatible type" line. also, should not name variable capital letter convention, class name should start capital. so fixed programme be scanner input = new scanner(system.in); string value = input.nextline(); if (...

c++ - std::locale/std::facet Critical section -

c++ - std::locale/std::facet Critical section - out of curiosity. in past i've seen performance degradation in function boost::to_lower because of criticalsection employed in std::use_facet when lazy facet allocated. far remember there bug global lock on locale according stephan lavavej fixed in vs2013. , voila, saw lock on facet killing server performance yesterday guess i'm confusing 2 different issues. in first place, why there criticalsection around lazy facet? ruin performance. why didnt resolve kind of upgradable lock or atomic operations on pointers? c++ multithreading visual-c++ locale

ruby on rails - Form object pattern with validation using read_attribute -

ruby on rails - Form object pattern with validation using read_attribute - i using form object pattern https://robots.thoughtbot.com/activemodel-form-objects deal validations in house model. i have validation needs utilize read_attribute , because want check length of field not longer 20 db encoding. so, if validation in house model, this: if read_attribute(name).length > 20 # add together error end however since in houseform class context. can't that. what right approach in case? ruby-on-rails validation

algorithm - Bradley Adaptive Thresholding -- Confused (questions) -

algorithm - Bradley Adaptive Thresholding -- Confused (questions) - i have questions, stupid, implementation of adaptive thresholding bradley. have read paper http://people.scs.carleton.ca:8008/~roth/iit-publications-iti/docs/gerh-50002.pdf , bit confused. statement: if ((in[i,j]*count) ≤ (sum*(100−t)/100)) let's assume have input: width, [0] [1] [2] +---+---+---+ height [0] | 1 | 2 | 2 | j +---+---+---+ [1] | 3 | 4 | 3 | +---+---+---+ [2] | 5 | 3 | 2 | +---+---+---+ and let's that: s = 2 s/2 = 1 t = 15 = 1 j = 1 (we @ center pixel) so means have window 3x3, right? then: x1 = 0, x2 = 2, y1 = 0, y2 = 2 what count then? if number of pixels in window, why 2*2=4, instead of 3*3=9 according algorithm? further, why original value of pixel multiplied count? the paper says value compared average value of surrounding pixels, why isn't in[i,j] <= (sum/count) * ((100 - ...