Posts

Rapleaf for companies - API to get corporate info? -

is there api or tool getting company information, such as: location revenue number of employees location(s) and conversely, given constraints on above parameters, return matching businesses? for publicly traded companies, can lot of information http://www.mergent.com/servius for companies, use http://compass.webservius.com - can work in both modes (given business return location/sales/number of employees/etc, , given these parameters can return list of businesses)

php - Convert HTML page to an image -

i want change html page image. there way in php change or save html page image? this not easy; nulluserexception says in comment, need render html page on server-side, not php (or other server-sided language) has built in. the approach comes mind write program (probably not in php, rather c# or c++) runs on server, fires web browser, , series of screen captures (possibly combined page scrolls). nontrivial , bug-prone process, suggest looking third-party components capable of doing this. you execute program php, , when it's done running, display results file output.

opengl - Mipmaps+PBO: strange issues -

i'm using pbos load textures faster in application. if use opengl 3 or better video card can build mipmaps call glgeneratemipmap , works fine. on older opengl 2.1 card (radeon x800), function not available must use 1 of 2 legacy methods: gltexparameteri(gl_texture_2d, gl_generate_mipmap, gl_true); glteximage2d(gl_texture_2d, 0, gl_rgba8, w,h, 0,gl_rgba,gl_unsigned_byte, src); or glubuild2dmipmaps(gl_texture_2d, gl_rgba8, w,h, gl_rgba,gl_unsigned_byte, src); the first method doesn't work fine whitout pbo, introduces strange artifacts. second one, whitout pbo builds correct mipmaps, , pbo generates segfault. can help?? for completeness attach code use pbo: uint pixelbuffer; glgenbuffers(1, &pixelbuffer); glbindbuffer(gl_pixel_unpack_buffer, pixelbuffer); glbufferdata(gl_pixel_unpack_buffer, size*4, null, gl_static_read); char *pixels = (char*)glmapbuffer(gl_pixel_unpack_buffer, gl_write_only); ... transfer data glunmapbuffer(gl_pixel_unpack_buffer); ... , use...

Serializing dictionary in Django to use with Dajaxice or ajax -

i'm trying write monitor site temperature devices gets updated every x seconds. far have function returns dictionary using dajaxice. ajax.py: def temperature(request): temperature_dict = {} filter_device in temperaturedevices.objects.all(): get_objects = temperaturedata.objects.filter(device=filter_device) current_object = get_objects.latest('date') current_data = current_object.data temperature_dict[filter_device] = current_data table = str(temperature_dict) return simplejson.dumps({'table':table}) and callback: function my_callback(data){ if(data!=dajaxice.exception){ document.getelementbyid('test').innerhtml = data.table; } else{ alert('error'); } } dajaxice.toolbox.monitor.temperature('my_callback'); originally, html looks this: <div id="test"> <tr> {% label, value in table %} <td>{{ label }} </td> <td>{{ value ...

c - Given a char* with the prototype, can we cast a void* to a function pointer? and run it? -

i've declared many functions in 1 driver, , passing pointers functions driver in list node format: struct node { char def_prototype[256]; //example:(int (*)(wchar, int, int)) void *def_function; }; is there way typecast def_function prototype given in def_prototype ? currently i'm using simple switch , strcmp, wanted generalize if possible. ps: know casting between void pointer , function pointer unsafe (as mentioned in various places in so), desperate times call desperate measures , have taken lot of care. edit: sorry lack in clarity. want call function (not cast it), making function pointer @ runtime based on char[] provided. edit again: since i'm working @ kernel level ( windows driver ), don't have access resources, so, i'm sticking current implementation (with changes kill back-doors). help. a implementation of similar ideas libffi . implements gory details of declaring , calling functions arbitrary calling conventions , signatures...

java - How to show collection elements as items in selectManyListbox? -

i have bean: public projectserviceimpl { public list<project> getallprojects () { ... } } i want list these projects items in <h:selectmanylistbox> . when user selects 1 or more items , press submit button, selected items should converted projects. i'm confused little how list items , how correspondent converter should like? you need implement converter#getasstring() desired java object been represented in unique string representation can used http request parameter. using database technical id (the primary key) very useful here. public string getasstring(facescontext context, uicomponent component, object value) { // convert project object unique string representation. return string.valueof(((project) value).getid()); } then need implement converter#getasobject() http request parameter (which per definition string ) can converted desired java object ( project in case)`. public object getasobject(facescontext context, uicompo...

html - How to know the height the space left on a browser by the menus, bookmarks and tabs? -

i want make page (html + css) fits space left on browser without horizontal , vertical scrollbars. now readind question on web browser and, probably, can see horizontal scrollbar. want use space without using horizontal , vertical scrollbars. i think looking window.innerwidth , window.innerheight , friends. check out this great table on quirksmode.org overview on variables supported browser. edit: pure css in css have width: 100% , height: 100% . if work scenario, use them. avoid scroll bars, can use overflow: hidden on body, careful because prevents scrolling completely. depends on want do.