Posts

java - glDrawBuffers should have flipped IntBuffer? -

i have following code: intbuffer drawbuffers = utils.createintbuffer(2); int bfs[] = {gl30.gl_color_attachment0, gl30.gl_color_attachment1}; for(int = 0; < 2; i++) drawbuffers.put(bfs[i]); drawbuffers.flip(); gl20.gldrawbuffers(drawbuffers); if flip intbuffer int status = gl30.glcheckframebufferstatus(gl30.gl_framebuffer); don't equal gl_framebuffer_complete , if don't flip status right, black texture instead of desired texture, looked throught code on , on 2 days now, best bet part of code somehow wrong, rest seems ok. should intbuffer flipped before using in gldrawbuffers(intbuffer) ? yes, buffers should flipped before being passed lwjgl. the underlying gl api expects array functions take java buffer. size of array parameter in gl's c language bindings, hidden in java because lwjgl calculates difference between current position , end position. unless flip java.nio.buffer , sets "current" position beginning of buffer,...

dynamic - Refer to an excel named range on another sheet using indirect -

let's have 3 sheets (let's sheet1 , sheet2 , sheet3 ). sheet1 , sheet2 contain each sheet-level range named myrange . in sheet3 , if want access myrange sheet1 , able use ='sheet1'!myrange . but now, want sheet3 contain generic code , able refer either sheet1 or sheet2 . expect able achieve same thing using =indirect("'" & mysheetname & "'!myrange") however, error #ref when that. what do wrong ? how can work around ? if myrange consists of multi-row, multi-column range, make sure pressed ctrl-shift-enter when entered =indirect("'" & mysheetname & "'!myrange") . if forget use ctrl-shift-enter , #value error. however, stated have #ref . using code single-cell range, result looking for. way can #ref error using wrong sheet name. suspect problem. check sheet name , repost more detail if still doesn't work.

mysql - SQL foreign key restraint referencing information_schema -

is possible "constrain" columns in 1 table "reference" columns views in information_schema in way (it needn't proper foreign key constraint, hence scare quotes)?-- need minimally-intrusive way of adding arbitrary metadata existing column data (e.g. add "comments" e.g. value shop.cheeses.name shop.cheeses.id = n ), , thought of defining table such: create table shop.metadata ( `table_schema` varchar(64) not null, `table_name` varchar(64) not null, `column_name` varchar(64) not null, `record_id` int(11) unsigned not null, `comments` text not null, /* show purpose of table */ primary key (`table_schema`, `table_name`, `column_name`, `record_id`), foreign key (`table_schema`, `table_name`, `column_name`) references information_schema.tables(`table_schema`, `table_name`, `column_name`) ); however, statement returns error 1215 (hy000): cannot add foreign key constraint , presumably because table_schema , table_name , co...

java - How to select an remembered item in the text box with Selenium webdriver? -

how select remembered item in text box selenium webdriver? hashmap<string, arraylist<integer>> map = new hashmap<string, arraylist<integer>>(); for(int i=0; i<strs.length; i++){ char[] arr = strs[i].tochararray(); arrays.sort(arr); string t = string.valueof(arr); if(map.get(t) == null){ arraylist<integer> l = new arraylist<integer>(); l.add(i); map.put(t, l); }else{ map.get(t).add(i); } please try below: webdriverwait wait = new webdriverwait(driver,30); driver.findelement(by.id("product_quickaddinput")).sendkeys(“00006692”); webelement element = driver.findelement(by.xpath("//div[@id='div_0']")); wait.until(expectedconditions.elementtobeclickable(element)); element.click();

twitter bootstrap - Boostrap CDN with 16-columns instead of 12 -

i want use latest bootstrap cdn, defaults 12 column layout. way customize 16 col layout download , host files yourself? edit: i'm asking how bootstrap through cdn. use bootstrap cdn https://cdnjs.com/ , works great, except 12-col layout. there 2 options this. you override bootstraps grid system own css file. <link rel="stylesheet" href="/cdn/path/to/bootstrap.css" /> <link rel="stylesheet" href="/my/path/overide_bootstrap.css" /> this can tedious task , not recommend doing way. customize bootstrap , use own version if go http://getbootstrap.com/customize/ can customize , download customized version of bootstrap. looking located @ http://getbootstrap.com/customize/#grid-system . once has been downloaded have few options: serve files own project. use free cdn service there multiple cdn services can use, such cloudflare ( https://www.cloudflare.com/features-cdn ) or can use cdnjs ( https://github....

How to use ILNumerics function csvread to load complex array from a csv file -

i want load csv format data file function csvread. data in complex format. example, looks "36.151-202.64i,236.74+2.1788i,26.234+201.94i, ...." when call csvread ilnumerics, can first column data. other data zeros. here simple 2 lines of code. var inputdatafile = file.readalltext(@"c:\temp\input.txt"); ilarray datcomplex = csvread(inputdatafile); please help. it popular request, , working on it. upcoming version support reading complex numbers , arbitrary formatted elements in csv files. stay tuned!

salesforce - Schedule a batch at certain hours -

i made schedulable batch want run @ hours, let's 6, 12 , 18. i'm writting hours in custom setting cs_schedule__c. how can call cs apex , hours? thanks in advance. here page outlining how retrieve custom settings in apex depending on if it's list or hierarchy custom settings. as far scheduling, can in apex if wish, so: classtoschedule schcls = new classtoschedule(); string sch = '20 30 8 10 2 ?'; string jobid = system.schedule('name of job', sch, schcls); the sch string cron expression represent time runs. check out cron expression builder more info. instead of using numbers build string data in custom setting.