Posts

Showing posts from June, 2010

replace - How to use the new image replacement technique by Scott Kellum -

i practicing using various image replacement methods , came across couple articles discussing new, supposedly more efficient method scott kellum. original website article regarding new method it seems , practice using it, not sure html , css should be. in example below, have h1, example logo text inside. added class of .hide-text h1 , styled css. used photoshop logo image made , set background image....the image has width of 203px , height of 57px. question 1: when tested code in browser, seems working fine, usage of mr.kellum's image replacement technique correct? question 2: should target h1 in css , declare width , height or okay include width , height directly in hide-text class in example below? <style> .hide-text { background: url(images/mylogo.jpg) 0 0 no-repeat; text-indent: 100%; white-space: nowrap; overflow: hidden; width: 203; height: 57px; } <body> <h1 class="hide-text">mylogo text</h1>

java - Axis - Response class extends AxisFault and is thrown instead of returned? -

i have generated java class files using axis1 (axis-1.4.jar). have ws method call (i can see generated java code too). say method call accepts requesta parameter , returns object of type responsea. problem have responsea extends axisfault (i can see in generated java source file responsea). axisfault on own turn extends remoteexception. as result of this, responsea object returned not returned me thrown to/at me remoteexception. so when this try { responsea x = call(y); // y requesta } catch (exception ex) { ex.printstacktrace(); } in client code, flow of control goes catch block , catching should getting in x variable (i.e. ex x be). any idea makes axis generate responsea class subclass of axisfault? also, in general, when class generated axis, generated subclass of axisfault? i think current problem. think in weird situation response succesful ws method call not returned me instead thrown to/at me. many in advance. package com.test.fulfillme

sql server - "Unable to load the specified metadata resource" ASP.NET -

i getting error " unable load specified metadata resource ". new asp.net , following tutorial: http://www.asp.net/web-forms/tutorials/tailspin-spyworks/tailspin-spyworks-part-2 i using visual studio 2012 , ms server 2012 unlike tutorial , chose new website not web app when starting site. i created entity data source control , created ado.net entity data entry database provided. when try use control error. i read connection string here mine. have spent hours trying fix it, can help? here connection string: <add name="entities" connectionstring=" metadata=res://*/data_access.edm_commerce.csdl| res://*/data_access.edm_commerce.ssdl| res://*/data_access.edm_commerce.msl; provider=system.data.sqlclient;provider connection string='data source=owen;initial catalog=commerce.mdf;integrated security=true;multipleactiveresultsets=true;app=entityframework';" providername="system.data.entityclient" /> i have tried changing conne

How do I tell a C program to create n arrays, reading n by scanf? -

i'd create small program adds, subtracts, multiplies , cross product vectors. therefore i'd have user enter - amount of vectors - dimension of said vectors - wants vectors (one of above mentioned functions) since quite new programming maybe haven't found correct source yet, in case grateful hint in right direction (especially search exactly, since not native speaker) my problem: i don't know how program sum function sums n vectors (n being amount of vectors user entered) i have rough idea rest of functions maybe won't bother program again sum-problem problem me. i'm sure answer somewhere near don't seem able find it. so many in advance :) simple vector #include <stdio.h> #include <stdlib.h> #include <string.h> typedef int type; typedef struct vector { size_t size; size_t capacity; type *array; } vector; vector *vec_make(){ vector *v; v = (vector*)malloc(sizeof(vector)); v->size = 0

schema - How to update a table based on an update from another table in oracle? -

i have table t1 present in schema s1. table t2 schema s2. both t1 , t2 have primary keys p1 , q1. i want update t1 updated q1 t2 p1. tried writing trigger doesnot helped me there no privileges because s1 application schema , s2 product schema. please let me know best solution implement same. in advance. i'm not oracle's expert think sql server have same sintax: update s1..t1 set field = tab2.field s1..t1 tab1 inner join s2..t2 tab2 on tab1.p1 = tab2.q1

Serving protected files with Django and Nginx X-accel-redirect -

i'm trying nginx , django play serve downloadable protected files. cannot work. here's nginx config: location ~ ^.*/protected-test/ { alias /<path-to-my-protected-files-on-server>/; internal; } the relevant urls.py viewing file(s): url(r'^static_files/downloads/protected-test/(?p<filename>.+)$', 'download_or_view', {'download_dir': '%s%s' % (settings.media_root, 'downloads/protected-test/'), 'content_disposition_type': 'inline', 'protected': 'true'}, name='protected_files') my view: def download_or_view(request, content_disposition_type, download_dir, filename=none, protected=false): '''allow file downloaded or viewed,based on request type , content disposition value.''' if request.method == 'post': full_path = '%s%s' % (download_dir, request.post['filename']) short_filename = str(request.post['filename'

javascript - drag and drop not working, dont allow drop on a div -

im trying create aplication using drag , drop. when im trying drop element on div called 'serviciosarealizar', doesnt allow. please html <div id='aceite' draggable="true" ondragstart="arrastrar(event)"><img src='img/aceite.jpg' /></div> <div id='luces' draggable="true" ondragstart="arrastrar(event)"><img src='img/lamp.png' /></div> <div id='serviciosarealizar' ondrop='soltar(event)' ondragover='permitesoltar(event)'></div> javascript <script> function permitesoltar(ev){ ev.preventdefault(); } function soltar(ev){ ev.preventdefault(); var data=ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function arrastrar(ev){ ev.datatransfer.setdata("text",ev.target.id); } </scrip

firefox - JavaScript Variable List and Editor -

Image
i looking extension firefox list javascript variables on page, along values, , allow edit them values different. if there way this, whether or without add-on, please tell me so. thanks helping me out! you can try firebug, nice tool, can debug javascript , output variables in scope. https://addons.mozilla.org/en-us/firefox/addon/firebug/ https://getfirebug.com/downloads

opengl es - Error 1 libavcodec.so File format not recognized Android GL Live Wallpaper -

i trying make live wallpaper android plays .mp4 video located on device in android-asset (with example using, copies file sdcard @ runtime/doesn't matter) i found example , using post able eclipse set ndk , building project. when building in eclipse using ndk plugin error in problems window: description resource path location type make: *** [libs/armeabi/libavcodec.so] error 1 glwallpapervideodemo-master c/c++ problem make: *** deleting file `libs/armeabi/libavcodec.so' glwallpapervideodemo-master c/c++ problem i same error if try run ndk-build command prompt. i downloaded project link above , imported eclipse. added lib glwallpaperservice build path, , made sure ndk setup. knowing lib folder changed libs tried moving glwallpaperservice libs folder, didn't help. the project builds without ndk fine in eclipse errors when trying run wallpaper because native libraries not built. how can resolve error? the package gi

asp.net - How to disable/override naming container's ID generation of Content page's control id's -

we have existing asp.net web application want convert using masterpages. in process of doing this, found html id's generated html elements prefixed contentplaceholder's id. , can expected when set contentplaceholder's clientidmode=static. since have lot of existing client side scripts make use of id's, part breaks when use masterpages, , quite big job run through our javascript make sure call javascript using control.clientid, lot of hardcoded. is there way disable prefixing? can succeed doing this, if create every control setting clientidmode=static, again prefer settings once, ensure controls have clientidmode=static. possible? or possible override namingcontainer of contentplaceholder? the platform .net 4.0 (after fixing above problem clientidmode=static in web.config described in answer below), have bumped problem "name" attribute automatically generated, , not set whatever before introduced masterpages. gives me problem existing server code, ha

Registration Form - jQuery Mobile -

i writing first jquery mobile app (so sorry if silly question) , want create sign form, in order keep users of app. in plain html set local server xampp example, , can done, using php data html form , insert users database. now in mobile app, using jquery mobile how can implement this?i mean should use?php , local server again? i ask because have searched lot in web, can't find jquery mobile , confused. thank all, in advance. it depends. question bit unclear if trying build mobile web application can use whatever web development stack want, in same way used to. here link jquery mobile getting started docs. if trying build native mobile application jquery mobile need pair jqm framework phonegap / apache cordova .

Binding C++ methods and variables to a table, side by side -

i've been attempting create "host" application exposes c++ api lua code, , have been successful far, have run snags when attempting bind "variables" in methods. the pattern have developed bind "classes" lua involves each class having _new , _gc function, static lual_reg regdata[] each class. can assign desired functions regdata array, , call helper method bind them lua. following code illustrating method: int host::_new(lua_state * ls) { host ** udata = (host **)lua_newuserdata(ls, sizeof(host *); *udata = new host(); lual_getmetatable(ls, "lual_host); lua_setmetatable(ls, -2); return 1; } int host::_gc(lua_state * ls) { host * host = *(host **)lual_checkudata(ls, 1, "lual_host"); delete host; return 0; } const lual_reg host::registrationdata[] = { { "new" , host::_new }, { "__gc" , host::_gc }, { 0 , 0 } }; and elsewhere: void luastate::

c - Variably modified array at file scope and subscripted value is neither array nor pointer -

i have following code calculating n-queen puzzle using pthreads. when try compile code following error message: wikithread.c:7:5: error: variably modified ‘hist’ @ file scope #include <stdio.h> #include <stdlib.h> #include <time.h> #include <pthread.h> int nthreads, size; int hist[size]; int count = 0; int solve(int col, int tid) { int start = tid * size/nthreads; int end = (tid+1) * (size/nthreads) - 1; int i, j; if (col == size) { count++; } #define attack(i, j) (hist[j] == || abs(hist[j] - i) == col - j) (i = start; <= end; i++) { (j = 0; j < col && !attack(i, j); j++); if (j < col) continue; hist[col] = i; solve(col + 1, tid); } return count; } void *worker(void *arg) { int tid = (int)arg; solve(0, tid); } int main(int argc, char* argv[]) { pthread_t* threads; int rc, i; // checking whether user has provided needed argume

some OpenGL function calls is not available in developing PS3 game -

i taking game console programming module @ sunderland university. teaching in module opengl , phyre engine develop ps3 game. the fact ps3 sdk kit not available free (it quite expensive) makes difficult me around when problem arises. apparently, ps3 framework doesn't support of gl function calls glgenlist, glbegin, glend , on. glbegin(gl_quads); gltexcoord2f(texture_size, m_ftextureoffset); glvertex3f(-100, 0, -100); //some more glend(); i errors when debugging ps3 debug mode @ glbegin, glend , gltexcoord2f. is there way around it? different way of drawing object, perhaps? most games developed ps3 don't use opengl @ all, programmed "on metal" i.e. make direct use of gpu without intermediate, abstrace api. yes, there opengl-esque api ps3, based on opengl-es. in opengl-es there no immediate mode . immediatate mode cumbersome method of passing geometry opengl starting primitive glbegin , chaining calls of vertex attribute state set

Passing environment variables to a process in PowerShell 2.0 when the variable is changed multiple times -

i'm having issue when comes passing corresponding environment variables process. below can see part of code can understand i'm trying do. i have 2 exe files need run. processes run updates based on location of environment variable %mainfiles% . when run code seems exe files not recognize change. however, when under computer properties see variables changed correctly. does know how force process recognize change? thanks while ($i -lt $size) { if ($tempenv[$i] -eq "done"){ $exitcode="completed" return } else { $temp = $tempenv[$i] write-host ("starting update " + $temp) -foregroundcolor "green" [system.environment]::setenvironmentvariable("mainfiles", "$temp","machine") [system.environment]::getenvironmentvariable("mainfiles","machine") copy-item $copyinstalldata -destination $temp $process = start-process xmlupgrade.exe -workingdirectory &qu

C++ boost json ptree parser fail to parse string -

i'm trying send json messages trough boost message_queue using ptree storing informations localy. this code of receiver: #include <boost/interprocess/ipc/message_queue.hpp> #include <iostream> #include <string> //#include <boost/archive/text_iarchive.hpp> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/json_parser.hpp> #include <boost/serialization/string.hpp> using boost::interprocess::message_queue; using boost::property_tree::ptree; using boost::property_tree::read_json; #define max_size 1000 int main() { message_queue mq (boost::interprocess::open_or_create,"coda",10,max_size); message_queue::size_type recv_size; unsigned int priority; ptree pt; std::stringstream iss; std::string serialized_string; serialized_string.resize(max_size); mq.receive(&serialized_string[0],max_size,recv_size,priority); iss << serialized_string; std::istringstream is

html - Display inline causing element to be pushed further down -

if @ codepen here: http://codepen.io/anon/pen/lhbqs and change " display: block " on img " display: inline ", causes text "fine dining in casual environment" pushed further down. the "fine dining" element below h2 , block element, why make difference whether or not img tag block or inline since block element cannot show on same line inline element anyways? this related margin collapsing - img , h2 below have margins "touch" each other, block elements margins collapse (merge one), while inline elements not , both apply, hence additional space. check article - http://www.howtocreate.co.uk/tutorials/css/margincollapsing

javascript - How can I emulate radio button functionality in jQuery? -

i have 3 buttons, each checkbox: <div id="btn_group"> <button class="btn"><i class="icon-check-empty"></i> one</button> <button class="btn"><i class="icon-check-empty"></i> two</button> <button class="btn"><i class="icon-check-empty"></i> three</button> </div> my current jquery looks this: $('.btn').on('click',function() { $('#btn_group > .btn > i').removeclass('icon-check').addclass('icon-check-empty'); $(this).children('i').toggleclass('icon-check-empty icon-check'); }); here's needs happen: 1) click button 1: button 1 checked, others not checked 2) click button 1 again: button 1 unchecked, others still unchecked 3) click button 1: (see #1) 4) click button 2: button 2 checked, others not checked (like radio button) basically n

html - Why do some websites not show a .php at the end of their file extension? -

this question has answer here: remove .php extension php 4 answers sometimes when @ websites url this www.website.com/index.php and other times this www.website.com/index/ why second url not have .php or .html extension? in configured web server, www.website.com/index.php tells load index.php file webroot directory. this www.website.com/index/ tells in /index/ directory file matching listed in directoryindex configuration directive in server's httpd.conf file or in .htaccess file in web site's webroot directory (see http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryindex details). a sample configuration directive this: directoryindex index.php index.html default.html default.htm this tell web server to, when no filename given, in current directory index.php file, if not found index.html file, , if not found def

java - How do I solve this serialization error on my log in/create account program? -

i'm writing simple gui program uses log in information text file. takes log in info gui program create's user accounts. i'm not sure how serialize effectively, it's i've learned recently. should do? how solve serialization error, , can improve , make functional. user class: package passwordprogram; import java.util.arraylist; import java.util.arrays; import java.awt.borderlayout; import java.awt.color; import java.awt.gridbagconstraints; import java.awt.gridbaglayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.io.serializable; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.jpasswordfield; import javax.swing.jtextfield; import javax.swing.uimanager; public class user implements serializable, actionlistener { public static arraylist<string> allusernames = new arraylist<string>(); string username; string pass

android - Gradient Lines between GridView -

Image
i want line below image between gridview: following have been tried. gridview xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <gridview android:id="@+id/gridhouseindex" android:layout_width="match_parent" android:layout_height="match_parent" android:listselector="@null" android:smoothscrollbar="true" android:stretchmode="columnwidth" android:numcolumns="2" android:verticalspacing="22dp"> </gridview> adapter xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"

Using a regular expression with nested for loops, using Perl -

i have 2 arrays: @file_list holds list of files in directory, and @name_list holds names. for example, these arrays contain @file_list = ('bob_car', 'bob_house', 'bob_work', 'fred_car', 'fred_house', 'fred_work', ...); @name_list = ('bob', 'fred', ...); (the real data not simple). my goal compare each file every name , see if match. match if file string starts name. i use these matches sort files new directories, based on corresponding name. here code: for ( $i = 0; $i < scalar @file_list ; $i++ ) { ( $j = 0; $j < @name_list ; $j++ ) { if ( $file_list[ $i ] =~ m/^$name_list[ $j ]/ ) { print "$file_list[ $i ] goes $name_list[ $j ]\n"; } else { print "no match\n"; } } } however, don't matches. i've tested individual loops , working. else, ther

osx - Writing to USB HID Device with IOKit IOHIDDeviceSetReportWithCallback -

i trying communicate asynchronously usb hid device using iohidmanager iokit. have no problem registering callback iohiddeviceregisterinputreportcallback , setting reports iohiddevicesetreport . when try , use iohiddevicesetreportwithcallback communicate device it's no go. error kioreturnunsupported (0xe00002c7). here link gentleman same issue apple usb mailing list. http://lists.apple.com/archives/usb/2009/oct/msg00004.html i didn't want think response above message correct, can confirm that, method not implemented. here part of response apple developer technical support: looking thru sources iohiddevicesetreportwithcallback calls (*device->deviceinterface)->setreport; in theory should iokit hid driver… looking @ returns kioreturnunsupported…

html - position:fixed cause margin-top disappear? -

things want achieve quite simple just @ top fixed position element not move while scrolling down document. and after div#content have margin-top top edge , center in window. so code is: html <div class='head-container' id="headercom"> <header id="a"></header> </div> <div id="content" role="main"></div> css * { margin: 0; padding: 0 } body { width: 100%; height: 100%; position: relative; } .head-container { position: fixed; top:0; left:0; width: 100%; height: 100px; background: red; _position:absolute; // make ie6 support fixed position _top: expression(eval(document.documentelement.scrolltop)); // make ie6 support fixed position } header { display: block; width: 960px; height: 100px; margin: 0 auto; position: rel

sql - database name in mysql seems valid but it is showing an error -

i trying create database '-' in between 2 words , should work fine isn't. here log file: mysql> create database test1; query ok, 1 row affected (0.00 sec) mysql> show databases -> ; +-----------------------+ | database | +-----------------------+ | information_schema | | mifos | | mifosplatform_tenants | | mifostenant | | mifostenant_default | | mysql | | performance_schema | | sakila | | test | | test1 | | testing | | world | +-----------------------+ 12 rows in set (0.00 sec) mysql> create database test1-mohit; error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax use near '-mohi t' @ line 1 you can use _(underscore) create database test1_mohit; or try this create database `test1_mohit`; these both work

html - How do I change the size of an image in css -

i keep trying change size of image css adding width , height attribute. however, changes zoom of picture. for example, have 90px 90px image. however, when change width , height, it's zoomed in version of pic instead of smaller pic. my css is: .image-90 { horiz-align: center; width: 60px; height: 60px; background-size: 90px 90px; margin: 10px; border: 1px rgb(218, 218, 218) solid; background: #c4c4c4 no-repeat 0 0; background-image: url('/content/images/person_noimage.png? width=90&height=90&mode=crop'); } here html (my image url stored in person.avitarimage): <div class="image-90" style="background-image:url-person.avitarimage"></div> background-size has declared after background , background-image . i'm not sure if true in browsers, noticed in chrome , firefox, @ least. see http://jsfiddle.net/ws2qe/1/ if set 1 value, assumed width , height adjust automatically keep back

php - Multiple Arrays - Insert Value into database -

currently working on service script friend. when service script mean used updating , adding values database. friend has stored values of database arrays. i have succeeded @ entering in 1 of arrays confused on how multiple arrays. in more of question on how can refactor current code more dynamic. also please keep in mind, has hundreds of arrays needs done not 2 or 3 literally hundreds. my updated code : (please read comments) $colors['colors_all'] = array("black","charcoal"); // add unique indexes $colors['colors_bright_all'] = array("silver","white"); // add unique indexes $allarrays = get_defined_vars(); // defined vars $arrays = array(); // set default array foreach ($allarrays $varname => $value) { // run through variables set in allarrays if(is_array($value) && $varname == 'colors') { // if array colors $arrays = array_merge($arrays, $value); // merge arrays new array

javascript - Listen to change event in Internet Explorer -

addeventlistener input file select in ie 9 , 10 should trigger after file selection triggers after second time file select, means first time if no files selected first select wont trigger , after every file selection listener event triggers (if different file selected). code snippet: html <input type="file" name="imagefile" id="upload"> javascript var file = document.getelementbyid("upload"); file.addeventlistener("change", handlefileselect, false); function handlefileselect(event) { alert("file selected"); } the code runs fine in firefox , chrome has problem ie. old ie versions not support .addeventlistener() method, has .attachevent() method instead add events elements. use following addevent method function addevent(evnt, elem, func) { if (elem.addeventlistener) // w3c dom elem.addeventlistener(evnt,func,false); else if (elem.attachevent) { // ie dom elem.attacheve

android google map issue with google-play-services_lib -

Image
i created 1 android application followed steps make api keys , intalled google play services android sdk manager. read many blogs integartion google map, import libraty project worksapce "\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib" path. when tried add library project project's property window in android tab got following out put when check library second time got following out put in android tab have proble of libraty project. used eclipse ide. got solution different ide , suggest me best solution.. the first problem happens when path library long, solution move google-play-services lib place path shorter , try reference again. your second problem: "google maps android api(23127): failed load map. not contact google servers." caused when there problem api key or problem permissions have defined in manifest file, take post wrote , go on steps generate key: google map api key next,

Error in PHP file uploading -

now, getting problem. trying upload file code :- <form action="up.php" method="post"> <input type="hidden" name="max_file_size" value="200000" /> choose file upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" name="submit" value="upload!"/> </form> here up.php:- if(!isset($_files["uploadedfile"])) die("no file found"); in above code, says "no file found". why isn't having file? you need add enctype="multipart/form-data" in form. <form action="up.php" method="post" enctype="multipart/form-data">

asp.net mvc - Mvc routing in for multiple controllers -

i have 2 routes in global file. route propertydetails working fine doesn't works booking links used are. idea why not working @html.actionlinkwithspan("booknow", "create", "booking", new {item.productid,item.productname},"gradient-button") @html.actionlinkwithspan("moredetails", "index", "propertydetails", new {item.productid,item.productname},"") routes.maproute( "booking", "book/{productid}/{productname}", new { controller = "bookingcontroller", action = "create", productname = urlparameter.optional } ); routes.maproute( "propertydetails", "details/{productid}/{productname}", new { controller = "propertydetails", action = "index", productname = urlparamet

google cloud messaging - JAVA - Send class over GCM in android -

let's have class called "myclass". need send server android phone on gcm. now, doing sending fields seperately , constructing myclass again on phone. there way send object directly on gcm? instead of sending fields separately, can encode them favorite serialized format (xml, json, etc...) , pass string representation of object in single field. app need have method deserialize object field.

c++ - Converting double to string function - memory issues? -

i find myself having std::cout various double variables. i've made simple function convert double std::string, can use std::cout etc. // convert double string. std::string dtos(double x) { std::stringstream s; s << x; return s.str(); } the function seems work ok, question is: approach have (bad) memory implications ie. allocating unecessary memory, or leaving 'dangling'? thanks guys pete no, code ok, read comments on code: std::string dtos(double x) { std::stringstream s; // allocates memory on stack s << x; return s.str(); // returns s.str() string value // frees allocated memory of s } in addition, can pass double cout directly.

opencv - Unable to build OpenCV2 since lots of Object-C error -

guys i'm trying build opencv2 on os x 10.8.3 under this official installation guide. the configure step works fine: cmake -d:cmake_build_type=release .. but when build make: make -j 8 there turns out lots of object-c errors this: /system/library/frameworks/foundation.framework/headers/nsstring.h:260: error: expected ';' before '__attribute__' /system/library/frameworks/foundation.framework/headers/nsstring.h:261: error: expected ':' before '(' token /system/library/frameworks/foundation.framework/headers/nsstring.h:261: error: expected type-specifier before '(' token /system/library/frameworks/foundation.framework/headers/nsstring.h:261: error: expected ')' before '(' token /system/library/frameworks/foundation.framework/headers/nsstring.h:261: error: expected identifier before '(' token /system/library/frameworks/foundation.framework/headers/nsstring.h:261: error: expected ';' before '(&

java me - How to save canvas as an image in j2me? -

i want save current state of canvas image use in next pointerevent. if use repaint clear canvas , can't previous state of canvas. so, want save image , iterate on , on can make out want. final question how save canvas image ?. or there possibility of converting graphics object byte array ? you can't save canvas image. you have create image first, , can paint onto image. basically means midlet doing more work, since first have draw onto image, , have draw image onto canvas. it's way can want.

dll - Visual Studio 2010 linking errors using VTK -

i'm having trouble compile vtk 5.10.1 example code in visual studio 2010 on windows 7 64 bit sp1. first of all, installed vtk using this tutorial . no errors occured while installing vtk , example executables cone.exe located @ c:\vtk5.10.1_cmake\bin\release running fine. in visual studio 2010 started new win32 console application , tested first example code this site . edited projekt properties (additional include directories, additional library directories , additional dependencies). the linker errors looked that: vtktest.obj : error lnk2019: unresolved external symbol ""public: void __thiscall vtkrenderer::addactor(class vtkprop *)" (?addactor@vtkrenderer@@qaexpavvtkprop@@@z)" referenced in function "_main". most of the other people same error forgot add libs additional dependencies. added libs in c:\vtk5.10.1_bin\lib\vtk-5.10 directory , opengl32 library. tried seperate libs space, semicolon , new line. then, read people using share

android - Nullpointer exception while adding the banner Ad -

i trying display banner ad in game using revmob display both banner ad , fullscreen ad. full screen ads displaying banner ad not displaying getting null poinet exception in view.addview(banner). enter code herepublic class mainactivity extends activity { private ccglsurfaceview mglsurfaceview; private boolean iscreated = false; public static framelayout m_rootlayout; public static string application_id = "514c7c57cee0500d00000001"; public static revmob revmob; // used display toast messages , not necessary app @override protected void oncreate(bundle savedinstancestate) { if (!iscreated) { iscreated = true; } else { return; } super.oncreate(savedinstancestate); setrequestedorientation(activityinfo.screen_orientation_portrait); requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.

How to read a big binary file in Java -

i want read binary file in java, contains m datasets. know each dataset consists of 3 elements: long number, double number , long number in sequence. datasets repeated 1 after each other till end of file. supposing number m of datasets known, how can read file in java without passing datasets main memory, able read large files well, not "fit" in main memory? if want sequential access: import java.io.fileinputstream; import java.io.datainputstream; datainputstream dis = new datainputstream(new fileinputstream("input.bin")) for(int = 0; < m; i++){ long l1 = dis.readlong(); double d1 = dis.readdouble(); long l2 = dis.readlong(); /* need */ } dis.close();

sql - Entity Framework v5.0 Exception 'From' is a reserved keyword and cannot be used as an alias, unless it is escaped -

i use entityframework v5.0, entitydatasource control. in code set sql query, when open page after compilation exception. how can fix it? code: entrylistds.commandparameters.add(new parameter("subid", dbtype.int32, common.currentuserid.tostring())); entrylistds.commandparameters.add(new parameter("typeid", dbtype.int32, ((int)messagetype.wall).tostring())); entrylistds.commandtext = @"select m.id, m.to, m.subject, m.bodyhtml, m.creationdate, m.new, m.typeid message m join subscription s on m.from = s.objectid s.subscriberid = @subid , m.typeid = @typeid order m.creationdate desc"; exeption when open page: 'from' reserved keyword , cannot used alias, unless escaped. near line 12, column 6. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.data.entitysqlexception: 'from' reserved keyword , cannot