Posts

How to pass a struct from C++ to C? -

updated: main.h typedef struct { float x; float y; float z; }vec3; const int sizeofgrid = 20000; vec3 *grid[sizeofgrid];//assume initialized main.cpp #include "main.h" extern "c" void cudatranslate(vec3 *x); void display() { cudatranslate(grid); } linecuda.cu #include <stdio.h> #include <assert.h> #include <cuda.h> #include "main.h" extern "c" void cudatranslate(vec3 *x) { } getting: main.obj : error lnk2005: "struct vec3 * * grid" (?grid@@3papauvec3@@a) defined in linecuda.obj fatal error lnk1169: 1 or more multiply defined symbols found move grid main.cpp. pass linecuda.cu. problem solved. updated: main.h typedef struct { float x; float y; float z; }vec3; const int sizeofgrid = 20000; main.cpp #include "main.h" vec3 *grid[sizeofgrid];//assume initialized extern "c" void cudatranslate(vec3 *x); void display() { cudatranslate(grid)...

.net - regasm just doesn't work -

for every example of registering .net com objects in web, see tool "regasm" doing job. so!!! never worked me! tired of trying overcome it! solution regsvr32, requires function define in c++. please tell me why wouldn't work!!! considering doesn't work on 4 of computers, plus 3 virtual machines, running windows 7 down 2000, can show me working example of regasm call? think idiot. registering [comvisible] .net assemblies regsvr32.exe not possible. doesn't have required dllregisterserver entrypoint regsvr32 needs. have make work regasm.exe or setup project. latter necessary when deploy server machine. there few failure modes. other than: forgetting use /codebase option. required if don't deploy assembly gac, should not on dev machine. using wrong version of regasm.exe. there 2 on 64-bit machine, framework64 directory contains 1 have use if client code 64-bit. running command prompt not elevated. regasm.exe writes hklm hive of regis...

Mysql count and sum from two different tables -

i have problem querys in php , mysql: have 2 different tables 1 field in common: table 1 id | hits | num_g | cats | usr_id |active 1 | 10 | 11 | 1 | 53 | 1 2 | 13 | 16 | 3 | 53 | 1 1 | 10 | 22 | 1 | 22 | 1 1 | 10 | 21 | 3 | 22 | 1 1 | 2 | 6 | 2 | 11 | 1 1 | 11 | 1 | 1 | 11 | 1 table 2 id | usr_id | points 1 | 53 | 300 now use statement sum total table 1 every id count + 1 too select usr_id, count( id ) + sum( num_g + hits ) tot_h table1 usr_id!='0' group usr_id asc limit 0 , 15 and total each usr_id usr_id| tot_h | 53 | 50 22 | 63 11 | 20 until here ok, have second table points (table2) try this: select usr_id, count( id ) + sum( num_g + hits ) + (select points table2 usr_id != '0' ) tot_h table1 usr_id != '0' group usr_id asc limit 0 , 15 but seems sum 300 points users: usr_id| tot_h | 53 | 350 22 | 363 11 ...

php - margins in TCPDF when using writeHTML() -

i trying create pdf using tcpdf library. have problem table written method writehtml() though. when table has many rows, rest of moved next page. proper behavior, need to have top margin on new page. tcpdf making default margin, small in case. ive tried use setmargins(), setxy() nothing seems work. looks general margins of pdf has no influcence on content created writehtml(). had similar problem? tcpdf::setmargins($left,$top,$right = -1,$keepmargins = false) and describes parameters as: parameters: $left (float) left margin. $top (float) top margin. $right (float) right margin. default value left one. $keepmargins (boolean) if true overwrites default page margins so, right margin -1 used indicate no right margin supplied , use same left margin. using -50 not valid margin. try instead: $pdf->setmargins(10, 10, 10, true);

JQuery issue - http://jqueryui.com/latest/themes/base/ui.all.css not working -

i have never used j query....was wondering link .. http://jqueryui.com/latest/themes/base/ui.all.css link to? 1 of websites have taken on has stopped working. when take source out @ top of page works, when put in stops working again? for have taken out, assume jquery server has gone down or something. source , ok leave out? thanks jquery disabled hotlinking files hosted on server. shouldn't linking directly that. instead use cdns offered google or microsoft. use link css : http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/base/jquery-ui.css and others available http://code.google.com/apis/libraries/devguide.html#jqueryui this question has answers on how other themes downloading jquery ui css google's cdn

javascript - How to parse Craigslist content through RSS -

craigslist don't provide apis data access. i write small client parse data rss , reflow it. i without setting server. client side tools/javascript available out there can allows quick , easy parsing of rss feeds? you may want check out using javascript display rss links js clients. also yahoo pipes has interesting ways interact rss feeds

maven - How to implement a roundtrip from XML Schema using Java with a Database -

what best way of implementing roundtrip receiving xml files , persisting data database using java. have: 1. xml schema & xml data files send me - xsd complex , belongs external party, can not change it 2. created java classes - jaxb generates on 150 classes, unfortunately schema can change - have used maven pom automate process 3. unmarshall xml data files java objects (with jaxb annotation) - data displayed user manipulated 4. persist java objects rdbms (oracle / mysql) - seems jdo suitable solution 5. exporting data - data can exported again xml or excel (for example) i can not find suitable way add jdo metadata or annotations java source code (generated during jaxb process) ensure can persist java classes. working following technologies: - java, maven, jaxb, jdo & jdbc i think datanucleus suited might have change datastores (rdbms / xml / excel) between environments different export destinations. other 2 technologies might need consider is: - spring , ...