Posts

vb.net - Using VB as automation, I want to tick the PowerPoint option box "Do not compress images in file" -

i'm adding feature program copies file surfer , pastes powerpoint slide. surfer image large, , need have small portion of surfer file visible in framing of powerpoint slide. the problem i'm having when open powerpoint, default have copied , pasted images compressed. whatever showing in powerpoint slide blurry because of compression. when without automation , turn off image compression, looks perfect. please note program not me, it's distributed others within company, can't expect other people want use program change default settings. want figure out how turn off compression. here's have far: 'opens surfer objsurferapp = createobject("surfer.application") 'open powerpoint objpptapp = createobject("powerpoint.application") objpptmapseries = objpptapp.presentations.add 'copies image surfer objsurfermap.shapes.selectall() objsurfermap.selection.copy() ...

c - Using cuda thrust::max_element to find max element in array returns incorrect sometimes -

i have 2^20 element array being filled on device; these numbers should same every time. move array on host , search max element in array, technique works 2^10 element array once begin larger begin random answers not sure if thrust messing or device calculations. the answer max_element should return 0.094479 first time program run code output correct answer answer randomly show every few times gpu tesla k20 running 5.0 tested on 780gtx; same issue both times //host code int main( void ) { float h_c[total]; float *d_c; cudamalloc((void**)&d_c, sizeof(float)*total); cudaevent_t start, stop; cudaeventcreate(&start); cudaeventcreate(&stop); cudaeventrecord(start); //number of threads kernel<<<blocks,threads>>>(d_c); cudaeventrecord(stop); cudaeventsynchronize(stop); float mil = 0; cudaeventelapsedtime(&mil, start, stop); cudamemcpy(h_c, d_c, sizeof(float)*total, cudamemcpydevicetohost); for(int y = 0; y < total; y++){ printf(...

java - Permutations of 4 integers in an array? -

i have write code takes input of 4 integers between 1 , 9 scanner object , combines them in way equal 24. although solution not elegant have managed compile number of if statements using variables, b, c, d , hoping store numbers entered user in array , swap values of a, b, c, d generate each possible combination of numbers for example 1 paring might (a+b*c) - d = 24. i'd want switch values of a, b, c, d possible combinations , life of me can't figure out how this. have public static void dagame(int a, int b, int c, int d) { int[] basearray = {a, b, c, d}; int [] keyarray = basearray.clone(); if(a > 9 || b > 9 || c > 9 || d > 9 || == 0 || b == 0 || c == 0 || d == 0){ system.out.println("you entered number greater 9 or enterered 0:"); main(null); system.exit(0); } for(int = 0; < 2; i++){ for(int j = 0; j < basearray.length; j++){ if(i == 1){ basearray = keyarray.clon...

python - How to stream CSV from Flask via sqlalchemy query? -

i'd stream csv flask using technique they describe here : from flask import response @app.route('/large.csv') def generate_large_csv(): def generate(): row in iter_all_rows(): yield ','.join(row) + '\n' return response(generate(), mimetype='text/csv') i have query sqlalchemy returns list of purchase objects. i'd write csv, ideally customization on attributes output file. unfortunately, i'm getting blank csv output currently: @app.route('/sales_export.csv') @login_required def sales_export(): """ export csv of sales data """ def generate(): count = 0 fieldnames = [ 'uuid', 'recipient_name', 'recipient_email', 'shipping_street_address_1', 'shipping_street_address_2', 'shipping_city', 'shipping_state', ...

visual studio - Expanding media capabilities of Win Embedded CE 6.0 -

i have embedded device wince 6.0 os. manufacturer provides ide 3rd party development it. ide pretty allows nothing else than .net 3.5 compact framework scripting that's invoked various events main application adding files device. the included mediaplayer seems using directshow , os has media codec mpeg-1 encoded video playback. my goal to able play media encoded other codecs well inside main application. i've managed use directshownetcf (directshow wrapper .net compact framework) , playback mpeg-1 encoded video. i'm totally new stuff , have tons of (stupid) questions. i'll try narrow them down: the os based on wince, far i've understood, it's customized version of (via platform builder). "correct way" of developing afterwards use sdk manufacturer provides. right? in case, sdk extremely limited , tightly integrated ide noted above. however, .net cf 3.5 capable interop possible call native libraries -as long compiled correct platform. ...

c# - Convert Image to Bytes and save in Xml -

i need convert byte [] of image format can saved in xml. tried convert string not worked. xml file after 5 images saved size of 50mb! need convert simpler format xml file can not heavy. consider using base64 format - lose efficiency data encapsulated. example <image name="myphoto.jpg">wfuiglzigrpc3rpbmd1axnozwqsig5vdcbvbm</image> you can convert base64 using convert.tobase64

c# - Why should I use glTranslate? -

what's purpose of pushing/popping matrix translate shape when can sort of position math myself? can understand using said aforementioned matrices more difficult operations (rotation example), why translating specifically? public void render() { positionx++; gl.pushmatrix(); gl.translate(positionx, positiony, 0); gl.matrixmode(matrixmode.modelview); gl.loadidentity(); gl.begin(primitivetype.quads); gl.vertex2(0, 0); gl.vertex2(0 + widthx, 0); gl.vertex2(0 + widthx, 0 + widthy); gl.vertex2(0, 0 + widthy); gl.popmatrix(); gl.end(); } versus public void render() { positionx++; gl.matrixmode(matrixmode.modelview); gl.loadidentity(); gl.begin(primitivetype.quads); gl.vertex2(positionx, positiony); gl.vertex2(positionx + widthx, positi...