Posts

Showing posts from June, 2012

How to get results from a Delphi function called by Lua -

i creating function in delphi able use lua. have managed create procedure (or function without taking results) , works perfect. problem want results of function (not procedure anymore) delphi lua. i've read codes out there couldn't make work. my function looks this: function tluascripter.getsetting(luastate: tluastate):tluastate; var path,stri: string; i:integer; begin //getsetting('targeting/targetingenabled') path := lua_tostring(luastate, 1); //we string 'targeting/..." lua_pop(luastate,1); //we put in stack (so can clean it) stri:= tree.getsetting(path); //this function gets, example "no" lua_pushlstring(luastate,pansichar(ansistring(stri)),length(stri)); //i pass lua stack //showmessage(lua_tostring(luastate,1));--> shows result need in msgbox result:= luastate; end; so if use in lua console getsetting('targeting/targetingenabled') i able result in msgbox (uncommenting "showmessage...") fu

javascript - How to have multiple 'and' logical operators and an 'or' logical operator -

it hard explain want looks this: if(a === 4 && b === true && c === "words" || "numbersandwords")dosomething(); but ends running without matching first operators. want know how have last operator except 2 different inputs while still making sure other criteria met before running. you need use parentheses, e.g.: if(a == 4 && b == true && (c == "words" || c == "numbersandwords")) { dosomething(); }

cursor - getLoaderManager: in an activity -

i writing app wimmone watch: no orientation changes, small simple screen, , android version 7. i got first android app running, based on book, had fragment. fragments added complications not want deal with. my second app has similar structure: list of items select item see or update details. trying read cursor, , create array call "setlistadapter(lstadapter);". i started with: getloadermanager().initloader(0, null, this); got error: the method initloader(int, bundle, loadermanager.loadercallbacks) in type loadermanager not applicable arguments (int, null, phonelistactivity) so tried suggestion: getloadermanager().initloader(0, null, (android.app.loadermanager.loadercallbacks<d>) this); got error: the method initloader(int, bundle, loadermanager.loadercallbacks) type loadermanager refers missing type d so tried this: getloadermanager().initloader(0, null, (android.app.loadermanager.loadercallbacks) this); and got error:

java - getting GATE embedded to work with gateHome inside a JAR -

i'm trying distribute gate application standalone jar file. have gate plugins resources on classpath in project, setgatehome() requires file object, can't resource packaged inside jar. i assumed java io sufficiently abstracted apis handle case, turns out file objects refer physical files on disk. is there alternative way gate api? or option force jars unpack temporary folder before running? the example in docs servlet, in case it's possible file object servlet (i think because war files unzipped servlet container). from experience gate can suggest unpack jar resources necessary somewhere local drive.usually keep resources(annie,tokenizer,japes,gazetteers) in 1 folder , use relative paths these resources. additional option can try use: http://jenkins.gate.ac.uk/job/gate-nightly/javadoc/gate/gate.html#runinsandbox(boolean) option.

c++ - Pen color/style -

in c# define pen using following line, i'm unable set similar in c++. tried several options in c++ select color object no luck far. interested in selecting color - color.darkgray - don't want specify own argb values. var pen = new pen(color.darkgray) { dashstyle = dashstyle.dashdot }; in c++ can define wanted know if can define mode color.darkgray directly instead of rgb values. pen pen(color(255,169,169,169),1); //darkgray pen.setdashstyle(dashstyledashdot); the colors defined same in c++ in c# (afiak, c# system.graphics wrapper on c++ functions anyway). need : pen pen(color::darkgray, 1); pen.setdashstyle(dashstyledashdot); isn't you're trying do? colors defined in gdipluscolor.h if want full list, it's same c# version think.

3d - OpenFrameworks: Move "camera" trough ofVbo? -

