Posts

server - Suggestions to store an integer in an android app -

i new android programming, need store integer on server, app can consult , update value of int. listen useful suggestions of more experienced android developers whether if need server or there simpler solution. thanks! for purpose want store int on server . if want store int within phone , have different techniques that

mysql - Getting data from POST [id] form in PHP -

on table displays data database, have form has text area on user can type receipt number , submit save in database specif row. php code below updates database after form submitted. want pick rest of details specific row used $_post['id'] on receipt has been submitted. id primary key. i'm having challenge since can't fetch data database using $id = $_post['id']; i created before outside function update statement works select statement doesn't . how go it? one? if(isset($_post['submit'])) { $rec = $_post['receipt']; $id = $_post['id']; //reate connection $sql = "update customer set `receipt` = '".$_post['receipt']."', `date_entered` = now(), `receipt_lock` = 1 `id` = '".$_post['tid']."' , receipt_lock = 0"; if ($conn->query($sql) === true) { // echo "new record created successfully"; } else { echo "error: " . $sql . "...

c# - Allow user to modify method from outside assembly? -

basically, i'm trying write library people entity management games in c# , wondering if there's way user add functionality (similar override except won't inheriting class) method without directly changing .dll? know in c++ people use callbacks , wondering if there's similar in c#? one option (instead of modifying method ) use mef framework allow users extend application. the managed extensibility framework or mef library creating lightweight, extensible applications. allows application developers discover , use extensions no configuration required. lets extension developers encapsulate code , avoid fragile hard dependencies. mef not allows extensions reused within applications, across applications well.

Fortran calling C: How do I get an efficient vectorised function -

i have call c function fortran, want in vectorised loop. working intel 16.0.3 compilers on linux. so options are: can try , function inline or can use simd function (i want use openmp simd this, want portable , use openmp). if call fortran fortran works both ways. passing arguments use linear/ref clause pass reference vector of values rather vector of references , seems work efficiently. in c linear/ref clause not recognised. i can function nominally vectorise inserting gathers , scatters , performance no better scalar (at least small test function). if put linear(ref(r,s)) in fortran interface block message the uval or ref modifiers must not used on dummy argument value attribute. i can performance using trick of passing value fortran , returning value function return. produces vectorised function, , performance good, unfortunately real function needs return more 1 value. if try inline c function, won't work. opt-report tells me callsite cannot inlined. tr...

c++ - How to begin writing a smart pointer? -

i've received task in university, write smart pointer. received skeleton, , need implement needed methods. if i'm right, smart pointer type of pointer counts reference numbers given object (?) and, if counter reaches zero, deletes given object. this skeleton: template<class t> class my_pointer { public: my_pointer(); }; class refcounted { /* reference counted types should have public interface defined here */ public: int increfcnt(); int decrefcnt(); }; int main() { my_pointer<refcounted> obj1 = new refcounted(); my_pointer<refcounted> obj2 = obj1; return 0; } firstly, should line do? refcounted not child of my_pointer, how can possibly instantiate new refcounted object , reference my_pointer object (pointer?)? my_pointer<refcounted> obj1 = new refcounted(); why isn't there counter in my_pointer class, , why counter in refcounted class? how should start this? i'm not in c++. in advance! ...

php - Cannot access to my Propel's classes -

i have problem accessing propel's classes. example, try access livre class. my code in index.php : use biblio\biblio\livre; //load propel's autoload require 'vendor/autoload.php'; $collect = new livre(); $collect->setnom("aventure"); $collect->save(); and output error : fatal error: class 'biblio\biblio\livre' not found in /applications/mamp/htdocs/propel/index.php on line 7 my classe livre in folder biblio/biblio/livre.php code, eclipse finds livre . when php executes, there error. somebody have solution ? you're going need add composer.json file (obviously modifying autoload data entire json file, rather appending as-is): { ... "autoload": { "classmap": ["biblio/"] } } without this, require vendor/autoload.php; won't include propel classes , php won't able find namespace/class. don't forget run php composer dump-autoload command line update autoload...

Run .bat file - Maven/Eclipse -

i want run batch file using maven. my pom.xml looks this: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <artifactid>test--clients</artifactid> <packaging>war</packaging> <name>test--clients</name> <parent> <artifactid>test--app</artifactid> <groupid>de.timetoact.test-</groupid> <version>10.0.0</version> </parent> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <version>2.4</version> <configurati...