Posts

C - able to read an EVP encrypted file but when I store it in a char array, everything disappears -

i have evp encrypted file want send on socket. however, realised nothing being sent because seems nothing stored in array read file into, sure there stored since able decrypt after reading file. the code snippet below part boggling me. file *fp; long lsize; fp = fopen ( evp_file , "rb" ); fseek(fp, 0l, seek_end); int fsize = ftell(fp); fseek(fp, 0l, seek_set); unsigned char *indata = malloc(fsize); fread(indata,sizeof(char),fsize, fp); printf("%s\n", indata); // printing indata returns me nothing @ //then decryption //decrypting indata works! , want. as commented, no output when print indata. there doing wrong here? need store in array can send on socket. ps. when use plain text file, works fine. thanks in advance!! if it's text data ( ascii characters, perhaps utf-8, not binary ) need nul terminate buffer, add 1 byte malloc() ed size , then indata[fsize] = '\0'; ...

lftp not able to resolve alias value defined in .lftprc file -

i have defined aliases in config file .lftprc below- alias ftp_server_x 99.999.999.999 from command prompt when run lftp -e "open -u user,password 99.999.999.999" it connects server. but when try use alias name in command lftp -e "open -u user,password ftp_server_x" i error 'open: ftp_server_x: name or service not known' need in resolving error. lftp aliases commands, not host names. try bookmarks instead: bookmark add ftp_server_x 99.99.99.99

Draw Line chart in jQuery using data from an AJAX request -

Image
i trying generate line chart in jquery. here ajax request code: var querystring = window.location.search; $.ajax({ url: '/turnover/drawlinechart'+ querystring, cache: false, type: 'post', datatype: 'json', success: function (response) { ????????? }, } }); here data in response: how can draw line chart using data? here x-axis data static (jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec). in response have y-axis data. please me. thank you.

Changing INSTALLDIR from registry (working with InstallShield) -

i'm working installshield , creating installation addon. must read registry program x has been installed , add necessary files found location. problem : on 32bit computer registry found under hkeylm\software\x. on 64bit computer registry found under hkeylm\software\wow6432node\x. so how can read registry correct registry value , set found value installdir? firstly find if target machine 64 or 32 bit machine.you can use sysinfo.biswow64 similar commands. once found run reg commands thru if loop , achieve goal.

excel - Angle of rotation for a data label along a line on a chart -

i have chart plots flow vs power. want adjust rotation of data label sits on top of line on chart match slope of line. first point plotted @ 25000, 87000; second point plotted @ 53000, 182000. if manually count gridlines , tangent(theta) = opposite / adj answer makes sense ~22º if use actual data graph angle wrong. eyeballing graph, looks 22º using plot data gives me 73º. it seems confusing opposite , adj. 73º right answer these data. you have 2 points p1 = (x1, y1) , p2 = (x2, y2) . segment p1p2 has slope angle (in radians) a = atan2(y2 - y1, x2 - x1) (i don't know exactly, whether atan2 or arctan2 function exists in vba math library - a discussion found)

algorithm - How to effectively distribute points on plane -

i have plane (screen) width , height (monitor resolution, not square). , i'd distribute points on plane (approximately) same distance each other. for example: 1 point in middle, 2 points in middle of y axis, , x axis divided 3 3 points may triangle, if sceen wide enough, thay can alighned in same y 4 second part of above, or rectangle.. etc 8 points max is there algorithm this? thank time! edit: same distance each other , plane border edit2: compute centers of mass groups of objects on behavior simulate on plane. depending on precision want: you can stochasticaly correct answer poisson disk sampling. specifically, poisson disk sampling random sampling such no points closer specified radius. such thing can efficiently (linear time) implemented in high dimension - e.g. : c++ code robert bridson : http://www.cs.ubc.ca/~rbridson/download/curlnoise.tar.gz implementing paper http://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf you ...

c# - how to read data from the ViewModel -

i unit_price , quantity actionresult index. any appreciated model product public class product { public product() { productsdetails = new hashset<productdetails>;(); } [key]//[required] public int id_product { get; set; } [required] public int id_subcategory { get; set; } [required] public int id_category { get; set; } // [stringlength(50)] public string product_name { get; set; } //public byte photo_products { get; set; } // id_subcategory //public virtual productdetails productdetails { get; set; } [foreignkey("id_subcategory")] public subcategory subcategories { get; set; } [foreignkey("id_category")] public virtual category categories { get; set; } public virtual icollection<productdetails> productsdetails { get; set; } public virtual icollection<orderdetails> ordersdetails { get; set; } } model productdetails [table("product_details...