i have 3 dimensional shape drawn ofvbo , move trough (like you'd move trough space in first person shooter). thought should use ofcamera i'm wondering if solution, , i'm starting doubt if it's possible @ all? the openframeworks documentation isn't helpful , have searched web extensively i'm still in dark. i think you'll able find you're looking here . created simple interface moving around app in 3d space.

java - JTable Not Updating Data -

for reason, nothing changes jtable when called (this method updates jtable after user submits sql query). givens: datavector , columnnamesvector verified populated correctly. jtable private class variable. private void updatedata() { updatedatavariables(); table = new jtable(datavector, columnnamesvector) { @suppresswarnings({ "unchecked", "rawtypes" }) public class getcolumnclass(int column) { (int row = 0; row < getrowcount(); row++) { object o = getvalueat(row, column); if (o != null) { return o.getclass(); } } return object.class; } }; } any ideas? it's common beginner's fallacy confuse objects reference variables, need understand quite distinct. when call this: table = new jtable(datavector, columnnamesvector) {..... you creating new jtable object ,

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -

i student , quite new programming, , given task using asp.net , c#, without being taught either. plan learn teach ourselves. the task stuck on making website import csv file sql server database of last year's room bookings around campus. the table has following columns: request_id; priority; module_id; day; start_time; length; park; students; room_code; status; semester_id; linked_request; week_1; week_2; week_3; week_4; week_5; week_6; week_7; week_8; week_9; week_10; week_11; week_12; week_13; week_14; week_15; ) in code, try make work 3 columns (request_id,priority,module) starters. when press import button, want read .csv file (with fixed name @ fixed directory) eg "1,2,3" - comma separating fields [delimiter] - , import sql server datab

html - Textarea and div padding differences in Firefox -

i made fiddle here. http://jsfiddle.net/pmver/ the textarea , div render identically in both safari , chrome. in firefox, there 2px padding on right of textarea , affects word wrapping. what's mysterious without white-space: pre-wrap; padding seems vary depending on width of element. i can fix detecting firefox , adding padding-right:2px div , know if can fixed without browser hack? css div, textarea { font-family: courier; font-size: 14px; margin: 0; padding: 0; outline: 0; resize: none; border: 1px solid black; width: 282px; height: 80px; white-space: pre-wrap; overflow: hidden; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html <textarea>lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt...</textarea> <div contenteditable="true">lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmo

java - Stop flickering/repainting -

Image
so have java.applet.applet embedded jframe. applet uses java.awt.canvas drawing. code quite lot me post , there no "small" examples here picture @ least: ok in above, canvas being draw on applet. jtextarea @ bottom hidden when toggle-button pressed , shown when toggle-button not pressed. however, every time show/hide textarea, applet/canvas flickers. jframe resized everytime textarea shown/hidden. now small snippet have show/hide looks like: public void setconsolevisible(boolean visible) { this.scrollpane.setvisible(visible); //show/hide jtextarea. frame.pack(); //pack jframe resize it. frame.setsize(frame.getwidth(), frame.getheight() + 1); //resize frame 1px. } how can stop flickering when resizes , show/hide jtextarea? canvas/applet double buffered. the area painting on might smaller visible area. garbage painted on causing flicker. why resize frame 1 pixel? try removing, frame.setsize(frame.getwidth(), frame.getheight() + 1);

python - wxPython set selected control upon application start -

i have simple wxpython application. has image , text-entry field (a wx.textctrl ). i want able able start entering text window opens. right now, have first click in text control, , can start entering text. here minimal app demonstrates issue: import wx class myframe(wx.frame): """ derive new class of frame. """ def __init__(self, parent, title): wx.frame.__init__(self, parent, title=title, size=(200, 100)) mainsizer = wx.boxsizer(wx.vertical) self.control = wx.textctrl(self, style=wx.te_multiline) mainsizer.add(self.control, 1, wx.expand) self.setsizer(mainsizer) self.show(true) app = wx.app(false) frame = myframe(none, 'small editor') app.mainloop() i've poked around wx.setinsertionpoint , not seem have effect. ah, derp. had further inheritance chain. you can call setfocus() on control (in case, self.control.setfocus() ). setfocus() member function of wxwin

How Android grid layout set component fill the specified row and column? -

Image
code: <gridlayout xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:rowcount="6" android:columncount="4" > <!-- define textbox,across 4 columns --> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_columnspan="4" android:textsize="50sp" android:layout_marginleft="4px" android:layout_marginright="4px" android:padding="5px" android:layout_gravity="right" android:background="#eee" android:textcolor="#000" android:text="test" /> <!-- define 2 buttons,delete , reset --> <button android:id="@+id/bn1" android:layout_column

ios - why does -openWithCompletionHandler so slow -

i have coredata database has 3 entities:"card", "record", "stat", "card" has 3000 objects in , "card" has no blob attribute (i know blob attribute may slow), other 2 entities has no objects. i debugged on iphone4, when opening database, found quite slow, here code: nslog(@"database start open..."); [self.database openwithcompletionhandler:^(bool success) { nslog(@"copy & open success: %d", success); callback(yes); }]; here logs: 2013-05-13 13:11:54.776 suishoubei[1670:707] database start open... 2013-05-13 13:11:54.943 suishoubei[1670:1b03] coredata: annotation: connecting sqlite database file @ "/var/mobile/applications/850d8afd-ba6e-4e64-a150-507d5cd645fb/documents/default database/storecontent/persistentstore" 2013-05-13 13:11:54.950 suishoubei[1670:1b03] coredata: sql: pragma cache_size=200 2013-05-13 13:11:54.956 suishoubei[1670:1b03] coredata:

arrays - C++: Storing strings in linked list -

(i've used c++ recreationally, forgive noobish question.) i want write simple spreadsheet program works in terminal (via ncurses). personal edification. want store cells linked lists wouldn't have reallocate bunch of data every time wanted move or insert rows; each cell node in linked list, contains cell's data. data consist of ascii characters. relevant consideration: naturally, of these cells have resized accommodate more characters. question: datatype should use store cell contents? thoughts: i've never used std::string , kinda skeptical of idea after rather sour experience trying program in d :). i'm open possibility they're not bad. thinking of using char arrays[], fit bill pretty nicely , consistent c intuition. stumbled upon suggestion use std::vector while looking through stackoverflow, seems better since they're easy resize, fear might considered clumsy. g'day , thankee much. if storing "string", std::string sta

android - getCheckedradiobutton always returns -1 -

this code final radiogroup rg1 = (radiogroup) findviewbyid(r.id.radiogroup1); radiobutton rb1 = (radiobutton) findviewbyid(r.id.radio0); radiobutton rb2 = (radiobutton) findviewbyid(r.id.radio1); radiobutton rb3 = (radiobutton) findviewbyid(r.id.radio2); final checkbox cb1 = (checkbox) findviewbyid(r.id.chkbox1); int id = rg1.getcheckedradiobuttonid(); system.out.println("------------------------|"+id); switch (id) { case r.id.radio0: cb1.setenabled(true); break; case r.id.radio1: cb1.setenabled(true); break; case r.id.radio2: cb1.setenabled(true); break; default: cb1.setenabled(false); break; } this returns -1(chkbox disabled) , cant seem make work . plus ive tried , assigned individual values through setid radiobutton , doesnt work either. this xml <radiogroup android:id="@+id/radiogroup1" android:layout_width="wrap_content" android:layout_

python - Optimize shell script (bash) to impove performance -

i have bash script use process text file: #/bin/bash dos2unix sourcefile.txt cat sourcefile.txt | grep -v '\/' | grep -v '\-\-' | grep -v '#' | grep '[a-za-z]\*' > modified_sourcefile.txt mv modified_sourcefile.txt sourcefile.txt # # read sourcefile file 1 line line , iterate... # while read line echo $line | grep -v '\/' | grep -v '\-\-' | grep -v '#' if [ $? -eq 0 ] # echo "current line " $line ";" char1=`echo ${line:0:1}` # echo "1st char " $char1 if [ -n "$char1" ] # if blank-line, neglect line. # echo "test passed" var1=`echo $line | cut -d '*' -f 1` var2=`echo $line | cut -d '*' -f 1` var3=`echo $line | cut -d - -f 1` var4=`echo $line | cut -d '*' -f 1` var5=`echo $line | cut -d '*' -f 2` var6=`echo $line | cut -d - -f 1` var7=`echo $line | cut -d '

java - UI not updated from onProgressUpdate -

i writing following code: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_test); start(); } public void start() { scrollview device= (scrollview) findviewbyid(r.id.test); device.removeallviews(); tablelayout devicetable = new tablelayout(getapplicationcontext()); devicetable.setid(951357); device.addview(devicetable); devicelist = new arraylist<deviceinformation>(); wifimanager wifi = (wifimanager)getsystemservice( context.wifi_service ); if(wifi != null) { wifimanager.multicastlock lock = wifi.createmulticastlock("wifidevices"); lock.acquire(); } wifiinfo winfo = wifi.getconnectioninfo(); mac = winfo.getmacaddress(); sendmulticastflyport = new thread(new flyportsender(mac)); sendmulticastflyport.start(); sen

javascript - Explanation of Code - I think it's Lambda expression -

it's been long since have been programmer ask stupid questions. have not new techniques make me pretty old fashioned programmer. example following code, remove cookies. var cookies = document.cookie.split(';'); (var = 0; < cookies.length; i++) { var cookie = cookies[i]; var eqpos = cookie.indexof('='); var name = eqpos > -1 ? cookie.substr(0, eqpos) : cookie; document.cookie = name + '=;expires=thu, 01 jan 1970 00:00:00 gmt'; } in there doing this eqpos > -1 ? cookie.substr(0, eqpos) : cookie; i don't know happening here. please explain. , type of notation , need learn understand it. it short if statment, condition eqpos > -1 name be: cookie.substr(0, eqpos) if condition true: and cookie if false

linq - Get data from multiple table using Entity Framework 5 -

in database, have 4 tables relationship this: inspection --> correspondence --> correspondenceto, user now, when inspectionid equals something, want subject , correspondencetype , sentdate correspondence , displayname user , firstname , lastname correspondenceto . write code this: var result = in context.inspections join correspondence in context.correspondences on i.id equals correspondence.inspectionid join correspondenceto in context.correspondencetoes on correspondence.id equals correspondenceto.correspondenceid join user in context.users on correspondence.senderuserid equals user.id i.id == inspectionid select new { subject = correspondence.subject, correspondencetype = correspondence.correspondencetype, sentdate = correspondence.sentdate, sender = user.displayname, receiver = new { corres

Reading a File and showing on Screen using getline : C++ -

i trying read file below content: this line 1 line 2 line 3 line 4 line 5 code: #include <iostream> #include <fstream> #include <limits> using namespace std; int main() { char buff[50]; ifstream is("test.txt"); if(!is) cout << "unable open test.txt\n"; while(is.getline(buff,50,'\n')) { cout << is.gcount(); cout << buff; cout << "\n----------------\n"; } return 0; } the output: $ ./trial 18this line 1 ---------------- 18this line 2 ---------------- 20this line 3 ---------------- 19this line 4 ---------------- 17this line 5 ---------------- now suppose if comment cout << "\n----------------\n"; i.e. while(is.getline(buff,50,'\n')) { cout << is.gcount(); cout << buff; //cout << "\n----------------\n"; } i output as: $ ./trial 17th

SpreadsheetGear Custom functions descriptions -

could spreadsheetgear set descriptions custom functions? excel has descriptions every argument in standard functions. xll add-in can it. in constructor of spreadsheetgear.customfunctions.function see function name , argument types. thanks spreadsheetgear not provide way add function descriptions or argument descriptions own custom functions. fyi: work spreadsheetgear , take requests things this. you're welcome contact directly can add contact information feature request. suppose might add such feature our custom functions after add "intellisense"/formula-builder sort of feature our workbookview/formulabar controls.

html5 - Button is not showing up when jquery sortable list is changed -

i using jquery sortable functionality, , have list sortable, want save sorted order button show if user change sorting order otherwise button should not displayed. have written own function showbutton , calling in update attribute of jquery sortable function not working. below code: <script> $(function() { $( "#sortable" ).sortable({ placeholder: "ui-state-highlight", cursor: 'crosshair', update: function(event, ui) { var order = $("#sortable").sortable("toarray"); $('#sorted_order').val(order.join(",")); showbutton(); } }); $( "#sortable" ).disableselection(); }); function showbutton() { var field = "#somefield_id";//is field after want button show $node = '<input type="submit" id="savebtn" value="save order">'; $(field).after($node); }; ple

python - Agent-Modelling System on GAE -

i starting on project simulate agents on google app engine. plan have control panel so: control panel http://complexityworkshop.com/cw/tutorial/netlogoall.gif my question during simulation, server has process tasks again , again , display them onto graph. best possible way? obviously want avoid refreshing page again , again. intermediate in html, so-so in web applications. pointer in right direction needed. thanks! digvijay you should @ either appengine channel api, or xmpp support. https://developers.google.com/appengine/docs/python/channel/ https://developers.google.com/appengine/docs/python/xmpp/ choice of approach (channel vs xmpp) depend lot on how build ui.

gpu - HyperQ support in OpenCL -

i want run heterogeneous kernels execute on single gpu asynchronously. think possible in nvidia kepler k20(or device having compute capability 3.5+) launching each of kernels different stream , runtime system maps them different hardware queues based on resource availability. feature accessible in opencl? if so, equivalent of cuda 'stream' in opencl? nvidia drivers support such execution on k20 cards through opencl? amd gpu has similar feature(or there on development)? answer of these questions me lot. in principle, can use opencl command queues achieve cke (concurrent kernel execution). can launch them different cpu threads. here few links might started: how know if kernels executing concurrently? http://devgurus.amd.com/thread/142485 i not sure how work nvidia kepler gpus having strange issues using opencl on k20 gpu.

jquery - javascript mirror dropdown selection in another dropdown -

i have 2 forms on page. 1 hidden initially. later, after first form submitted first hidden , second similar more compact form displayed instead. i want second form loaded same values submitted in first form, have accomplished, except dropdown, causing me issues. what i'm trying follows: <select name = "chooserep" id = "chooserep1" data-param = "required" data-desc = "report" onchange = "document.getelementbyid('chooserep2').options[document.getelementbyid('chooserep2').selectedindex]=this.options[this.selectedindex]"> <option value="">select...</option> <option value="pandl">profit &amp; loss</option> <option value="balsheet">balance sheet</option> </select> this doesn't seem have effect. have jquery available, option if knows how. this should set value,

jquery - Javascript string comparison not working, searched a lot? -

this code (it's bookmarklet) javascript:(function(){ a=document.createelement('script'); a.setattribute('src','//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js'); document.body.appendchild(a); data='[["#txtapplicantlname","agrawal","text"],["#txtapplicantfname","aayush","text"],["#txtfather","ranjan","text"],["#txtmother","neelam","text"],["#txtpincode","452010","text"],["#txtphone","2147483647","text"],["#txtemail","aayush@mail.com","text"]]'; for(a=$.parsejson(data),b=a.length-1;0<=b;b--){ c=a[b]; if (c[2] == 'text') { console.log(c); $(c[0]).val(c[1]); } } })(); it used work fine until inserted if statement, broke. console doesn't give m

Call WCF service from iOS app -

* background: *i have "document repository" kind-of app.the ios app calls wcf service download document metadata(document name,document size,etc).there .net client used uploading documents.when upload document,i save in "appdomain.currentdomain.basedirectory" creating separate folder each document.so,effectively,the document stored @ "c:\inetpub\wwwroot\foo\bar\document.doc". * the problem: *when ios app tries download document,it returns error 500 "could not find part of path 'c:\inetpub\wwwroot\foo\bar\document.doc'" however,it returns metadata document(document name,document size,document location,etc.) correctly. what should make app download document? the error 500 sending server. problem on server side. sure path correct? uploaded document on directory?

java - Deserializing an ArrayList -

i having trouble deserializing object file in java in new session. i can serialize arraylist file, , deserialize in same session, however, if create new main object , try deserialize same file worked in previous session, code not work. why be? here code: public void loadpersonlistfromfile(string filename) { try { personlist = new arraylist<person>(); objectinputstream in = new objectinputstream(new fileinputstream(filename)); arraylist<person> personlist = (arraylist<person>) in.readobject(); in.close(); } catch (exception e) { e.printstacktrace(); } } public void savepersonfiletofile(string filename) { try { objectoutputstream out = new objectoutputstream(new fileoutputstream(filename)); out.writeobject(personlist); out.close(); } catch (exception e) { e.printstacktrace(); } } edit the deserialization seems working, because if .size() call on list in loadpersonlistfromfil

xslt - How to group neighbour-siblings -

i have this: <root> <a>foo</a> <b>bar</b> <groupme>foobar</groupme> <groupme>baz</groupme> <groupme>42</groupme> <c>abc</c> <d>def</d> <groupme>foo</groupme> <x>xyz</x> <groupme>bar</groupme> <groupme>foo</groupme> <z>thats it</z> </root> now need groume's direct neighbours single node like: <root> <a>foo</a> <b>bar</b> <groupme>foobar baz 42</groupme> <c>abc</c> <d>def</d> <groupme>foo</groupme> <x>xyz</x> <groupme>bar foo</groupme> <z>thats it</z> </root> also groupme nodes containing other nodes, i've leave them provide simple example. groupme nodes apear in specific level, no groupme nodes in others root. any me? such grouping can achieved

javascript - jquery scroller mousewheel with keyboard -

i have site scroller here article trying add keyboard keys , down below code [ http://jsfiddle.net/roxon/r3x7r/1/] control page scroll animation mousewheel kindly 1 let me know if possible.. hope you, http://jsfiddle.net/r3x7r/274 added keyboard shortcut scrolling in page sections. // our code var winh = $(window).height(); $('.page').height(winh); var c = 0; var pagesn = $('.page').length; var activepage=0; $(document).bind('mousewheel', function(ev, delta) { delta>0 ? --c : ++c ; if(c===-1){ c=0; }else if(c===pagesn){ c=pagesn-1; } activepage = c; var pagepos = $('.page').eq(c).position().top; $('html, body').stop().animate({scrolltop: pagepos},{easing: 'easeincirc', duration: 1200}); return false; }); $(document).bind('keyup', function(event){ console.log(event); if(event.which == 40) { activepage = activepage+1;

CUDA Performance - Always return different values -

this code: using namespace std; #include <iostream> #include <stdio.h> #include <stdlib.h> const int n = 8000; void fillarray(int *data, int count) { (int = 0; < count; i++) data[i] = rand() % 100; } __global__ void add(int* a, int *b, int *c) { int tid = threadidx.x + blockidx.x * blockdim.x; if (tid < n) { c[tid] = a[tid] + b[tid]; } } __global__ void subtract(int* a, int *b, int *c) { int tid = threadidx.x + blockidx.x * blockdim.x; if (tid < n) { c[tid] = a[tid] - b[tid]; } } __global__ void multiply(int* a, int *b, int *c) { int tid = threadidx.x + blockidx.x * blockdim.x; if (tid < n) { c[tid] = a[tid] * b[tid]; } } __global__ void divide(int* a, int *b, int *c) { int tid = threadidx.x + blockidx.x * blockdim.x; if (tid < n) { c[tid] = a[tid] / b[tid]; } } __global__ void modu(int* a, int *b, int *c) { int tid = threadidx.x + blockidx.

css - Custom navigation menu in Liferay? -

i using liferay 6 tomcat 7 , liferay sdk java develop custom website handled 1 portlet. thing dont navigation bar in liferay , want redesign custom css navigation menu. tried find css files reason have 2 css files named custom.css(one in root folder of theme other 1 in sub-folder). 1 have work on? , how can change .vm file in such way going suit css. i want make boxed navigation menu 5 links , each of them separated(typical css navigation menu). any advice or appreciated! thanks in advance if need customize navigation bar in liferay boxed navigation, suggest navigation.vm file under theme.and modify css accordingly used navigation bar.

mysql - Working with big amount of data. PHP Sessions or accessing data every time? -

we have web app we're working on users store bookmarks (url/title/shortkey/times url clicked) etc. every time user refreshes page, data being retrieved database (different server). logically, you're able view bookmarks. bookmarks in of every page of app; every user clicks, data has parsed. is better store data sessions or keep requesting every time database? developers in situations? i imagine, every refresh button approximately 1000 users approximately 100 bookmarks (approx. 100 characters each row), thats ton of data every minute accessed. a pretty similar example based on our web app twitter's favourites . every time access page, request's favourites database, or favourites stored sessions based on id? cache bookmarks flat file include relevant (even structured nature if let them build folder structure) - if store bookmarks in db can reconstitue results. delete file when crud bookmark. if come suitable file naming scheme - userid.txt - managin

android - how to access inner class variable in outer class method in java -

i want access inner class hashmap variable in outer class method means item selected listener of spinner. have hashmap declare inside inner class , assigning value in hashmap inside inner class method. accessing hashmap value using key in setonitemselectedlistener outer class got null value in hashmap. made hashmap static in outer class , put value in inner class , again access outer class listener again got null value. if having soltion please tell me. little bit confused here .i don't know wrong. please have solution. following outer , inner class public class projectdetailactivity extends sherlockactivity { // declare hashmap. hashmap<string, string> phaseidkv = new hashmap<string, string>(); @override protected void oncreate(bundle savedinstancestate) { new loadphasedata().execute(projid); //create variable of inner class final projectdetailactivity.loadphasedata inner = new projectdetailactivity().new loadphasedata(); //listener phase sp

c# - Entity framework map column which is not in old database -

i have table in new db contains column 'note'. have old db same table same structure have not column 'note'. changed edmx, added (mapped) column 'note' new db. if want use edmx in old db have error: column doest not exists... i try put code try catch, without succesfull. error outside off try catch. //---new version db try { vehicles = entities.vehicle.where(v => v.numplate == numplate || v.note == numplate); } catch (exception) { vehicles = entities.vehicle.where(v => v.numplate == numplate); } //---old version db foreach (vehicle vehicle in vehicles) //<------- error how can resolve? thanks that's kind of 'hack', can choose ignore note property once you're using old database. look onmodelcreating method in context class, , replace with: pr

sql - Operations on selected items -

i want have query this: select sum(data_parts.size) size_sum, (size_sum/2.) half_of_size_sum data_parts data_parts.some_id='1'; of course won't work, because there's no column named size_sum , question is: is there way use size_sum parameter in next select item? other using subquery containing current query (see davide's answer), don't think there way that. but do: select sum(data_parts.size) size_sum, (sum(data_parts.size)/2.) half_of_size_sum data_parts data_parts.id='1'; postgres smart enough sum once. if query expanded more calculations being done on size_sum recommend subquery approach. not because works better, because easier read. if current calculation need, don't bother subquery. less easy read.

Paypal Overage Pricing -

i'm using paypal website payment subscription. want charge overage price customers when it's needed. possible? don't want use express checkout or double modify existing subscription. for example, i'm charging $20 each month. current month, want able charge $22. still regular payment $20. need permission or need take customers' credit card info , use payflow sdk? any solution? you need modify amounts setting in subscription button. set has 1 month trial @ $20, after starts regular recurring amount of $22.

css3 - css background is not working when convert template into pdf using rendering plugin -

i using rendering plugin generate pdf in grails. using background color prepared css. code here. #container #content #maincontent .block .backgroundstyle { background: #ffffff; /* old browsers */ /* ie9 svg, needs conditional override of 'filter' 'none' */ background: url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wiia/pgo8c3znihhtbg5zpsjodhrwoi8vd3d3lnczlm9yzy8ymdawl3n2zyigd2lkdgg9ijewmcuiighlawdodd0imtawjsigdmlld0jved0imcawidegmsigchjlc2vydmvbc3bly3rsyxrpbz0ibm9uzsi+ciagpgxpbmvhckdyywrpzw50iglkpsjncmfklxvjz2ctz2vuzxjhdgvkiibncmfkawvudfvuaxrzpsj1c2vyu3bhy2vpblvzzsigede9ijaliib5mt0imcuiihgypsixmdaliib5mj0imcuipgogicagphn0b3agb2zmc2v0psiwjsigc3rvcc1jb2xvcj0ii2zmzmzmziigc3rvcc1vcgfjaxr5psixii8+ciagica8c3rvccbvzmzzzxq9ijewjsigc3rvcc1jb2xvcj0ii2zmzmzmziigc3rvcc1vcgfjaxr5psixii8+ciagica8c3rvccbvzmzzzxq9ijq2jsigc3rvcc1jb2xvcj0ii2y0ownknyigc3rvcc1vcgfjaxr5psixii8+ciagica8c3rvccbvzmzzzxq9ijewmcuiihn0b3aty29sb3i9iinmzmzmzmyiihn0b3atb3bhy2l0et0imsivpgogid

.htaccess - I want to change URL for specific page for my wordpress site through htaccess or using wordpress function -

i have url http://www.shreyinnovations.com/edudemo/app-detail/?app-detail=a-level%20revision need replace below http://www.shreyinnovations.com/edudemo/app/a-level%20revision i change .htaccess file change below # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase /edudemo/ rewriterule ^app/([0-9]+)$ app-detail?app-detail=$1 [qsa] rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /edudemo/index.php [l] </ifmodule> # end wordpress i used wordpress function change appche rule rewrite address this add_action( 'init', 'app_detail_rewrite_rules' ); add_action( 'generate_rewrite_rules', 'app_detail_rewrite_rules' ); function app_detail_rewrite_rules(){ add_rewrite_rule('^app/([0-9]+)','app-detail?app-detail=$matches[1]','top'); } but still can't url want.please let me know if have solution this. thanks in advance.

excel - export gridview value into .xlsx file in vb.net -

i want create application can export desired gridview result new excel file. if file same name exists ask give new name else create new file. try out private sub buttonexport_click(byval sender system.object, byval e system.eventargs) handles buttonexport.click dim rowstotal, colstotal short dim i, j, ic short system.windows.forms.cursor.current = system.windows.forms.cursors.waitcursor dim xlapp new excel.application try dim excelbook excel.workbook = xlapp.workbooks.add dim excelworksheet excel.worksheet = ctype(excelbook.worksheets(1), excel.worksheet) xlapp.visible = true rowstotal = datagridview1.rowcount - 1 colstotal = datagridview1.columns.count - 1 excelworksheet .cells.select() .cells.delete() ic = 0 colstotal .cells(1, ic + 1).value = datagridview1.columns(ic).headertext next = 0 rowstotal - 1 j = 0 c