PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
11,571,216
07/20/2012 00:23:33
1,539,385
07/19/2012 23:49:22
1
0
read 16 bit or 32 bit images in python
How can I read in 16 bit or 32 bit images by python and get the correct image values as an array? I tried to read in SRTM (Shuttle Radar Topography Mission) using PIL + Numpy, GDAL + Numpy and PythonMagick etc. (I am not sure what types (16 bit or 32 bit) the image is. When I use ArcGIS to read in, it shows 32 bit float, while when I use PCI Geomatica ImageWork, only 16 bit signed optional can show the correct image. ) However, though the above testing, the values in the array are incorrect. For example, I used a SRTM in CA whose elevation range is from 136 to 737, but when I use ndimage to get the maximum and minimum values, the array value range is from -3.40 to 737, and it appears lots of negative values. what can I do? Do I make some mistakes?
python
image
null
null
null
null
open
read 16 bit or 32 bit images in python === How can I read in 16 bit or 32 bit images by python and get the correct image values as an array? I tried to read in SRTM (Shuttle Radar Topography Mission) using PIL + Numpy, GDAL + Numpy and PythonMagick etc. (I am not sure what types (16 bit or 32 bit) the image is. When I use ArcGIS to read in, it shows 32 bit float, while when I use PCI Geomatica ImageWork, only 16 bit signed optional can show the correct image. ) However, though the above testing, the values in the array are incorrect. For example, I used a SRTM in CA whose elevation range is from 136 to 737, but when I use ndimage to get the maximum and minimum values, the array value range is from -3.40 to 737, and it appears lots of negative values. what can I do? Do I make some mistakes?
0
11,571,706
07/20/2012 01:39:10
1,423,577
05/29/2012 11:38:15
3
0
Android webview: JavaScript halts on touch
I'm trying to use a webview to display a page that does some very basic canvas animations and displays the current time as a string. I use setTimeout() to update the content once per second (or 30 times per second for the animation). My problem is that as soon as I touch the screen, my javascript stops executing. The furthest I have got was adding listeners for touch events to my javascript and call e.preventDefault() in the event handler, which helped in most cases, but seemed to miss some cases for where none of the usual javascript events got fired. The next thing I tried was to override the default touch handler as follows: myWebView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); This helped, but the problem is that it consumes the touch event before it gets dispatched to my webview, making it impossible to listen for touch events in javascript. I want to disable all the default Android behavior like zooming and so on, since this is what blocks my animation, but I still want to be able to use these events in javascript. Any ideas?
javascript
android
webview
touch
null
null
open
Android webview: JavaScript halts on touch === I'm trying to use a webview to display a page that does some very basic canvas animations and displays the current time as a string. I use setTimeout() to update the content once per second (or 30 times per second for the animation). My problem is that as soon as I touch the screen, my javascript stops executing. The furthest I have got was adding listeners for touch events to my javascript and call e.preventDefault() in the event handler, which helped in most cases, but seemed to miss some cases for where none of the usual javascript events got fired. The next thing I tried was to override the default touch handler as follows: myWebView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); This helped, but the problem is that it consumes the touch event before it gets dispatched to my webview, making it impossible to listen for touch events in javascript. I want to disable all the default Android behavior like zooming and so on, since this is what blocks my animation, but I still want to be able to use these events in javascript. Any ideas?
0
11,571,708
07/20/2012 01:39:24
1,319,836
04/08/2012 02:59:52
1
0
csv file import to mysql date format
I have a csv file that I'm importing into mysql, there is a date field in the csv file that is formatted as so: 30.09.2011 I have a php page that pulls the data from the database and I want to order it by date field. At the moment it is seeing the date as a string and ordering like so.. 30.09.2011 6.02.2012 7.10.2011 9.12.2008 thanks!
php
mysql
date
csv
null
null
open
csv file import to mysql date format === I have a csv file that I'm importing into mysql, there is a date field in the csv file that is formatted as so: 30.09.2011 I have a php page that pulls the data from the database and I want to order it by date field. At the moment it is seeing the date as a string and ordering like so.. 30.09.2011 6.02.2012 7.10.2011 9.12.2008 thanks!
0
11,565,997
07/19/2012 17:16:25
1,066,197
11/25/2011 19:48:01
31
0
ADOX or SQL DDL
I tried two method to create tables inside a new Ms Access database generated by ADOX catalog class. The first method is using ADOX classes and Properties to create columns and tables and eventually add them to Database at the same time of database creation. The second method is using an OleDbConnection class and execute SQL DDL commands two create Tables inside the empty database. For me, both methods works fine but I really need to know which method is implementing better in reality? Thanks
c#
ddl
adox
null
null
null
open
ADOX or SQL DDL === I tried two method to create tables inside a new Ms Access database generated by ADOX catalog class. The first method is using ADOX classes and Properties to create columns and tables and eventually add them to Database at the same time of database creation. The second method is using an OleDbConnection class and execute SQL DDL commands two create Tables inside the empty database. For me, both methods works fine but I really need to know which method is implementing better in reality? Thanks
0
11,571,717
07/20/2012 01:40:35
1,539,487
07/20/2012 01:33:59
1
0
Conversion failed when converting date and/or time from character string sql 2008 vb 2010
namespace MedicalDataExporter { public partial class frmSales : Form { public frmSales() { InitializeComponent(); } private void dtpFrom_ValueChanged(object sender, EventArgs e) { } private void btnExtract_Click(object sender, EventArgs e) { SqlConnection objConn = new SqlConnection("Data Source=AKC-105DR-CMS01\\GLOCO;Initial Catalog=Medprac;Persist Security Info=True;User ID=sa;Password=9929"); // String conStr = Properties.Settings.Default.MedpracConnectionString; // System.Data.SqlClient.SqlConnection objConn = new System.Data.SqlClient.SqlConnection(conStr); objConn.Open(); SqlCommand objCmd = new SqlCommand("SELECT CONVERT(char(8), InvDate,3) AS InvDate,InvoiceNo,EmployerCode,TaxAmount + SubTotal AS Amount,'' AS Payment FROM Invoice WHERE (InvDate >= CONVERT(datetime, '"+dtpFrom.Text +"', 3)) AND (InvDate <= CONVERT(datetime, '"+dtpTo.Text+"',3))", objConn); SqlDataReader objReader; objReader = objCmd.ExecuteReader(); System.IO.FileStream fs = new System.IO.FileStream("C:\\CMSExportedData\\Sales-" + DateTime.Now.ToString("dd-MM-yy") + ".txt", System.IO.FileMode.Create); System.IO.StreamWriter sw = new System.IO.StreamWriter(fs, System.Text.Encoding.Default); int count = 0; while (objReader.Read()) { for (int i = 0; i < 5; i++) { if (!objReader.IsDBNull(i)) { string s; s = objReader.GetDataTypeName(i); //MessageBox.Show(s); if (objReader.GetDataTypeName(i) == "char") { sw.Write(objReader.GetString(i)); } else if (objReader.GetDataTypeName(i) == "money") { sw.Write(objReader.GetSqlMoney(i).ToString()); } else if (objReader.GetDataTypeName(i) == "nvarchar") { sw.Write(objReader.GetString(i)); } } if (i < 4) { sw.Write("\t"); } } count = count + 1; sw.WriteLine(); } sw.Flush(); fs.Close(); objReader.Close(); objConn.Close(); MessageBox.Show(count + " records exported successfully."); this.Close(); } private void groupBox1_Enter(object sender, EventArgs e) { } } } Hi all, whenever i run this script i receive a error "Conversion failed when converting date and/or time from character string" It points to "While (objReader.Read())" section
c#
visual-studio-2010
sql-server-2008
null
null
null
open
Conversion failed when converting date and/or time from character string sql 2008 vb 2010 === namespace MedicalDataExporter { public partial class frmSales : Form { public frmSales() { InitializeComponent(); } private void dtpFrom_ValueChanged(object sender, EventArgs e) { } private void btnExtract_Click(object sender, EventArgs e) { SqlConnection objConn = new SqlConnection("Data Source=AKC-105DR-CMS01\\GLOCO;Initial Catalog=Medprac;Persist Security Info=True;User ID=sa;Password=9929"); // String conStr = Properties.Settings.Default.MedpracConnectionString; // System.Data.SqlClient.SqlConnection objConn = new System.Data.SqlClient.SqlConnection(conStr); objConn.Open(); SqlCommand objCmd = new SqlCommand("SELECT CONVERT(char(8), InvDate,3) AS InvDate,InvoiceNo,EmployerCode,TaxAmount + SubTotal AS Amount,'' AS Payment FROM Invoice WHERE (InvDate >= CONVERT(datetime, '"+dtpFrom.Text +"', 3)) AND (InvDate <= CONVERT(datetime, '"+dtpTo.Text+"',3))", objConn); SqlDataReader objReader; objReader = objCmd.ExecuteReader(); System.IO.FileStream fs = new System.IO.FileStream("C:\\CMSExportedData\\Sales-" + DateTime.Now.ToString("dd-MM-yy") + ".txt", System.IO.FileMode.Create); System.IO.StreamWriter sw = new System.IO.StreamWriter(fs, System.Text.Encoding.Default); int count = 0; while (objReader.Read()) { for (int i = 0; i < 5; i++) { if (!objReader.IsDBNull(i)) { string s; s = objReader.GetDataTypeName(i); //MessageBox.Show(s); if (objReader.GetDataTypeName(i) == "char") { sw.Write(objReader.GetString(i)); } else if (objReader.GetDataTypeName(i) == "money") { sw.Write(objReader.GetSqlMoney(i).ToString()); } else if (objReader.GetDataTypeName(i) == "nvarchar") { sw.Write(objReader.GetString(i)); } } if (i < 4) { sw.Write("\t"); } } count = count + 1; sw.WriteLine(); } sw.Flush(); fs.Close(); objReader.Close(); objConn.Close(); MessageBox.Show(count + " records exported successfully."); this.Close(); } private void groupBox1_Enter(object sender, EventArgs e) { } } } Hi all, whenever i run this script i receive a error "Conversion failed when converting date and/or time from character string" It points to "While (objReader.Read())" section
0
11,571,718
07/20/2012 01:40:45
1,476,275
06/23/2012 02:45:01
1
1
Facebook mail servers
I've heard people ask about it.... I want to setup facebook so if can go straight into the mail app in iOS, but when I do the normal setup process, it asks me for the incoming mail server and the outbound mail server, which I can't think of. Could anybody give me a hand here? I think facebook makes a header or something to code stuff like this, but is it made for objective C?
ios
facebook
email
null
null
07/20/2012 17:11:27
off topic
Facebook mail servers === I've heard people ask about it.... I want to setup facebook so if can go straight into the mail app in iOS, but when I do the normal setup process, it asks me for the incoming mail server and the outbound mail server, which I can't think of. Could anybody give me a hand here? I think facebook makes a header or something to code stuff like this, but is it made for objective C?
2
11,410,610
07/10/2012 09:44:35
278,629
02/22/2010 11:19:17
168
3
Cloud9 IDE local themes
The Cloud9 IDE docs say you can import a Textmate theme, but i cant figure it out. Can some one explain step-by-step how i can do this. Im trying to include the theme on my localhost by the way. I found this link, but i still dont get it... [https://groups.google.com/forum/#!msg/ace-discuss/kLgJFe2l2YY/47QvhIowqqMJ][1] [1]: https://groups.google.com/forum/#!msg/ace-discuss/kLgJFe2l2YY/47QvhIowqqMJ . The above url also mentioned being able to edit already existing themes. This would also come in handy if any one knows how to / where the files are located.
themes
cloud9-ide
null
null
null
null
open
Cloud9 IDE local themes === The Cloud9 IDE docs say you can import a Textmate theme, but i cant figure it out. Can some one explain step-by-step how i can do this. Im trying to include the theme on my localhost by the way. I found this link, but i still dont get it... [https://groups.google.com/forum/#!msg/ace-discuss/kLgJFe2l2YY/47QvhIowqqMJ][1] [1]: https://groups.google.com/forum/#!msg/ace-discuss/kLgJFe2l2YY/47QvhIowqqMJ . The above url also mentioned being able to edit already existing themes. This would also come in handy if any one knows how to / where the files are located.
0
9,330,706
02/17/2012 15:13:56
409,565
08/03/2010 10:49:30
279
9
POST request with data
This might be a noob question but i've been fiddling with it for hours now and wasn't able to find the solution. I would like to send a POST request with form data using grails, in jQuery this following 1 liner works as I wish: $.post('<SOME SERVER URI>', {param1: 'p1'}, function(data) {console.log(data);}) but the following Grails code doesn't: import static groovyx.net.http.ContentType.JSON import static groovyx.net.http.Method.POST import groovyx.net.http.HTTPBuilder ... def http = new HTTPBuilder(<SERVER BASE URI>) http.request(POST, JSON) { uri.path = <REST OF URI> uri.query = [param1: 'p1'] response.success = { resp, json -> println 'success' } } I think it has something to do with the data being sent, as the request leaves but fails (facebook graph is the base uri...) the jquery code sends the data as form data, but i'm not sure thats the problem Thanks!
grails
grails-2.0
null
null
null
null
open
POST request with data === This might be a noob question but i've been fiddling with it for hours now and wasn't able to find the solution. I would like to send a POST request with form data using grails, in jQuery this following 1 liner works as I wish: $.post('<SOME SERVER URI>', {param1: 'p1'}, function(data) {console.log(data);}) but the following Grails code doesn't: import static groovyx.net.http.ContentType.JSON import static groovyx.net.http.Method.POST import groovyx.net.http.HTTPBuilder ... def http = new HTTPBuilder(<SERVER BASE URI>) http.request(POST, JSON) { uri.path = <REST OF URI> uri.query = [param1: 'p1'] response.success = { resp, json -> println 'success' } } I think it has something to do with the data being sent, as the request leaves but fails (facebook graph is the base uri...) the jquery code sends the data as form data, but i'm not sure thats the problem Thanks!
0
11,410,615
07/10/2012 09:45:02
1,476,661
06/23/2012 10:28:41
1
0
Qt designer plugin, custom (OpenGL) widget, visual studio add-in, undefined symbol
I have tried to fiddle aroudn with Qt a while back, but I found the entry cost somewhat too high, so I chose a simpler project (SFML) for my needs. My application has grown too complex, so the signal-slot mechanism of Qt became a must. Since I develop in VS (but make all my code cross-platform) it seemed a good idea to use the VS add-in and have it generate all the auxiliary stuff needed to use Qt. I have read practically everything google points me to concerning all my problems, so please let me not copy 20-30 links of pages I've been to. My problem is: I want to use OpenGL in Qt. As far as I read the standard way is to subclass QGLWidget and reimplement paint-init-resize functions. To make this work in Designer, I need a plug-in. I have created a Designer plug-in project in VS using the add-in, and created a Canvas class, with the three functions reimplemented: http://pastebin.com/hMsALUii Ultimately I'd expect to see a blank red canvas once the window is ready. The generated canvasplugin.h had to be modified at the include part, since the add-in misgenerated include directory. After this I made my QTApp have a dependancy in VS, namely the Canvas project in the solution. I had to set linkage of the Canvas lib manually, as dependancy only sets build order. Now comes the problematic part. I edited the ui file using Qt Designer, but to add custom widgets, the only working solution I found is promoting a standard QWidget and point Designer to the header file of my class (Canvas.hpp). I am unsure if setting base class to QWidget in the promotion dialog window is correct, since QGLWidget is not in the list of choices. After this the problem is, that the application does not compile. The compiler argues that: > Generating Code... QtGLTest.obj : error LNK2019: unresolved external symbol "public: __thiscall Canvas::Canvas(class QWidget *)" (??0Canvas@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_QtGLTestClass::setupUi(class QMainWindow *)" (?setupUi@Ui_QtGLTestClass@@QAEXPAVQMainWindow@@@Z) D:\ToBeSaved\Develop\QtTest\Win32\Release\\QtGLTest.exe : fatal error LNK1120: 1 unresolved externals I don't quite understand this, since Canvas.lib is set to be linked in this QtGLTest project, and Canvas.cpp has Canvas::Canvas(QWidget* parent) implemented. In another topic I read that this might be due to the wrong order of linking. The problem in multiple threads is using #pragma comment(lib,...), but this pragma doesn't exist in g++, so it is not a choice. Any ideas why the unresolved external exists, or how the problem can be solved?
visual-studio
qt
qt-designer
null
null
null
open
Qt designer plugin, custom (OpenGL) widget, visual studio add-in, undefined symbol === I have tried to fiddle aroudn with Qt a while back, but I found the entry cost somewhat too high, so I chose a simpler project (SFML) for my needs. My application has grown too complex, so the signal-slot mechanism of Qt became a must. Since I develop in VS (but make all my code cross-platform) it seemed a good idea to use the VS add-in and have it generate all the auxiliary stuff needed to use Qt. I have read practically everything google points me to concerning all my problems, so please let me not copy 20-30 links of pages I've been to. My problem is: I want to use OpenGL in Qt. As far as I read the standard way is to subclass QGLWidget and reimplement paint-init-resize functions. To make this work in Designer, I need a plug-in. I have created a Designer plug-in project in VS using the add-in, and created a Canvas class, with the three functions reimplemented: http://pastebin.com/hMsALUii Ultimately I'd expect to see a blank red canvas once the window is ready. The generated canvasplugin.h had to be modified at the include part, since the add-in misgenerated include directory. After this I made my QTApp have a dependancy in VS, namely the Canvas project in the solution. I had to set linkage of the Canvas lib manually, as dependancy only sets build order. Now comes the problematic part. I edited the ui file using Qt Designer, but to add custom widgets, the only working solution I found is promoting a standard QWidget and point Designer to the header file of my class (Canvas.hpp). I am unsure if setting base class to QWidget in the promotion dialog window is correct, since QGLWidget is not in the list of choices. After this the problem is, that the application does not compile. The compiler argues that: > Generating Code... QtGLTest.obj : error LNK2019: unresolved external symbol "public: __thiscall Canvas::Canvas(class QWidget *)" (??0Canvas@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_QtGLTestClass::setupUi(class QMainWindow *)" (?setupUi@Ui_QtGLTestClass@@QAEXPAVQMainWindow@@@Z) D:\ToBeSaved\Develop\QtTest\Win32\Release\\QtGLTest.exe : fatal error LNK1120: 1 unresolved externals I don't quite understand this, since Canvas.lib is set to be linked in this QtGLTest project, and Canvas.cpp has Canvas::Canvas(QWidget* parent) implemented. In another topic I read that this might be due to the wrong order of linking. The problem in multiple threads is using #pragma comment(lib,...), but this pragma doesn't exist in g++, so it is not a choice. Any ideas why the unresolved external exists, or how the problem can be solved?
0
11,410,624
07/10/2012 09:45:36
1,011,444
10/24/2011 18:23:20
46
0
How to use Time in Google Charts?
I'm using Google Charts. Here's an example data from [Google's website][1]: var data = new google.visualization.DataTable( { cols: [{id: 'task', label: 'Employee Name', type: 'string'}, {id: 'startDate', label: 'Start Date', type: 'date'}], rows: [{c:[{v: 'Mike'}, {v: new Date(2008, 1, 28), f:'February 28, 2008'}]}, {c:[{v: 'Bob'}, {v: new Date(2007, 5, 1)}]}, {c:[{v: 'Alice'}, {v: new Date(2006, 7, 16)}]}, {c:[{v: 'Frank'}, {v: new Date(2007, 11, 28)}]}, {c:[{v: 'Floyd'}, {v: new Date(2005, 3, 13)}]}, {c:[{v: 'Fritz'}, {v: new Date(2011, 6, 1)}]} ] } ) I'd like to use hours and minutes also in the date variables. I haven't found an example syntax on the website, has anyone tried this before? Thanks in advance. [1]: https://developers.google.com/chart/interactive/docs/datatables_dataviews#whatformat
charts
google-charts
data-visualization
google-charts-api
null
null
open
How to use Time in Google Charts? === I'm using Google Charts. Here's an example data from [Google's website][1]: var data = new google.visualization.DataTable( { cols: [{id: 'task', label: 'Employee Name', type: 'string'}, {id: 'startDate', label: 'Start Date', type: 'date'}], rows: [{c:[{v: 'Mike'}, {v: new Date(2008, 1, 28), f:'February 28, 2008'}]}, {c:[{v: 'Bob'}, {v: new Date(2007, 5, 1)}]}, {c:[{v: 'Alice'}, {v: new Date(2006, 7, 16)}]}, {c:[{v: 'Frank'}, {v: new Date(2007, 11, 28)}]}, {c:[{v: 'Floyd'}, {v: new Date(2005, 3, 13)}]}, {c:[{v: 'Fritz'}, {v: new Date(2011, 6, 1)}]} ] } ) I'd like to use hours and minutes also in the date variables. I haven't found an example syntax on the website, has anyone tried this before? Thanks in advance. [1]: https://developers.google.com/chart/interactive/docs/datatables_dataviews#whatformat
0
11,410,041
07/10/2012 09:08:13
1,514,263
07/10/2012 09:01:13
1
0
Best configuration management software for azure
I would like to know which is the best online configuration management software for the Windows Azure cloud environment. I would like to install a SCM tool on the cloud account which can be accessed using a client app by developers. Regards, Salman.
azure
null
null
null
null
null
open
Best configuration management software for azure === I would like to know which is the best online configuration management software for the Windows Azure cloud environment. I would like to install a SCM tool on the cloud account which can be accessed using a client app by developers. Regards, Salman.
0
11,410,042
07/10/2012 09:08:15
1,168,904
01/25/2012 09:59:45
458
1
Why run() of Runnable **can not** throw checked Exceptions?
According to section 6.3.2 of [JCIP][1] : > Runnable is a fairly limiting abstraction; run can not return a value or throw checked exception . `run()` can not return a value since its return type is void but why can not it throw a checked exception ? [1]:http://jcip.net/
java
java.util.concurrent
null
null
null
null
open
Why run() of Runnable **can not** throw checked Exceptions? === According to section 6.3.2 of [JCIP][1] : > Runnable is a fairly limiting abstraction; run can not return a value or throw checked exception . `run()` can not return a value since its return type is void but why can not it throw a checked exception ? [1]:http://jcip.net/
0
11,410,629
07/10/2012 09:45:51
814,804
06/24/2011 21:55:27
48
1
How to cast from boolean to integer?
I tried: { xs:integer($contentAssetProvider/text()) } and { data($contentAssetProvider) cast as xs:integer? } but getting Error executing the XQuery transformation: Error parsing XML: {err}XP0021: "false": can not cast to {http://www.w3.org/2001/XMLSchema}integer: error: decimal: Invalid decimal value: unexpected char '102'
xquery
osb
null
null
null
null
open
How to cast from boolean to integer? === I tried: { xs:integer($contentAssetProvider/text()) } and { data($contentAssetProvider) cast as xs:integer? } but getting Error executing the XQuery transformation: Error parsing XML: {err}XP0021: "false": can not cast to {http://www.w3.org/2001/XMLSchema}integer: error: decimal: Invalid decimal value: unexpected char '102'
0
11,410,636
07/10/2012 09:46:26
402,322
07/26/2010 13:43:07
1,408
75
Is it allowed to repackage Oracles JDBC driver?
I would like to distribute my Java program as a JAR file. My program requires the Oracle JDBC driver, which is also delivered as an JAR file. But the `java -jar` command accepts only one JAR file. Therefore I have to merge the two JAR files. This can be done quite easily but am I allowed to do that? Am I allowed to distribute my program as a JAR file containing the contents of the Oracle JDBC JAR file?
java
oracle
jdbc
licensing
null
07/11/2012 10:16:58
off topic
Is it allowed to repackage Oracles JDBC driver? === I would like to distribute my Java program as a JAR file. My program requires the Oracle JDBC driver, which is also delivered as an JAR file. But the `java -jar` command accepts only one JAR file. Therefore I have to merge the two JAR files. This can be done quite easily but am I allowed to do that? Am I allowed to distribute my program as a JAR file containing the contents of the Oracle JDBC JAR file?
2
11,410,600
07/10/2012 09:43:55
1,510,090
07/08/2012 13:45:03
11
0
drag/drop python gui
I am new to python and am looking to write a simple GUI for a script I wrote. I would need to be able to drag/drop boxes within a window. i.e. I would have a blank field and under it a list of options represented by different boxes. I would then want to be able to drag the options in the filed and list them in it as they are added. I know this is relatively easy do to in javascript using jQuery but I am not doing a web application. Which python gui framework would allow me to do this drag/drop easily ? Tkinter, pyQT, wxPython ? Thank you all a lot for your help
python
gui
drag-and-drop
null
null
null
open
drag/drop python gui === I am new to python and am looking to write a simple GUI for a script I wrote. I would need to be able to drag/drop boxes within a window. i.e. I would have a blank field and under it a list of options represented by different boxes. I would then want to be able to drag the options in the filed and list them in it as they are added. I know this is relatively easy do to in javascript using jQuery but I am not doing a web application. Which python gui framework would allow me to do this drag/drop easily ? Tkinter, pyQT, wxPython ? Thank you all a lot for your help
0
11,628,133
07/24/2012 09:40:45
689,434
04/03/2011 01:46:52
161
3
C# class does not contain a constructor that takes 1 arguments
On VS C# Express, I get this error when running the code below: 'myComponent.SettingsComponentAttributes' does not contain a constructor that takes 1 arguments. What am I missing? public class SettingsComponentAttributes : GH_ComponentAttributes { public override void CreateAttributes() { m_attributes = new SettingsComponentAttributes(this); } }
c#
constructor
null
null
null
null
open
C# class does not contain a constructor that takes 1 arguments === On VS C# Express, I get this error when running the code below: 'myComponent.SettingsComponentAttributes' does not contain a constructor that takes 1 arguments. What am I missing? public class SettingsComponentAttributes : GH_ComponentAttributes { public override void CreateAttributes() { m_attributes = new SettingsComponentAttributes(this); } }
0
11,628,139
07/24/2012 09:41:03
84,098
03/28/2009 20:33:03
465
7
Avoiding POST forgery on a Django site
I'm experimenting with a way of knowing the specific twitter identities of my site's users even though they're not logged in. And would like the help of the community to find out how I could reduce the possibility of impersonation. The main idea is that a user comes to the main page, fills a form, and clicks on a "tweet this" button as a way to submit the form. That opens up a popup where the user sees a pre-filled message: "I just submitted this form" and tweets it. This popup resides on twitter.com. No oauth is involved here. When the tweet is done, twitter sends back the id of the tweet that was just created to a javascript callback function on the web page. This javascript function ajax POSTs the form fields as well as the tweet id to a handler on the server. The server then fetches the twitter information of that tweet including the user info and saves the form info with a foreign key to the user. What I want to avoid is for an impersonator to come to the page, fill up the form with junk, and manually POST the form including a tweet id to an unrelated tweet from another user. Django, which I'm using, has something called CSRF tokens to avoid impersonators from doing POST calls without loading the page. But I'm not sure if this would also prevent users who load the page (and see the csrf token) to fake the POST. The main thing I want to avoid is for people to associate a twitter id that is not theirs with a for that they post. Looking forward to your suggestions of some creative ways to solve this or to poke holes at my thinking.
django
django-forms
web-security
csrf
man-in-the-middle
null
open
Avoiding POST forgery on a Django site === I'm experimenting with a way of knowing the specific twitter identities of my site's users even though they're not logged in. And would like the help of the community to find out how I could reduce the possibility of impersonation. The main idea is that a user comes to the main page, fills a form, and clicks on a "tweet this" button as a way to submit the form. That opens up a popup where the user sees a pre-filled message: "I just submitted this form" and tweets it. This popup resides on twitter.com. No oauth is involved here. When the tweet is done, twitter sends back the id of the tweet that was just created to a javascript callback function on the web page. This javascript function ajax POSTs the form fields as well as the tweet id to a handler on the server. The server then fetches the twitter information of that tweet including the user info and saves the form info with a foreign key to the user. What I want to avoid is for an impersonator to come to the page, fill up the form with junk, and manually POST the form including a tweet id to an unrelated tweet from another user. Django, which I'm using, has something called CSRF tokens to avoid impersonators from doing POST calls without loading the page. But I'm not sure if this would also prevent users who load the page (and see the csrf token) to fake the POST. The main thing I want to avoid is for people to associate a twitter id that is not theirs with a for that they post. Looking forward to your suggestions of some creative ways to solve this or to poke holes at my thinking.
0
11,628,154
07/24/2012 09:41:52
517,558
11/23/2010 14:27:05
1,552
111
why showing soft keyboard in landscape works differernt?
I have to show keyboard when an event occurs. here was my code: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); but this code doesn't work if device is in landscape. For landscape I have to use: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY); imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED); can somebody explain why first code doesn't work in landscape?
android
android-softkeyboard
screen-orientation
issues
null
null
open
why showing soft keyboard in landscape works differernt? === I have to show keyboard when an event occurs. here was my code: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); but this code doesn't work if device is in landscape. For landscape I have to use: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY); imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED); can somebody explain why first code doesn't work in landscape?
0
11,628,160
07/24/2012 09:42:40
751,796
05/13/2011 05:21:27
1,586
65
SQL Server - Complains of a user that does not exist
I've specified the user of my application pool to be SERVER4\IUSR_SERVER4. And then I added this user to the SQL Server. But when I try to connect to the database I get the following error: Server Error in '/BSHHD' Application. Cannot open user default database. Login failed. Login failed for user 'SERVER4\Administrator'. What's driving me mad is there's no user named SERVER4\Administrator. What do I have to do in order to be able to properly connect to this SQL Server database from my website?
sql-server-2008
iis
null
null
null
null
open
SQL Server - Complains of a user that does not exist === I've specified the user of my application pool to be SERVER4\IUSR_SERVER4. And then I added this user to the SQL Server. But when I try to connect to the database I get the following error: Server Error in '/BSHHD' Application. Cannot open user default database. Login failed. Login failed for user 'SERVER4\Administrator'. What's driving me mad is there's no user named SERVER4\Administrator. What do I have to do in order to be able to properly connect to this SQL Server database from my website?
0
11,628,161
07/24/2012 09:42:45
1,548,211
07/24/2012 09:32:34
1
0
sencha touch :Trying to add a null item as a child of Container with itemId/id: ext-comp-1050
I am new to Sencha Touch. I have an existing web app that I have to enhance. I created a new panel and trying add to items of an existing panel but getting en error Trying to add a null item as a child of Container with itemId/id: ext-comp-1050 my code is as follows Myapp.views.mainView = new Ext.extend(Ext.Panel, { initComponent: function(){ this.items = [ Myapp.views.welcomePanel, // new panel I am trying to add Myapp.views.settingsView, Myapp.views.placePopup, Myapp.views.newsPanel ]; this.dockedItems = []; this.cardAnimation='slide'; this.html = null; this.fullscreen = true; this.layout = 'card'; this.align = 'stretch'; Myapp.views.mainView.superclass.initComponent.call(this); } }); and the code of welcome panel is Myapp.views.welcomePanel = new Ext.Panel({ frame:true, autoHeight:true, collapsible:true, layout:'card', items:[ Myapp.views.mapPlaces, Myapp.views.listOfPlaces ], dockedItems:[ Myapp.views.mainToolBar, Myapp.views.changerPanelsToolbar ] }); Myapp.views.mapPlaces,Myapp.views.listOfPlaces,Myapp.views.mainToolBar,Myapp.views.changerPanelsToolbar are pre-existing & working without problem Please help
sencha-touch
null
null
null
null
null
open
sencha touch :Trying to add a null item as a child of Container with itemId/id: ext-comp-1050 === I am new to Sencha Touch. I have an existing web app that I have to enhance. I created a new panel and trying add to items of an existing panel but getting en error Trying to add a null item as a child of Container with itemId/id: ext-comp-1050 my code is as follows Myapp.views.mainView = new Ext.extend(Ext.Panel, { initComponent: function(){ this.items = [ Myapp.views.welcomePanel, // new panel I am trying to add Myapp.views.settingsView, Myapp.views.placePopup, Myapp.views.newsPanel ]; this.dockedItems = []; this.cardAnimation='slide'; this.html = null; this.fullscreen = true; this.layout = 'card'; this.align = 'stretch'; Myapp.views.mainView.superclass.initComponent.call(this); } }); and the code of welcome panel is Myapp.views.welcomePanel = new Ext.Panel({ frame:true, autoHeight:true, collapsible:true, layout:'card', items:[ Myapp.views.mapPlaces, Myapp.views.listOfPlaces ], dockedItems:[ Myapp.views.mainToolBar, Myapp.views.changerPanelsToolbar ] }); Myapp.views.mapPlaces,Myapp.views.listOfPlaces,Myapp.views.mainToolBar,Myapp.views.changerPanelsToolbar are pre-existing & working without problem Please help
0
11,628,073
07/24/2012 09:37:04
1,548,183
07/24/2012 09:24:51
1
0
Facebook Integration Session Issue
Here is my UserLogin.aspx Page code, which contains authentication of Facebook user, the problem is i am maintaing token in session which i laterly use it on Default.aspx. if you see the line Session["facebook_token"] = authToken; On my Default.aspx page load i have placed this code, but it gives me null value, when i go to home or default page. if (Session["facebook_token"] != null) lblUserName.Text = Session["facebook_token"].ToString(); using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using SocialMediaModel; using Facebook.Components; public partial class UserLogin : System.Web.UI.Page { FacebookService _fbService = new FacebookService(); private const string FACEBOOK_API_KEY = "551810942508804"; private const string FACEBOOK_SECRET = "b63b8cca428b42935e6eab59976367b1"; protected void Page_Load(object sender, EventArgs e) { // ApplicationKey and Secret are acquired when you sign up for _fbService.ApplicationKey = FACEBOOK_API_KEY; _fbService.Secret = FACEBOOK_SECRET; _fbService.IsDesktopApplication = false; string sessionKey = Session["facebook_session_key"] as String; string userId = Session["facebook_userId"] as String; string authToken = Request.QueryString["auth_token"]; Session["facebook_token"] = authToken; // We have already established a session on behalf of this user if (!String.IsNullOrEmpty(sessionKey)) { _fbService.SessionKey = sessionKey; _fbService.UserId = userId; } // This will be executed when facebook login redirects to our page else if (!String.IsNullOrEmpty(authToken)) { _fbService.CreateSession(authToken); Session["facebook_session_key"] = _fbService.SessionKey; Session["facebook_userId"] = _fbService.UserId; Session["facebook_session_expires"] = _fbService.SessionExpires; } // Need to login else { Response.Redirect(@"http://www.facebook.com/login.php?api_key=" + _fbService.ApplicationKey + @"&v=1.0"); } } }
facebook
null
null
null
null
null
open
Facebook Integration Session Issue === Here is my UserLogin.aspx Page code, which contains authentication of Facebook user, the problem is i am maintaing token in session which i laterly use it on Default.aspx. if you see the line Session["facebook_token"] = authToken; On my Default.aspx page load i have placed this code, but it gives me null value, when i go to home or default page. if (Session["facebook_token"] != null) lblUserName.Text = Session["facebook_token"].ToString(); using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using SocialMediaModel; using Facebook.Components; public partial class UserLogin : System.Web.UI.Page { FacebookService _fbService = new FacebookService(); private const string FACEBOOK_API_KEY = "551810942508804"; private const string FACEBOOK_SECRET = "b63b8cca428b42935e6eab59976367b1"; protected void Page_Load(object sender, EventArgs e) { // ApplicationKey and Secret are acquired when you sign up for _fbService.ApplicationKey = FACEBOOK_API_KEY; _fbService.Secret = FACEBOOK_SECRET; _fbService.IsDesktopApplication = false; string sessionKey = Session["facebook_session_key"] as String; string userId = Session["facebook_userId"] as String; string authToken = Request.QueryString["auth_token"]; Session["facebook_token"] = authToken; // We have already established a session on behalf of this user if (!String.IsNullOrEmpty(sessionKey)) { _fbService.SessionKey = sessionKey; _fbService.UserId = userId; } // This will be executed when facebook login redirects to our page else if (!String.IsNullOrEmpty(authToken)) { _fbService.CreateSession(authToken); Session["facebook_session_key"] = _fbService.SessionKey; Session["facebook_userId"] = _fbService.UserId; Session["facebook_session_expires"] = _fbService.SessionExpires; } // Need to login else { Response.Redirect(@"http://www.facebook.com/login.php?api_key=" + _fbService.ApplicationKey + @"&v=1.0"); } } }
0
11,628,074
07/24/2012 09:37:03
805,896
06/20/2011 01:52:07
303
1
How to make GIT ignore my changes
Although the title seems similar to previous questions, I could not find the solution to to my Simple case: -I committed to my branch 'ABCD' : `git commit -a .....` -Then decided to visit a previous commit so : `git checkout 2387687326487` -Here I made some changes which was for testing purpose only, and I don't want to keep them -I am done, I want to get back to my latest commit(again:ignoring changes whcih i made to the old commit) : the command `git checkout 'ABCD'` gives error: **Your local changes to the following files will be overwritten by checkout....please commit or stash...** while I don't want to commit or stash or whatever. I just want to go back home :) what should I do please? thank you
git
null
null
null
null
null
open
How to make GIT ignore my changes === Although the title seems similar to previous questions, I could not find the solution to to my Simple case: -I committed to my branch 'ABCD' : `git commit -a .....` -Then decided to visit a previous commit so : `git checkout 2387687326487` -Here I made some changes which was for testing purpose only, and I don't want to keep them -I am done, I want to get back to my latest commit(again:ignoring changes whcih i made to the old commit) : the command `git checkout 'ABCD'` gives error: **Your local changes to the following files will be overwritten by checkout....please commit or stash...** while I don't want to commit or stash or whatever. I just want to go back home :) what should I do please? thank you
0
11,387,382
07/08/2012 22:54:38
38,400
11/17/2008 23:05:58
338
9
Get posts from votes in Facebook questions
I have a single Facebook question object from which I'd like to get all the posts that were added along with user's votes (i.e: voted the "Yes" option with the comment "Of course"), using the Graph API (or any method that works, for that matter). I got as far as question > question_option > votes but that just give me the user's id/name, not the associated post. How could I do this?
facebook
facebook-graph-api
null
null
null
null
open
Get posts from votes in Facebook questions === I have a single Facebook question object from which I'd like to get all the posts that were added along with user's votes (i.e: voted the "Yes" option with the comment "Of course"), using the Graph API (or any method that works, for that matter). I got as far as question > question_option > votes but that just give me the user's id/name, not the associated post. How could I do this?
0
11,387,391
07/08/2012 22:56:39
973,017
09/30/2011 11:46:13
28
0
how to call different jquery actions in responsive design
I'm at the point to convert my project into an responsive design. What most handy and universal solution do you suggest to implement different jQuery-blocks for each breakpoint? I want to keep all scripts in one file cause of number of http-requests. That's what I've found: - [breakpoint.js][1] -> define all breakpoints doubled in CSS & JS - [http://responsejs.com/][2] -> define breakpoints in body data-attr - [OnMediaQuery][3] -> define human-readable names for the breakpoints (IMHO better, cause you're not bound to pixels) My problem is, they all define callbacks, but I don't know how to bind or cancel any jQuery eventlisteners in this cases. e.g. I have: $('#selector').click( function() { alert('selector clicked'); }); but that should only happen if in max-width of 320px. In screen-sizes above that the click should return false or perform any other action at the moment, I don't have a glue how to accomplish this. Please help me out. ;-) [1]: http://xoxco.com/projects/code/breakpoints/ [2]: http://responsejs.com/ [3]: http://www.springload.co.nz/love-the-web/responsive-javascript/
jquery
responsive-design
null
null
null
null
open
how to call different jquery actions in responsive design === I'm at the point to convert my project into an responsive design. What most handy and universal solution do you suggest to implement different jQuery-blocks for each breakpoint? I want to keep all scripts in one file cause of number of http-requests. That's what I've found: - [breakpoint.js][1] -> define all breakpoints doubled in CSS & JS - [http://responsejs.com/][2] -> define breakpoints in body data-attr - [OnMediaQuery][3] -> define human-readable names for the breakpoints (IMHO better, cause you're not bound to pixels) My problem is, they all define callbacks, but I don't know how to bind or cancel any jQuery eventlisteners in this cases. e.g. I have: $('#selector').click( function() { alert('selector clicked'); }); but that should only happen if in max-width of 320px. In screen-sizes above that the click should return false or perform any other action at the moment, I don't have a glue how to accomplish this. Please help me out. ;-) [1]: http://xoxco.com/projects/code/breakpoints/ [2]: http://responsejs.com/ [3]: http://www.springload.co.nz/love-the-web/responsive-javascript/
0
11,387,393
07/08/2012 22:56:59
836,910
07/09/2011 17:16:14
174
7
highlight div acorrding to click
i have five divs <div id="box1">content 1</div> <div id="box2">content 2</div> <div id="box3">content 3</div> <div id="box4">content 4</div> <div id="box5">content 5</div> each that is highlight accordingly when i click on a certain link <a class="light" id="1">link 1</a> <a class="light" id="2">link 2</a> <a class="light" id="3">link 3</a> <a class="light" id="4">link 4</a> <a class="light" id="5">link 5</a> this is my jquery $(".light").live("click", function(){ var id = $(this).attr('id'); $("box"+id).css({'background':'red'}); }); stuck at this point, i would like to dehighlight the previous box when i click on another link, and vice versa.
jquery
jquery-ajax
null
null
null
null
open
highlight div acorrding to click === i have five divs <div id="box1">content 1</div> <div id="box2">content 2</div> <div id="box3">content 3</div> <div id="box4">content 4</div> <div id="box5">content 5</div> each that is highlight accordingly when i click on a certain link <a class="light" id="1">link 1</a> <a class="light" id="2">link 2</a> <a class="light" id="3">link 3</a> <a class="light" id="4">link 4</a> <a class="light" id="5">link 5</a> this is my jquery $(".light").live("click", function(){ var id = $(this).attr('id'); $("box"+id).css({'background':'red'}); }); stuck at this point, i would like to dehighlight the previous box when i click on another link, and vice versa.
0
11,387,399
07/08/2012 22:57:58
1,125,298
01/01/2012 18:22:36
63
2
Monogame Linux crashes on launch
When launching a monogame game from Linux(Ubuntu 12.04), I get the following error in the console [Pastebin, formatting when pasted here wasn't worth fixing](http://pastebin.com/g2KpKNPp) This bug does not occur when I delay any logic from happening until a certain amount of gameTime has passed, but the amount of gameTime necessary constantly varies and is far too long. Is there any way to work around whatever this error message is?
ubuntu
mono
crash
monodevelop
monogame
null
open
Monogame Linux crashes on launch === When launching a monogame game from Linux(Ubuntu 12.04), I get the following error in the console [Pastebin, formatting when pasted here wasn't worth fixing](http://pastebin.com/g2KpKNPp) This bug does not occur when I delay any logic from happening until a certain amount of gameTime has passed, but the amount of gameTime necessary constantly varies and is far too long. Is there any way to work around whatever this error message is?
0
11,386,893
07/08/2012 21:33:54
1,118,919
12/28/2011 08:04:43
755
25
How to add dynamic Spinner's as well as remove them?
My question revolves around reminder `Spinner`'s. I am trying to allow the user to add at maximum, 5 reminders. But I also don't want to show all five. These reminders are each `Spinner`'s which have multiple choices. When the user clicks to add a reminder, it will do so. When they want to take one away, they can do that as well, and when they want to add another one, the new one appears at the bottom. Any idea of how to go about this? My original implementation was to have 5 already defined (4 "gone"), but then if the user wants to add one, it becomes "visible". Problem with that is that if you take away a reminder from the view by making it "gone", and add it back, it does not apear at the bottom, but rather back where it originally was (unless it was already the last spinner). Now I am lost as to how to dynamically add spinners specifically under certain views. Any ideas would be much appreciated!
android
dynamic
android-spinner
reminders
null
null
open
How to add dynamic Spinner's as well as remove them? === My question revolves around reminder `Spinner`'s. I am trying to allow the user to add at maximum, 5 reminders. But I also don't want to show all five. These reminders are each `Spinner`'s which have multiple choices. When the user clicks to add a reminder, it will do so. When they want to take one away, they can do that as well, and when they want to add another one, the new one appears at the bottom. Any idea of how to go about this? My original implementation was to have 5 already defined (4 "gone"), but then if the user wants to add one, it becomes "visible". Problem with that is that if you take away a reminder from the view by making it "gone", and add it back, it does not apear at the bottom, but rather back where it originally was (unless it was already the last spinner). Now I am lost as to how to dynamically add spinners specifically under certain views. Any ideas would be much appreciated!
0
11,350,112
07/05/2012 18:12:51
907,714
08/23/2011 12:35:46
39
6
Initializing 2d vector as class variable C++
I'm building a class where the one variable is a 2d vector. How do I set it so I have an initial size? I tried the below but get an error, expected ‘,’ or ‘...’ before numeric constant. Plus I get errors for every line where i try to set a value to pncode, invalid types ‘<unresolved overloaded function type>[int]’ for array subscript. Here's the class: #ifndef POSTNET_H_ #define POSTNET_H_ #include <iostream> #include <cstdlib> #include <string> #include <vector> using namespace std; class postnet { private: vector<vector<int>> pncode(5, vector<int>(5)); void encode(vector<int> zip) { for(int i = 0; i < 5; i++) { if(zip[i] == 1 || zip[i] == 2 || zip[i] == 3 || zip[i] == 4 || zip[i] == 5 || zip[i] == 6) pncode[i][0] = 0; else pncode[i][0] = 1; if(zip[i] == 1 || zip[i] == 2 || zip[i] == 3 || zip[i] == 7 || zip[i] == 8 || zip[i] == 9) pncode[i][1] = 0; else pncode[i][1] = 1; if(zip[i] == 1 || zip[i] == 4 || zip[i] == 5 || zip[i] == 7 || zip[i] == 8 || zip[i] == 0) pncode[i][0] = 0; else pncode[i][0] = 1; if(zip[i] == 2 || zip[i] == 4 || zip[i] == 6 || zip[i] == 7 || zip[i] == 9 || zip[i] == 0) pncode[i][0] = 0; else pncode[i][0] = 1; if(zip[i] == 3 || zip[i] == 5 || zip[i] == 6 || zip[i] == 8 || zip[i] == 9 || zip[i] == 0) pncode[i][0] = 0; else pncode[i][0] = 1; } } void decode(vector<int> zip) { int zipd[5]; for(int i = 0; i < 5; i++) { zipd[0] = pncode[i][0] * 7; zipd[1] = pncode[i][1] * 4; zipd[2] = pncode[i][2] * 2; zipd[3] = pncode[i][3] * 1; zipd[4] = pncode[i][4] * 0; for(int j = 0; j < 5; j++) { zip[i] += zipd[j]; } if(zip[i] == 11) zip[i] = 0; } } public: postnet() { for(int i = 0; i < 5; i++) for(int j = 0; j < 5; j++) pncode[i][j] = 0; } postnet(vector<int> zip) { encode(zip); } postnet(vector<vector<int> > pnc) { for(int i = 0; i < 5; i++) for(int j = 0; j < 5; j++) pncode[i][j] = pnc[i][j]; } void print_zip() { vector<int> zipc(5); decode(zipc); for(int i = 0; i < 5; i++) cout << zipc[i]; cout << endl; } void print_pncode() { cout << "1"; for(int i = 0; i < 5; i++) for(int j = 0; j < 5; j++) cout << pncode[i][j]; cout << "1" << endl; } }; #endif /* POSTNET_H_ */
c++
class
vector
null
null
null
open
Initializing 2d vector as class variable C++ === I'm building a class where the one variable is a 2d vector. How do I set it so I have an initial size? I tried the below but get an error, expected ‘,’ or ‘...’ before numeric constant. Plus I get errors for every line where i try to set a value to pncode, invalid types ‘<unresolved overloaded function type>[int]’ for array subscript. Here's the class: #ifndef POSTNET_H_ #define POSTNET_H_ #include <iostream> #include <cstdlib> #include <string> #include <vector> using namespace std; class postnet { private: vector<vector<int>> pncode(5, vector<int>(5)); void encode(vector<int> zip) { for(int i = 0; i < 5; i++) { if(zip[i] == 1 || zip[i] == 2 || zip[i] == 3 || zip[i] == 4 || zip[i] == 5 || zip[i] == 6) pncode[i][0] = 0; else pncode[i][0] = 1; if(zip[i] == 1 || zip[i] == 2 || zip[i] == 3 || zip[i] == 7 || zip[i] == 8 || zip[i] == 9) pncode[i][1] = 0; else pncode[i][1] = 1; if(zip[i] == 1 || zip[i] == 4 || zip[i] == 5 || zip[i] == 7 || zip[i] == 8 || zip[i] == 0) pncode[i][0] = 0; else pncode[i][0] = 1; if(zip[i] == 2 || zip[i] == 4 || zip[i] == 6 || zip[i] == 7 || zip[i] == 9 || zip[i] == 0) pncode[i][0] = 0; else pncode[i][0] = 1; if(zip[i] == 3 || zip[i] == 5 || zip[i] == 6 || zip[i] == 8 || zip[i] == 9 || zip[i] == 0) pncode[i][0] = 0; else pncode[i][0] = 1; } } void decode(vector<int> zip) { int zipd[5]; for(int i = 0; i < 5; i++) { zipd[0] = pncode[i][0] * 7; zipd[1] = pncode[i][1] * 4; zipd[2] = pncode[i][2] * 2; zipd[3] = pncode[i][3] * 1; zipd[4] = pncode[i][4] * 0; for(int j = 0; j < 5; j++) { zip[i] += zipd[j]; } if(zip[i] == 11) zip[i] = 0; } } public: postnet() { for(int i = 0; i < 5; i++) for(int j = 0; j < 5; j++) pncode[i][j] = 0; } postnet(vector<int> zip) { encode(zip); } postnet(vector<vector<int> > pnc) { for(int i = 0; i < 5; i++) for(int j = 0; j < 5; j++) pncode[i][j] = pnc[i][j]; } void print_zip() { vector<int> zipc(5); decode(zipc); for(int i = 0; i < 5; i++) cout << zipc[i]; cout << endl; } void print_pncode() { cout << "1"; for(int i = 0; i < 5; i++) for(int j = 0; j < 5; j++) cout << pncode[i][j]; cout << "1" << endl; } }; #endif /* POSTNET_H_ */
0
11,349,266
07/05/2012 17:15:30
627,473
03/01/2010 16:37:51
2,395
35
Core Data storage from remote data source
I am developing an iPhone app that gathers data from 3 separate feeds. In applicationDidFinishLaunching and applicationWillEnterForeground and Do the following: [self emptySchedule]; [self populateSchedule]; [self emptyPlayers]; [self populatePlayers]; [self emptyNews]; [self populateNews]; The empty methods simply remove info from core data, and the populate methods add info back to core data by calling various web json/xml feeds. It seems to do this very fast; but was wondering if this is the preferred method for keeping information up to date in the app.
ios
null
null
null
null
null
open
Core Data storage from remote data source === I am developing an iPhone app that gathers data from 3 separate feeds. In applicationDidFinishLaunching and applicationWillEnterForeground and Do the following: [self emptySchedule]; [self populateSchedule]; [self emptyPlayers]; [self populatePlayers]; [self emptyNews]; [self populateNews]; The empty methods simply remove info from core data, and the populate methods add info back to core data by calling various web json/xml feeds. It seems to do this very fast; but was wondering if this is the preferred method for keeping information up to date in the app.
0
11,349,267
07/05/2012 17:15:31
1,036,108
11/08/2011 17:17:01
1
0
Python SUDS unicode decode error returned from Webservice
I am attempting to use a Webservice created by one of our developers that allows us to upload files into the system, within certain restrictions. Using SUDS, I get the following information: Suds ( https://fedorahosted.org/suds/ ) version: 0.4 GA build: R699-20100913 Service ( ConnectToEFS ) tns="http://tempuri.org/" Prefixes (3) ns0 = "http://schemas.microsoft.com/2003/10/Serialization/" ns1 = "http://schemas.microsoft.com/Message" ns2 = "http://tempuri.org/" Ports (1): (BasicHttpBinding_IConnectToEFS) Methods (2): CreateContentFolder(xs:string FileCode, xs:string FolderName, xs:string ContentType, xs:string MetaDataXML, ) UploadFile(ns1:StreamBody FileByteStream, ) Types (4): ns1:StreamBody ns0:char ns0:duration ns0:guid My method to using UploadFile is as follows: def webserviceUploadFile(self, targetLocation, fileName, fileSource): fileSource = './test_files/' + fileSource ntlm = WindowsHttpAuthenticated(username=uname, password=upass) client = Client(webservice_url, transport=ntlm) client.set_options(soapheaders={'TargetLocation':targetLocation, 'FileName': fileName}) body = client.factory.create('AIRDocument') body_file = open(fileSource, 'rb') body_data = body_file.read() body.FileByteStream = body_data return client.service.UploadFile(body) Running this gets me the following result: Traceback (most recent call last): File "test_cases.py", line 639, in test_upload_file_invalid_extension result_string = self.HM.webserviceUploadFile('9999', 'AD-1234-5424__44.exe', 'test_data.pdf') File "test_cases.py", line 81, in webserviceUploadFile return client.service.UploadFile(body) File "build\bdist.win32\egg\suds\client.py", line 542, in __call__ return client.invoke(args, kwargs) File "build\bdist.win32\egg\suds\client.py", line 595, in invoke soapenv = binding.get_message(self.method, args, kwargs) File "build\bdist.win32\egg\suds\bindings\binding.py", line 120, in get_message content = self.bodycontent(method, args, kwargs) File "build\bdist.win32\egg\suds\bindings\document.py", line 63, in bodycontent p = self.mkparam(method, pd, value) File "build\bdist.win32\egg\suds\bindings\document.py", line 105, in mkparam return Binding.mkparam(self, method, pdef, object) File "build\bdist.win32\egg\suds\bindings\binding.py", line 287, in mkparam return marshaller.process(content) File "build\bdist.win32\egg\suds\mx\core.py", line 62, in process self.append(document, content) File "build\bdist.win32\egg\suds\mx\core.py", line 75, in append self.appender.append(parent, content) File "build\bdist.win32\egg\suds\mx\appender.py", line 102, in append appender.append(parent, content) File "build\bdist.win32\egg\suds\mx\appender.py", line 243, in append Appender.append(self, child, cont) File "build\bdist.win32\egg\suds\mx\appender.py", line 182, in append self.marshaller.append(parent, content) File "build\bdist.win32\egg\suds\mx\core.py", line 75, in append self.appender.append(parent, content) File "build\bdist.win32\egg\suds\mx\appender.py", line 102, in append appender.append(parent, content) File "build\bdist.win32\egg\suds\mx\appender.py", line 198, in append child.setText(tostr(content.value)) File "build\bdist.win32\egg\suds\sax\element.py", line 251, in setText self.text = Text(value) File "build\bdist.win32\egg\suds\sax\text.py", line 43, in __new__ result = super(Text, cls).__new__(cls, *args, **kwargs) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 10: ordinal not in range(128) After much research and talking with the developer of the webservice, I modified the body_data = body_file.read() into body_data = body_file.read().decode("UTF-8") which gets me this error: Traceback (most recent call last): File "test_cases.py", line 639, in test_upload_file_invalid_extension result_string = self.HM.webserviceUploadFile('9999', 'AD-1234-5424__44.exe', 'test_data.pdf') File "test_cases.py", line 79, in webserviceUploadFile body_data = body_file.read().decode("utf-8") File "C:\python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe2 in position 10: invalid continuation byte Which is less than helpful. After more research into the problem, I tried adding 'errors='ignore'' to the UTF-8 encode, and this was the result: <TransactionDescription>Error in INTL-CONF_France_PROJ_MA_126807.docx: An exception has been thrown when reading the stream.. Inner Exception: System.Xml.XmlException: The byte 0x03 is not valid at this location. Line 1, position 318. at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3) at System.Xml.XmlUTF8TextReader.Read() at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Exhaust(XmlDictionaryReader reader) at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count). Source: System.ServiceModel</TransactionDescription> Which pretty much stumps me on what to do. Based on the result stack trace by the webservice, it looks like it wants UTF-8 but I can't seem to get it to the webservice without Python or SUDS throwing a fit, or by ignoring problems in the encoding. The system I'm working on only takes in MicroSoft office type files (doc, xls, and the like), PDFs, and TXT files, so using something that I have more control on the encoding is not an option. I also tried detecting the encoding used by the sample PDF and the sample DOCX, but using what it suggested (Latin-1, ISO8859-x, and several windows XXXX) all were accepted by Python and SUDS, but not by the webservice. Also note in the example shown, its most frequently referencing a test to an invalid extension. This error applies even in what should be a test of the successful upload, which is the only time really that the final stacktrace ever shows up.
python
suds
null
null
null
null
open
Python SUDS unicode decode error returned from Webservice === I am attempting to use a Webservice created by one of our developers that allows us to upload files into the system, within certain restrictions. Using SUDS, I get the following information: Suds ( https://fedorahosted.org/suds/ ) version: 0.4 GA build: R699-20100913 Service ( ConnectToEFS ) tns="http://tempuri.org/" Prefixes (3) ns0 = "http://schemas.microsoft.com/2003/10/Serialization/" ns1 = "http://schemas.microsoft.com/Message" ns2 = "http://tempuri.org/" Ports (1): (BasicHttpBinding_IConnectToEFS) Methods (2): CreateContentFolder(xs:string FileCode, xs:string FolderName, xs:string ContentType, xs:string MetaDataXML, ) UploadFile(ns1:StreamBody FileByteStream, ) Types (4): ns1:StreamBody ns0:char ns0:duration ns0:guid My method to using UploadFile is as follows: def webserviceUploadFile(self, targetLocation, fileName, fileSource): fileSource = './test_files/' + fileSource ntlm = WindowsHttpAuthenticated(username=uname, password=upass) client = Client(webservice_url, transport=ntlm) client.set_options(soapheaders={'TargetLocation':targetLocation, 'FileName': fileName}) body = client.factory.create('AIRDocument') body_file = open(fileSource, 'rb') body_data = body_file.read() body.FileByteStream = body_data return client.service.UploadFile(body) Running this gets me the following result: Traceback (most recent call last): File "test_cases.py", line 639, in test_upload_file_invalid_extension result_string = self.HM.webserviceUploadFile('9999', 'AD-1234-5424__44.exe', 'test_data.pdf') File "test_cases.py", line 81, in webserviceUploadFile return client.service.UploadFile(body) File "build\bdist.win32\egg\suds\client.py", line 542, in __call__ return client.invoke(args, kwargs) File "build\bdist.win32\egg\suds\client.py", line 595, in invoke soapenv = binding.get_message(self.method, args, kwargs) File "build\bdist.win32\egg\suds\bindings\binding.py", line 120, in get_message content = self.bodycontent(method, args, kwargs) File "build\bdist.win32\egg\suds\bindings\document.py", line 63, in bodycontent p = self.mkparam(method, pd, value) File "build\bdist.win32\egg\suds\bindings\document.py", line 105, in mkparam return Binding.mkparam(self, method, pdef, object) File "build\bdist.win32\egg\suds\bindings\binding.py", line 287, in mkparam return marshaller.process(content) File "build\bdist.win32\egg\suds\mx\core.py", line 62, in process self.append(document, content) File "build\bdist.win32\egg\suds\mx\core.py", line 75, in append self.appender.append(parent, content) File "build\bdist.win32\egg\suds\mx\appender.py", line 102, in append appender.append(parent, content) File "build\bdist.win32\egg\suds\mx\appender.py", line 243, in append Appender.append(self, child, cont) File "build\bdist.win32\egg\suds\mx\appender.py", line 182, in append self.marshaller.append(parent, content) File "build\bdist.win32\egg\suds\mx\core.py", line 75, in append self.appender.append(parent, content) File "build\bdist.win32\egg\suds\mx\appender.py", line 102, in append appender.append(parent, content) File "build\bdist.win32\egg\suds\mx\appender.py", line 198, in append child.setText(tostr(content.value)) File "build\bdist.win32\egg\suds\sax\element.py", line 251, in setText self.text = Text(value) File "build\bdist.win32\egg\suds\sax\text.py", line 43, in __new__ result = super(Text, cls).__new__(cls, *args, **kwargs) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 10: ordinal not in range(128) After much research and talking with the developer of the webservice, I modified the body_data = body_file.read() into body_data = body_file.read().decode("UTF-8") which gets me this error: Traceback (most recent call last): File "test_cases.py", line 639, in test_upload_file_invalid_extension result_string = self.HM.webserviceUploadFile('9999', 'AD-1234-5424__44.exe', 'test_data.pdf') File "test_cases.py", line 79, in webserviceUploadFile body_data = body_file.read().decode("utf-8") File "C:\python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe2 in position 10: invalid continuation byte Which is less than helpful. After more research into the problem, I tried adding 'errors='ignore'' to the UTF-8 encode, and this was the result: <TransactionDescription>Error in INTL-CONF_France_PROJ_MA_126807.docx: An exception has been thrown when reading the stream.. Inner Exception: System.Xml.XmlException: The byte 0x03 is not valid at this location. Line 1, position 318. at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3) at System.Xml.XmlUTF8TextReader.Read() at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Exhaust(XmlDictionaryReader reader) at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count). Source: System.ServiceModel</TransactionDescription> Which pretty much stumps me on what to do. Based on the result stack trace by the webservice, it looks like it wants UTF-8 but I can't seem to get it to the webservice without Python or SUDS throwing a fit, or by ignoring problems in the encoding. The system I'm working on only takes in MicroSoft office type files (doc, xls, and the like), PDFs, and TXT files, so using something that I have more control on the encoding is not an option. I also tried detecting the encoding used by the sample PDF and the sample DOCX, but using what it suggested (Latin-1, ISO8859-x, and several windows XXXX) all were accepted by Python and SUDS, but not by the webservice. Also note in the example shown, its most frequently referencing a test to an invalid extension. This error applies even in what should be a test of the successful upload, which is the only time really that the final stacktrace ever shows up.
0
11,350,116
07/05/2012 18:13:16
1,392,902
05/14/2012 02:56:31
1
0
Asus "Republic of Gamers" G60JX USB Port issue
I have an Asus G60JX, the 2010 (ish) addition. About a year ago the USB ports stopped working on it entirely. One of them has physical damage but the other 3 are undamaged. At first I just assumed that I had shorted out the USB hub and figured I'd have to replace the mobo to fix the problem but a few weeks ago I took the thing apart to replace the thermal paste on the video card and found that the USB ports on the left are attached to the mobo by a PCI ribbon, the same one that connects the audio ports which work just fine. The webcam that is also attached to the base USB hub also works fine. I tried reinstalling and updating all the USB drivers and the chipset drivers and the ports still don't work. The ones on the left (the PCI ribbon ports) have power but not data, they don't recognize any devices when plugged in but will charge my ipod with no problem. Doesn't anyone know of a similar problem and a possible solution to it? Any help would be appreciated I'd really like at least one or two ports back.
usb
null
null
null
null
07/05/2012 18:48:32
off topic
Asus "Republic of Gamers" G60JX USB Port issue === I have an Asus G60JX, the 2010 (ish) addition. About a year ago the USB ports stopped working on it entirely. One of them has physical damage but the other 3 are undamaged. At first I just assumed that I had shorted out the USB hub and figured I'd have to replace the mobo to fix the problem but a few weeks ago I took the thing apart to replace the thermal paste on the video card and found that the USB ports on the left are attached to the mobo by a PCI ribbon, the same one that connects the audio ports which work just fine. The webcam that is also attached to the base USB hub also works fine. I tried reinstalling and updating all the USB drivers and the chipset drivers and the ports still don't work. The ones on the left (the PCI ribbon ports) have power but not data, they don't recognize any devices when plugged in but will charge my ipod with no problem. Doesn't anyone know of a similar problem and a possible solution to it? Any help would be appreciated I'd really like at least one or two ports back.
2
11,350,118
07/05/2012 18:13:25
1,466,389
06/19/2012 12:19:43
6
1
Drawing a GDI Bitmap to a OpenGL display using OpenTK
After searching my butt off I continuously keep finding the opposite of what I am trying to do: A process to convert a GDI bitmap in realtime to a usable resource in OpenTK - were the Bitmap in question is tha actual frame itself - needs to be rendered to the display. To start off ill explain what I have at the moment - why I want to use a GL based output for it. Hopefully this shows my intentions. I have a class that splits a rendering process into two threads for Renderloop Based GDI rendering, involving the use of Stacks inbetween to store th completed frames (GDIBitmaps) The process as a basic explanation is [ in a form of pseudo code ]: :: Drawing Thread: r_BackBufferLoop r_BeginFrame-->r_EndFrame-->Push-->[STACK] r_IsStackFull -- [STACK] ^-do r_FlipStack -->[STACK].POP-->PUSHTO:[REVERSED_STACK] r_TrimStack :: Removes excess old frames -- The above ensures the newest frame is at the top of the stack for the viewport update: :: Update Thread (updates the display): :: get the frame r_UpdateThread -->Bitmap = [REVERSED_STACK].COUNT ? < 1 --> [STACK].POP OR Bitmap = [REVERSED_STACK].POP G_TARGET.DrawImageUnscaled(Bitmap,X,Y) At the moment this mechanism uses threaded processing. - Memory Bitmap is rendered to on Thread 1 - Bitmap is pushed to top of stack - If stack is full entire stack is pushed (target.push(source.pop)) to Reversed Stack in order to put newest frames at the front. - Display is Updated on Thread 2, by popping a bitmap from reversed stack and drawing it to display. In the current system: - Backbuffer rendered at over 500 FPS using one drawing suface and memory bitmap without restrictions and very efficient memory management - no more than 10 objects in stack. - Backbuffer renders 10 simulated layers - which are compiled to one layer for stack. - backbuffer is now restricted so it matches FPS with display output - which caps at 80FPS - Display using DrawImageUnscaled updates no faster than 80FPS(800X600 display area) on my dual core PC. When maximized to 1440X900 update slows to about 20-30FPS This is intended for Software Rendering mode. Heavy preprocessing for effects and such take place long before the loop starts (some during loading) - and others using design tools. I achieved this with VB.Net. I want to keep the existing backbuffer/stack/thread solution because it works bloody well. But I want to use OpenGL (OpenTK) for updating the display to get past the slow rendering of DrawImageUnscaled with larger sized bitmaps. This is were my problem begins. I need good FPS while maximized. I have almost no experience with OpenGL, OpenTK, DirectX - whatever. After searching around it felt as though OpenTK would be the quickest solution. Getting OpenTK setup ready to go was easy. I got my display working - found examples for rendering "as 2D", but then I ran into a wall. I need to take a GDI Bitmap from the Reverse Stack (pop) and draw it as a frame using OpenTK. I struggled to find any discussion, or document anywere that explains how I would be able to pull this off. The process for Converting a bitmap to Texture would be placed on the backbuffer thread since there is plently of speed there and could replace Bitmaps in the stacks. The stacks are threadsafe and can be accessed by both threads at the same time. I could not find any reference on how I could convert a GDIBitmap to a usable resource in OpenTK/OpenGL in memory/realtime. Only how to reverse the process. I would like the GDI Bitmap and converted to be used as a full Frame in openTK and output to a viewport with aimer of higher viewport FPS. This is the only thing I need OpenTK for. Alot of OpenTK examples I have seen lack documentation in their code. If code is suggested please ensure it is commented to explain exactly what is happening. I have no code to show this time because I couldn't figure out were to start after google failed me. Explanations in C# or VB can be understood. I assume I would be using a FBO for this?
vb.net
c#-4.0
opengl
opentk
null
null
open
Drawing a GDI Bitmap to a OpenGL display using OpenTK === After searching my butt off I continuously keep finding the opposite of what I am trying to do: A process to convert a GDI bitmap in realtime to a usable resource in OpenTK - were the Bitmap in question is tha actual frame itself - needs to be rendered to the display. To start off ill explain what I have at the moment - why I want to use a GL based output for it. Hopefully this shows my intentions. I have a class that splits a rendering process into two threads for Renderloop Based GDI rendering, involving the use of Stacks inbetween to store th completed frames (GDIBitmaps) The process as a basic explanation is [ in a form of pseudo code ]: :: Drawing Thread: r_BackBufferLoop r_BeginFrame-->r_EndFrame-->Push-->[STACK] r_IsStackFull -- [STACK] ^-do r_FlipStack -->[STACK].POP-->PUSHTO:[REVERSED_STACK] r_TrimStack :: Removes excess old frames -- The above ensures the newest frame is at the top of the stack for the viewport update: :: Update Thread (updates the display): :: get the frame r_UpdateThread -->Bitmap = [REVERSED_STACK].COUNT ? < 1 --> [STACK].POP OR Bitmap = [REVERSED_STACK].POP G_TARGET.DrawImageUnscaled(Bitmap,X,Y) At the moment this mechanism uses threaded processing. - Memory Bitmap is rendered to on Thread 1 - Bitmap is pushed to top of stack - If stack is full entire stack is pushed (target.push(source.pop)) to Reversed Stack in order to put newest frames at the front. - Display is Updated on Thread 2, by popping a bitmap from reversed stack and drawing it to display. In the current system: - Backbuffer rendered at over 500 FPS using one drawing suface and memory bitmap without restrictions and very efficient memory management - no more than 10 objects in stack. - Backbuffer renders 10 simulated layers - which are compiled to one layer for stack. - backbuffer is now restricted so it matches FPS with display output - which caps at 80FPS - Display using DrawImageUnscaled updates no faster than 80FPS(800X600 display area) on my dual core PC. When maximized to 1440X900 update slows to about 20-30FPS This is intended for Software Rendering mode. Heavy preprocessing for effects and such take place long before the loop starts (some during loading) - and others using design tools. I achieved this with VB.Net. I want to keep the existing backbuffer/stack/thread solution because it works bloody well. But I want to use OpenGL (OpenTK) for updating the display to get past the slow rendering of DrawImageUnscaled with larger sized bitmaps. This is were my problem begins. I need good FPS while maximized. I have almost no experience with OpenGL, OpenTK, DirectX - whatever. After searching around it felt as though OpenTK would be the quickest solution. Getting OpenTK setup ready to go was easy. I got my display working - found examples for rendering "as 2D", but then I ran into a wall. I need to take a GDI Bitmap from the Reverse Stack (pop) and draw it as a frame using OpenTK. I struggled to find any discussion, or document anywere that explains how I would be able to pull this off. The process for Converting a bitmap to Texture would be placed on the backbuffer thread since there is plently of speed there and could replace Bitmaps in the stacks. The stacks are threadsafe and can be accessed by both threads at the same time. I could not find any reference on how I could convert a GDIBitmap to a usable resource in OpenTK/OpenGL in memory/realtime. Only how to reverse the process. I would like the GDI Bitmap and converted to be used as a full Frame in openTK and output to a viewport with aimer of higher viewport FPS. This is the only thing I need OpenTK for. Alot of OpenTK examples I have seen lack documentation in their code. If code is suggested please ensure it is commented to explain exactly what is happening. I have no code to show this time because I couldn't figure out were to start after google failed me. Explanations in C# or VB can be understood. I assume I would be using a FBO for this?
0
11,350,124
07/05/2012 18:13:57
1,284,151
03/21/2012 18:07:35
22
0
Get Adsense revenue on Android
I'm new to android dev. I'm currently try to implement app, querying adsense revenue. I found [AdSense Management API v1.1 (Rev. 18) 1.7.2-beta][1]. The question is: is it possible to get revenue with API browser key and are there any samples (as there is no samples in this library)? [1]: http://javadoc.google-api-java-client.googlecode.com/hg/apis/adsense/v1.1/index.html
android
google-api
null
null
null
null
open
Get Adsense revenue on Android === I'm new to android dev. I'm currently try to implement app, querying adsense revenue. I found [AdSense Management API v1.1 (Rev. 18) 1.7.2-beta][1]. The question is: is it possible to get revenue with API browser key and are there any samples (as there is no samples in this library)? [1]: http://javadoc.google-api-java-client.googlecode.com/hg/apis/adsense/v1.1/index.html
0
11,350,128
07/05/2012 18:14:18
1,212,167
02/15/2012 18:53:25
19
0
Don't find an activity on AndroidManifest
Good afternoon, I have an activity that calls another. The code is as follows: Intent i = new Intent(getApplicationContext(),Menu.class); startActivity(i); When I run the application get the following error: **android.content.ActivityNotFoundException: Unable to find explicit activity class {proyecto.uvigo/android.view.Menu}; have you declared this activity in your AndroidManifest.xml?** I do not understand what is wrong because I have already stated, the Activity Menu on the AndroidManifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="proyecto.uvigo" android:versionCode="1" android:versionName="1.0"> <uses-permission android:name="android.permission.INTERNET" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Inicio" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <uses-permission android:name="android.permission.INTERNET" /> <activity android:name=".Login"></activity> <activity android:name=".Menu"></activity> <activity android:name=".RecuperarPass"></activity> <activity android:name=".Auxiliar"></activity> <activity android:name=".MiPerfil"></activity> <activity android:name=".CambiarPass"></activity> </application> </manifest> Thanks!
android
null
null
null
null
null
open
Don't find an activity on AndroidManifest === Good afternoon, I have an activity that calls another. The code is as follows: Intent i = new Intent(getApplicationContext(),Menu.class); startActivity(i); When I run the application get the following error: **android.content.ActivityNotFoundException: Unable to find explicit activity class {proyecto.uvigo/android.view.Menu}; have you declared this activity in your AndroidManifest.xml?** I do not understand what is wrong because I have already stated, the Activity Menu on the AndroidManifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="proyecto.uvigo" android:versionCode="1" android:versionName="1.0"> <uses-permission android:name="android.permission.INTERNET" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Inicio" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <uses-permission android:name="android.permission.INTERNET" /> <activity android:name=".Login"></activity> <activity android:name=".Menu"></activity> <activity android:name=".RecuperarPass"></activity> <activity android:name=".Auxiliar"></activity> <activity android:name=".MiPerfil"></activity> <activity android:name=".CambiarPass"></activity> </application> </manifest> Thanks!
0
11,350,129
07/05/2012 18:14:19
217,586
11/24/2009 06:23:00
1,561
66
Obtaining applications enlisted in force quit window
I am trying to retrieve all applications which are enlisted in force quit window. When I am using runningAppications method using below line of code: [[NSWorkspace sharedWorkspace] runningApplications]; It is enlisting many extra applications which are not enlisted in force quit window. Can any one suggest me some way to achieve it?
cocoa
nsrunningapplication
null
null
null
null
open
Obtaining applications enlisted in force quit window === I am trying to retrieve all applications which are enlisted in force quit window. When I am using runningAppications method using below line of code: [[NSWorkspace sharedWorkspace] runningApplications]; It is enlisting many extra applications which are not enlisted in force quit window. Can any one suggest me some way to achieve it?
0
11,350,131
07/05/2012 18:14:24
1,462,288
06/17/2012 19:35:15
1
0
Typo3 tx_comments multiple include
I include the extension "tx_comments" multiple times on an page. The StoragePid from each element are different. When i press the submit button from one comment-include, each comment-include will submit the message. is there any way to separate this?
extension
typo3
null
null
null
null
open
Typo3 tx_comments multiple include === I include the extension "tx_comments" multiple times on an page. The StoragePid from each element are different. When i press the submit button from one comment-include, each comment-include will submit the message. is there any way to separate this?
0
11,650,649
07/25/2012 13:19:31
31,762
10/27/2008 11:10:34
3,569
164
Can't read Excel 2010 xltm spreadsheet files programatically
I have some existing C# which reads *.xlsm spreadsheets into Excel 2010. When I save as the spreadsheet from within Excel 2010 to a xltm file selecting the format "Excel Macro-Enabled Template (*xltm) from the "save As" dialog. The resultant file double clicks and launches in Excel. As it is a template you get a copy of the file as you should, everything works correctly. If I try and load the xlsm template file using code like: using Microsoft.Office.Interop.Excel; // blah.... Excel._Workbook workbook = _applicationHandle.Workbooks.Add(fullFilename); // or Excel._Workbook workbook = _applicationHandle.Workbooks._Open(fullFilename, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval); I get the following error: Excel cannot open the file 'RiskStationCal.xltm' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file. Maybe the Microsoft APIs can't read template spreadsheets?
c#
excel-2010
null
null
null
null
open
Can't read Excel 2010 xltm spreadsheet files programatically === I have some existing C# which reads *.xlsm spreadsheets into Excel 2010. When I save as the spreadsheet from within Excel 2010 to a xltm file selecting the format "Excel Macro-Enabled Template (*xltm) from the "save As" dialog. The resultant file double clicks and launches in Excel. As it is a template you get a copy of the file as you should, everything works correctly. If I try and load the xlsm template file using code like: using Microsoft.Office.Interop.Excel; // blah.... Excel._Workbook workbook = _applicationHandle.Workbooks.Add(fullFilename); // or Excel._Workbook workbook = _applicationHandle.Workbooks._Open(fullFilename, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval); I get the following error: Excel cannot open the file 'RiskStationCal.xltm' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file. Maybe the Microsoft APIs can't read template spreadsheets?
0
11,650,650
07/25/2012 13:19:32
487,534
10/26/2010 11:18:57
1,513
82
Locking JPA entity hierarchy being updated massively from MDB's in cluster
I need some help in the following situation: imagine a hierarchy of `Job` entities that have a `progress` attribute. Some jobs consist of multiple subjobs making a job tree. The progress of these composite jobs is calculated from their subjobs. The bottom jobs progresses are updated periodically and then the whole tree's progress is recalculated bottom-up. Job progresses are updated via JMS messages received. In this case the job is fetched via JPA from the database and the progress is modified and a recursive recalculation is started. How should I deal with locking if this runs in a cluster? I would like to avoid situations when two subjobs are updated from 0% to 100% and the parent job goes to 50% instead of 100% as both the updates see 0%, 100% and vica versa. My first thought was using synchronization on the job objects. But this is not ok, because multiple runtime objects may represent the same record in the database. Could you suggest me a good and efficient way to handle this situation?
java
jpa
concurrency
locking
null
null
open
Locking JPA entity hierarchy being updated massively from MDB's in cluster === I need some help in the following situation: imagine a hierarchy of `Job` entities that have a `progress` attribute. Some jobs consist of multiple subjobs making a job tree. The progress of these composite jobs is calculated from their subjobs. The bottom jobs progresses are updated periodically and then the whole tree's progress is recalculated bottom-up. Job progresses are updated via JMS messages received. In this case the job is fetched via JPA from the database and the progress is modified and a recursive recalculation is started. How should I deal with locking if this runs in a cluster? I would like to avoid situations when two subjobs are updated from 0% to 100% and the parent job goes to 50% instead of 100% as both the updates see 0%, 100% and vica versa. My first thought was using synchronization on the job objects. But this is not ok, because multiple runtime objects may represent the same record in the database. Could you suggest me a good and efficient way to handle this situation?
0
11,650,653
07/25/2012 13:19:39
1,493,270
06/30/2012 16:38:00
1
0
I need to implement a linerlayout in android and populate with a list of items. I am doing so because i want the list to be non scrollable?
final LinearLayout l = (LinearLayout) findViewById(R.id.linearlist); public void onTextChanged(CharSequence s, int start, int before, int count) { textlength = et.getText().length(); array_sort.clear(); for (i = 0; i < namelist.length; i++) { if (textlength <= namelist[i].length()) { if (et.getText() .toString() .equalsIgnoreCase( (String) namelist[i].subSequence(0, textlength))) { array_sort.add(namelist[i]); if (et.getText().length() == 0) { // array_sort.remove(namelist[i]); array_sort.clear();
android-layout
null
null
null
null
null
open
I need to implement a linerlayout in android and populate with a list of items. I am doing so because i want the list to be non scrollable? === final LinearLayout l = (LinearLayout) findViewById(R.id.linearlist); public void onTextChanged(CharSequence s, int start, int before, int count) { textlength = et.getText().length(); array_sort.clear(); for (i = 0; i < namelist.length; i++) { if (textlength <= namelist[i].length()) { if (et.getText() .toString() .equalsIgnoreCase( (String) namelist[i].subSequence(0, textlength))) { array_sort.add(namelist[i]); if (et.getText().length() == 0) { // array_sort.remove(namelist[i]); array_sort.clear();
0
11,650,663
07/25/2012 13:20:07
1,545,394
07/23/2012 09:06:24
1
0
Python delete row in numpy array
I have a large numpy array (8 by 30000) and I want to delete some rows according to some criteria. This criteria is only applicable in one column. Example: >>> p = np.array([[0, 1, 3], [1 , 5, 6], [4, 3, 56], [1, 34, 4]]) >>> p array([[ 0, 1, 3], [ 1, 5, 6], [ 4, 3, 56], [ 1, 34, 4]]) here I would like to remove every row in which the value of the 3rd column is >30, ie. here row 3. As the array is pretty large, I'd like to avoid `for` loops. I thought of this: >>> a[~(a>30).any(1), :] array([[0, 1, 3], [1, 5, 6]]) But there, it obviously removes the two last rows. Any ideas on how to do that in a efficient way ? Cheers, -J
python
multidimensional-array
numpy
null
null
null
open
Python delete row in numpy array === I have a large numpy array (8 by 30000) and I want to delete some rows according to some criteria. This criteria is only applicable in one column. Example: >>> p = np.array([[0, 1, 3], [1 , 5, 6], [4, 3, 56], [1, 34, 4]]) >>> p array([[ 0, 1, 3], [ 1, 5, 6], [ 4, 3, 56], [ 1, 34, 4]]) here I would like to remove every row in which the value of the 3rd column is >30, ie. here row 3. As the array is pretty large, I'd like to avoid `for` loops. I thought of this: >>> a[~(a>30).any(1), :] array([[0, 1, 3], [1, 5, 6]]) But there, it obviously removes the two last rows. Any ideas on how to do that in a efficient way ? Cheers, -J
0
11,650,675
07/25/2012 13:20:30
1,041,742
11/11/2011 13:04:09
704
18
Page disappears on load
I have a web application that includes an ExtJS 4.1 grid. I create the grid(and it is rendered right), but when I load the store, the whole page disappears. I have added a *load* listener on the store and it seems that the results are received successfully. This problem occurs only in IE8, Chrome and FireFox display everything right. How should I fix this?
javascript
extjs
extjs4.1
null
null
null
open
Page disappears on load === I have a web application that includes an ExtJS 4.1 grid. I create the grid(and it is rendered right), but when I load the store, the whole page disappears. I have added a *load* listener on the store and it seems that the results are received successfully. This problem occurs only in IE8, Chrome and FireFox display everything right. How should I fix this?
0
11,650,680
07/25/2012 13:20:44
1,013,129
10/25/2011 16:32:54
5
0
Uploadify not uploading all files in the queue automatically
I have a problem with uploadify where it will not automatically upload all files in the queue. Either I am not adding them to the queue properly, or I am missing something. When I click the upload button, I really want all the files in the queue to be uploaded, but instead, I have to click the upload button everytime one is finished being uploaded. button code: <div id="some_file_queue"></div> <input type="file" name="batchImport" id="batchImport"/> <input type="button" class="batchImport" value="Upload Files"> javascript: $("#batchImport").uploadify({ 'queueSizeLimit':10, 'queueID':'some_file_queue', "swf":"/js/uploadify-v3.1/uploadify.swf", "uploader":"/js/uploadify-v3.1/uploadify.php", "uploadFolder":"/uploads/", "auto":false, "multi":true, "height":19, "width":94, "onUploadError":function(file,errorCode,errorMsg,errorString){ alert("The file " + file.name + " could not be uploaded: " + errorString); }, "onQueueComplete":function(queueData){ console.log(queueData); }, "onUploadSuccess":function(file, data, response){ $.ajax({ type:"POST", data:{ single:1, file:file, data:data, call:'element', objContainer:$('select[name="objContainer"] option:selected').val() }, url:"/index.php/upload_handler/handler", success:function(response){ checkResponse(response); } }); } }); $(document).on("click",".batchImport",function(){ $("#batchImport").uploadifyUpload("*"); });
jquery
uploadify
null
null
null
null
open
Uploadify not uploading all files in the queue automatically === I have a problem with uploadify where it will not automatically upload all files in the queue. Either I am not adding them to the queue properly, or I am missing something. When I click the upload button, I really want all the files in the queue to be uploaded, but instead, I have to click the upload button everytime one is finished being uploaded. button code: <div id="some_file_queue"></div> <input type="file" name="batchImport" id="batchImport"/> <input type="button" class="batchImport" value="Upload Files"> javascript: $("#batchImport").uploadify({ 'queueSizeLimit':10, 'queueID':'some_file_queue', "swf":"/js/uploadify-v3.1/uploadify.swf", "uploader":"/js/uploadify-v3.1/uploadify.php", "uploadFolder":"/uploads/", "auto":false, "multi":true, "height":19, "width":94, "onUploadError":function(file,errorCode,errorMsg,errorString){ alert("The file " + file.name + " could not be uploaded: " + errorString); }, "onQueueComplete":function(queueData){ console.log(queueData); }, "onUploadSuccess":function(file, data, response){ $.ajax({ type:"POST", data:{ single:1, file:file, data:data, call:'element', objContainer:$('select[name="objContainer"] option:selected').val() }, url:"/index.php/upload_handler/handler", success:function(response){ checkResponse(response); } }); } }); $(document).on("click",".batchImport",function(){ $("#batchImport").uploadifyUpload("*"); });
0
11,650,683
07/25/2012 13:20:45
830,213
06/17/2011 21:58:57
170
7
How to get multiple value lists at once when using servicestack redis
###The background: A co-worker transformed a serverside hg pushlog with simply just the format [reponame timestamp creator hash] into a Redis store, with a bunch of keys (the reponames), and the values are a redis list of [timestamp creator hash]. ###problem Nr. 1: My code right now is very simple, works, but it's too slow (takes 30 seconds, I only have around 100kbyte/sec throughput, and the number of entries in all keys (all commits to any repo) is just 6600, so it's **waaayyyy** too slow): public class HgEntry { public string Tip { get; set; } public string User { get; set; } public DateTime Time { get; set; } } var redisClient = new RedisClient("url.to.hg.repo", 6379).GetTypedClient<HgEntry>(); var keys = redisClient.GetAllKeys(); keys .SelectMany (key => redisClient.Lists[key].Select (x => new { Key = key, Tip = x.Tip, User = x.User, Time = x.Time }) ) .Where (entry => entry.Time.Date == DateTime.Now.Date) .Dump(); // LinqPad Dump So my question is: How can I get that query faster via MGET? GetValues<HgEntry> or GetValues for the keys just returns null, I assume it's because of the values for the keys being a list. Is there any way? ###problem Nr. 2 (minor, more Redis-related) Maybe that's not the most ideal format to begin with? Especially I need to query for Date, like "only entries from today", is there some server-side Redis query which takes this into account? Does Redis "understand" time? In the end I could just change the whole thing into a sorted set of log entries and query for the last 20 entries, I guess..
redis
servicestack
null
null
null
null
open
How to get multiple value lists at once when using servicestack redis === ###The background: A co-worker transformed a serverside hg pushlog with simply just the format [reponame timestamp creator hash] into a Redis store, with a bunch of keys (the reponames), and the values are a redis list of [timestamp creator hash]. ###problem Nr. 1: My code right now is very simple, works, but it's too slow (takes 30 seconds, I only have around 100kbyte/sec throughput, and the number of entries in all keys (all commits to any repo) is just 6600, so it's **waaayyyy** too slow): public class HgEntry { public string Tip { get; set; } public string User { get; set; } public DateTime Time { get; set; } } var redisClient = new RedisClient("url.to.hg.repo", 6379).GetTypedClient<HgEntry>(); var keys = redisClient.GetAllKeys(); keys .SelectMany (key => redisClient.Lists[key].Select (x => new { Key = key, Tip = x.Tip, User = x.User, Time = x.Time }) ) .Where (entry => entry.Time.Date == DateTime.Now.Date) .Dump(); // LinqPad Dump So my question is: How can I get that query faster via MGET? GetValues<HgEntry> or GetValues for the keys just returns null, I assume it's because of the values for the keys being a list. Is there any way? ###problem Nr. 2 (minor, more Redis-related) Maybe that's not the most ideal format to begin with? Especially I need to query for Date, like "only entries from today", is there some server-side Redis query which takes this into account? Does Redis "understand" time? In the end I could just change the whole thing into a sorted set of log entries and query for the last 20 entries, I guess..
0
11,650,684
07/25/2012 13:20:52
1,442,404
06/07/2012 13:55:11
5
0
Simplify this If statement so it doesn't duplicate code - Javascript
I have an If statement that runs within a 'for' loop to create markers for a Google map. Basically if a tick box is not ticked it runs the code all displays all markers, but if a checkbox is ticked then it checks for a 2nd parameter and only runs the code for the items that match this condition. The code I have below works fine, but it means I have to use the same code in both parts of the if statement. Apart from building it into a function if there a better way of structuring the If statement to achieve this? if(!FriendlyChecked){ //Code here } else if(FriendlyChecked && Friendly == "Yes"){ //Same code here }
javascript
jquery
if-statement
statement
null
null
open
Simplify this If statement so it doesn't duplicate code - Javascript === I have an If statement that runs within a 'for' loop to create markers for a Google map. Basically if a tick box is not ticked it runs the code all displays all markers, but if a checkbox is ticked then it checks for a 2nd parameter and only runs the code for the items that match this condition. The code I have below works fine, but it means I have to use the same code in both parts of the if statement. Apart from building it into a function if there a better way of structuring the If statement to achieve this? if(!FriendlyChecked){ //Code here } else if(FriendlyChecked && Friendly == "Yes"){ //Same code here }
0
11,623,462
07/24/2012 02:54:49
1,487,025
06/27/2012 22:07:56
10
1
How to draw a random loop on map in android
I would like to draw a random circle in fact a loop on the map. I have some locations on map (Latitude and longitude values of a location) . When the user draw a random circle or any loop then I should show that points/locations with in that loop. Also i should count the number of points/locations present in that loop. Is there a way i can do that. Atleast suggest me some links/tutorials to go through. Thank you very much your help is appreciated...
android-canvas
android-maps
android-location
null
null
null
open
How to draw a random loop on map in android === I would like to draw a random circle in fact a loop on the map. I have some locations on map (Latitude and longitude values of a location) . When the user draw a random circle or any loop then I should show that points/locations with in that loop. Also i should count the number of points/locations present in that loop. Is there a way i can do that. Atleast suggest me some links/tutorials to go through. Thank you very much your help is appreciated...
0
11,372,926
07/07/2012 06:49:31
1,283,984
03/21/2012 16:43:51
18
0
OO design and hibernate
I have tried to model the job portal use case as in class diagram below. I have made Skill entity as shareable by both job as well as job seeker hoping to reuse. http://imagebin.org/219680 questions: 1. do I need different JobSkill and SeekerSkill entities may be. In both cases how will I model it in database ? how to create job or seeker so that he uses the existing skill in database ? 2. I need to do skill matching such that job skill requirement is subset of candidate skills for: a) employer e1: find all candidates - 1{job + 1{candidate}N }N b) candidate c1: find all jobs - 1{job + employer }N How can I do above things using hibernate ? do I need to resort to SQL ? Regards, Miten.
hibernate
ooad
null
null
null
null
open
OO design and hibernate === I have tried to model the job portal use case as in class diagram below. I have made Skill entity as shareable by both job as well as job seeker hoping to reuse. http://imagebin.org/219680 questions: 1. do I need different JobSkill and SeekerSkill entities may be. In both cases how will I model it in database ? how to create job or seeker so that he uses the existing skill in database ? 2. I need to do skill matching such that job skill requirement is subset of candidate skills for: a) employer e1: find all candidates - 1{job + 1{candidate}N }N b) candidate c1: find all jobs - 1{job + employer }N How can I do above things using hibernate ? do I need to resort to SQL ? Regards, Miten.
0
11,373,107
07/07/2012 07:21:59
342,692
05/17/2010 01:59:20
33
2
Blender display doesn't show default cube, or anything else
I'm using Blender 2.62 (newest available from software center) on Ubuntu 12.04, and while all the controls seem to be present and working, I get no visual display of what I'm working on. When I press F12 to render, I can see the cube. Further, when I rotate the cube and render again, the cube has in fact moved. However, I can only tell this through rendering the scene as nothing appears in edit mode. I'm new to blender and really don't know where to start with such a problem. Am I missing something obvious?
ubuntu
blender
null
null
null
null
open
Blender display doesn't show default cube, or anything else === I'm using Blender 2.62 (newest available from software center) on Ubuntu 12.04, and while all the controls seem to be present and working, I get no visual display of what I'm working on. When I press F12 to render, I can see the cube. Further, when I rotate the cube and render again, the cube has in fact moved. However, I can only tell this through rendering the scene as nothing appears in edit mode. I'm new to blender and really don't know where to start with such a problem. Am I missing something obvious?
0
11,373,109
07/07/2012 07:22:00
1,493,169
06/30/2012 15:05:04
1
0
Java connect OPCServer then JVM is closed
i use Java connect OPCserver ,and after the program running a few minutes,the JVM is closing!why? is that related with memoryusage?
java
jvm
null
null
null
null
open
Java connect OPCServer then JVM is closed === i use Java connect OPCserver ,and after the program running a few minutes,the JVM is closing!why? is that related with memoryusage?
0
11,373,110
07/07/2012 07:22:13
1,190,316
02/05/2012 07:18:40
125
1
Sending SMS from a C# application using a SMS gateway
I am trying to develop a application that will send SMS. I will be getting a SMS gateway from one of the local service providers. All i need to do is forward the text message to their server and they will deliver it to the users. I need a SMS class structure for this in C#. I have searched for it but didn't find anything that suits my requirement. Please help....
c#
sms
null
null
null
07/10/2012 11:44:46
not a real question
Sending SMS from a C# application using a SMS gateway === I am trying to develop a application that will send SMS. I will be getting a SMS gateway from one of the local service providers. All i need to do is forward the text message to their server and they will deliver it to the users. I need a SMS class structure for this in C#. I have searched for it but didn't find anything that suits my requirement. Please help....
1
11,373,111
07/07/2012 07:22:15
1,277,099
03/18/2012 15:58:19
6
0
Importing XML/XSD(auto-generated with JAXB) into excel
In my program(using derby) i created a table and now want to export it into an XML file. With JAXB I managed to generate a xml and xsd file: XSD: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="eintragListe"> <xs:sequence> <xs:element name="Eintrag" type="eintrag" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="eintrag"> <xs:sequence> <xs:element name="art" type="xs:string" minOccurs="0"/> <xs:element name="betrag" type="xs:double"/> <xs:element name="datum" type="xs:dateTime" minOccurs="0"/> <xs:element name="id" type="xs:int"/> <xs:element name="pa" type="xs:int"/> <xs:element name="typ" type="xs:string" minOccurs="0"/> <xs:element name="verwendung" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:schema> XML: <?xml version="1.0" encoding="UTF-8"?> <ns2:eintragListe xmlns:ns2="www"> <Eintrag> <art>Einmalig</art> <betrag>27.0</betrag> <datum>2012-06-01T00:00:00+02:00</datum> <id>601</id> <pa>-1</pa> <typ>Ausgabe</typ> <verwendung>Irgendswas</verwendung> </Eintrag> <Eintrag> <art>Einmalig</art> <betrag>17.0</betrag> <datum>2012-06-01T00:00:00+02:00</datum> <id>502</id> <pa>-1</pa> <typ>Ausgabe</typ> <verwendung>Irgendwasanderes</verwendung> </Eintrag> </ns2:eintragListe> i now wanted to import these files into excel, but i always get an error, that the schema doesnt fit to the xml file. is there a solution? thanks four your help :)
xml
excel
xsd
jaxb
null
null
open
Importing XML/XSD(auto-generated with JAXB) into excel === In my program(using derby) i created a table and now want to export it into an XML file. With JAXB I managed to generate a xml and xsd file: XSD: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="eintragListe"> <xs:sequence> <xs:element name="Eintrag" type="eintrag" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="eintrag"> <xs:sequence> <xs:element name="art" type="xs:string" minOccurs="0"/> <xs:element name="betrag" type="xs:double"/> <xs:element name="datum" type="xs:dateTime" minOccurs="0"/> <xs:element name="id" type="xs:int"/> <xs:element name="pa" type="xs:int"/> <xs:element name="typ" type="xs:string" minOccurs="0"/> <xs:element name="verwendung" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:schema> XML: <?xml version="1.0" encoding="UTF-8"?> <ns2:eintragListe xmlns:ns2="www"> <Eintrag> <art>Einmalig</art> <betrag>27.0</betrag> <datum>2012-06-01T00:00:00+02:00</datum> <id>601</id> <pa>-1</pa> <typ>Ausgabe</typ> <verwendung>Irgendswas</verwendung> </Eintrag> <Eintrag> <art>Einmalig</art> <betrag>17.0</betrag> <datum>2012-06-01T00:00:00+02:00</datum> <id>502</id> <pa>-1</pa> <typ>Ausgabe</typ> <verwendung>Irgendwasanderes</verwendung> </Eintrag> </ns2:eintragListe> i now wanted to import these files into excel, but i always get an error, that the schema doesnt fit to the xml file. is there a solution? thanks four your help :)
0
11,373,103
07/07/2012 07:20:59
1,374,407
05/04/2012 07:54:07
346
34
Get word under mouse pointer
according this ([get a word under cursor using JavaScript][1] )link i can get word under mouse pointer.it's fine for english language. i change it (for arabic language) <p>سلام به همه</p> Word: <span id="word"></span> <script type="text/javascript"> $(function() { // wrap words in spans $('p').each(function() { var $this = $(this); $this.html($this.text().replace(/[^\x00-\x80]+/g, "<span>$1</span>")); }); // bind to each span $('p span').hover( function() { $('#word').text($(this).css('background-color','#ffff66').text()); }, function() { $('#word').text(''); $(this).css('background-color',''); } ); }); </script> but it return '$1' for each word. please help! [1]: http://stackoverflow.com/questions/2444430/how-to-get-a-word-under-cursor-using-javascript
javascript
webbrowser
null
null
null
null
open
Get word under mouse pointer === according this ([get a word under cursor using JavaScript][1] )link i can get word under mouse pointer.it's fine for english language. i change it (for arabic language) <p>سلام به همه</p> Word: <span id="word"></span> <script type="text/javascript"> $(function() { // wrap words in spans $('p').each(function() { var $this = $(this); $this.html($this.text().replace(/[^\x00-\x80]+/g, "<span>$1</span>")); }); // bind to each span $('p span').hover( function() { $('#word').text($(this).css('background-color','#ffff66').text()); }, function() { $('#word').text(''); $(this).css('background-color',''); } ); }); </script> but it return '$1' for each word. please help! [1]: http://stackoverflow.com/questions/2444430/how-to-get-a-word-under-cursor-using-javascript
0
11,373,105
07/07/2012 07:21:43
451,972
09/19/2010 14:34:29
108
0
How to use rabbitmq as a distributed task queue?
In my knowledge, rabbitmq is a HA message queue. Is is possible use it as a task queue. Some requirement: 1. load blanced should consider the worker node idle resource 2. should dynamic add/del worker thread 3. dynamic add worker node As rabbitmq consumer can fetch message and define callback funtion to handle the message. it is much possible to do that. But I don't know how to use it flexible,dynamically. Can you give some example or idea?
rabbitmq
null
null
null
null
null
open
How to use rabbitmq as a distributed task queue? === In my knowledge, rabbitmq is a HA message queue. Is is possible use it as a task queue. Some requirement: 1. load blanced should consider the worker node idle resource 2. should dynamic add/del worker thread 3. dynamic add worker node As rabbitmq consumer can fetch message and define callback funtion to handle the message. it is much possible to do that. But I don't know how to use it flexible,dynamically. Can you give some example or idea?
0
11,373,058
07/07/2012 07:12:31
713,234
04/18/2011 10:32:36
13
0
iTextPdf Alternative for PDF generation with attachments
Is there any free Java library that can replace iTextPdf (cannot use iText in a commercial product without purchasing license), a must-have feature we need is the ability to embed other documents (Word Docs, PDFs, Images) aka Attachments in the generated PDF. Also, if anybody can tell if Attachments were supported in iText pre v2.1.7, when the license terms where not restrictive.
pdf-generation
itext
attachments
null
null
null
open
iTextPdf Alternative for PDF generation with attachments === Is there any free Java library that can replace iTextPdf (cannot use iText in a commercial product without purchasing license), a must-have feature we need is the ability to embed other documents (Word Docs, PDFs, Images) aka Attachments in the generated PDF. Also, if anybody can tell if Attachments were supported in iText pre v2.1.7, when the license terms where not restrictive.
0
11,373,061
07/07/2012 07:12:57
1,490,601
06/29/2012 07:47:34
35
0
How to insert data in the nested set model(MySQL);
In the nested set model we have LEFT and Right columns the first time when the table is empty, what i need to insert to the RIGHT column, if i don't know how many children will i have LEFT 1 - forever RIGHT ? - what value goes here?? how to make it dynamic? not static. ps: using php
php
mysql
database
nested-sets
null
null
open
How to insert data in the nested set model(MySQL); === In the nested set model we have LEFT and Right columns the first time when the table is empty, what i need to insert to the RIGHT column, if i don't know how many children will i have LEFT 1 - forever RIGHT ? - what value goes here?? how to make it dynamic? not static. ps: using php
0
11,373,115
07/07/2012 07:22:40
1,134,517
01/06/2012 14:51:37
1
1
jQuery form validation not working in Django
<br /> I have a simple HTML form in my Django site. see this http://tinypic.com/r/2ce57rb/6 I want to validate the form on the client side using jQuery but i don't know jQuery or JavaScript.So, i downloaded the form here [http://alittlecode.com/files/jQuery-Validate-Demo/][2] and copied all the files to the correct places and the code is the same except some minor modification like name etc. i know they are at correct places because i can see them from the source and i am using twitter bootstrap. The problem is that no validation occurs after i submit it. the address bar looks like this after clicking submit <br /> `http://127.0.0.1:8000/contact/?name=&email=&subject=&message=` Please help i tried many plugins etc. none of them are working! [1]: http://i.stack.imgur.com/NuZly.png [2]: http://alittlecode.com/files/jQuery-Validate-Demo/
jquery
django
twitter-bootstrap
form-validation
null
07/08/2012 00:56:18
not a real question
jQuery form validation not working in Django === <br /> I have a simple HTML form in my Django site. see this http://tinypic.com/r/2ce57rb/6 I want to validate the form on the client side using jQuery but i don't know jQuery or JavaScript.So, i downloaded the form here [http://alittlecode.com/files/jQuery-Validate-Demo/][2] and copied all the files to the correct places and the code is the same except some minor modification like name etc. i know they are at correct places because i can see them from the source and i am using twitter bootstrap. The problem is that no validation occurs after i submit it. the address bar looks like this after clicking submit <br /> `http://127.0.0.1:8000/contact/?name=&email=&subject=&message=` Please help i tried many plugins etc. none of them are working! [1]: http://i.stack.imgur.com/NuZly.png [2]: http://alittlecode.com/files/jQuery-Validate-Demo/
1
11,472,013
07/13/2012 14:00:34
1,000,555
10/18/2011 06:58:36
20
1
Save unexecuted network actions on android
I got a bit of a problem. I have a running application for android which is great. I use a "cleanservice" to store actions in a BlockingQueue which are then executed every minute the service is run. Now the problem occurs when the user wants to close the app. When he wants to close I have the service run one last time to send all the actions over the internet. But when no internet connection is available, all my queued actions are lost. I need a way to store these actions (like in sharedpreferences or file or ...) when closing if they can't be send. And when I open the app again I can chekc if there are unexecuted actions that needs to be send. I found [this][1] with several ways to store data. But what is the best way? if(!finaltry) processActionQueues(true, true); else{ // We get here when we are logging off (shutting down) and our final try has failed to send the updates to the server // We are going to save the actions so we can send them when we log on again } My actions are from this interface: public interface IWebServiceAction { /** * Executes the action on the server. * Here you would typically do an http request to the webservice * @param ctx * @return * @throws IOException * @throws AuthenticationException */ boolean execute(Context ctx) throws IOException, AuthenticationException; /** * Indicates whether this is an urgent action. If the action is * to be executed by the CleanService then it will execute it * immediately if the action is urgent. * Default = false * @return */ boolean isUrgent(); /** * If the user needs to be logged into the system before we can * execute the action then isPrivate is true. * Public actions that can be executed regardless of login are for * example the login action itself, or a check for updates. * Default = true * @return */ boolean isPrivate(); /** * Indicates whether this action requires that all previous actions are * executed before we begin executing this one * @return */ boolean requiresQueueuToBeCompleted(); } [1]: http://developer.android.com/guide/topics/data/data-storage.html#pref
android
networking
service
storage
null
null
open
Save unexecuted network actions on android === I got a bit of a problem. I have a running application for android which is great. I use a "cleanservice" to store actions in a BlockingQueue which are then executed every minute the service is run. Now the problem occurs when the user wants to close the app. When he wants to close I have the service run one last time to send all the actions over the internet. But when no internet connection is available, all my queued actions are lost. I need a way to store these actions (like in sharedpreferences or file or ...) when closing if they can't be send. And when I open the app again I can chekc if there are unexecuted actions that needs to be send. I found [this][1] with several ways to store data. But what is the best way? if(!finaltry) processActionQueues(true, true); else{ // We get here when we are logging off (shutting down) and our final try has failed to send the updates to the server // We are going to save the actions so we can send them when we log on again } My actions are from this interface: public interface IWebServiceAction { /** * Executes the action on the server. * Here you would typically do an http request to the webservice * @param ctx * @return * @throws IOException * @throws AuthenticationException */ boolean execute(Context ctx) throws IOException, AuthenticationException; /** * Indicates whether this is an urgent action. If the action is * to be executed by the CleanService then it will execute it * immediately if the action is urgent. * Default = false * @return */ boolean isUrgent(); /** * If the user needs to be logged into the system before we can * execute the action then isPrivate is true. * Public actions that can be executed regardless of login are for * example the login action itself, or a check for updates. * Default = true * @return */ boolean isPrivate(); /** * Indicates whether this action requires that all previous actions are * executed before we begin executing this one * @return */ boolean requiresQueueuToBeCompleted(); } [1]: http://developer.android.com/guide/topics/data/data-storage.html#pref
0
11,472,018
07/13/2012 14:00:48
1,441,025
06/06/2012 23:47:28
15
0
Menu option causes program to fail. (C)
I have a little text based game i am working on. The user has a few options of attack sometimes when the user presses "1" or jab the program just stops: printf("Round %d: \nChoose Your Attack:(1/2/.../D)\n\n1.Jab\t\tOr D to defend\n2.Cross\n3.Hook\n",round); action = getch(); //Create the damage for each player if(action == '1') { UserAttack = rand() % (UserStats[0]-2); EnemyAttack = rand() % (EnemyStats[0]-3); break; } else if(action == '2') { UserAttack = rand() %UserStats[0]; EnemyAttack = rand() %EnemyStats[0]; break; } else if(action == '3') { UserAttack = rand() %(UserStats[0]+4); EnemyAttack = rand() %(EnemyStats[0]+2); break; } else if(action == 'D' || action == 'd') { UserAttack= 0; EnemyAttack = defense(); //Defense randomizes a number upto 3 if it is 1 the enemy attack is 1 point break; } else //Ensures the key pressed is a valid choice { system("cls"); printf("INVALID ACTION PRESS ANY KEY TO RECHOOSE:"); getch(); //TODO: Pressing this clears the health screen! system("cls"); //Clears screen just in case continue; } } I ran the debugger and all the variables were fine but call stack (which i do not know about returned this) ![Call Stack][1] If you need more info let me know! Thank you! [1]: http://i.stack.imgur.com/JMJEx.png
c
debugging
bugs
callstack
null
null
open
Menu option causes program to fail. (C) === I have a little text based game i am working on. The user has a few options of attack sometimes when the user presses "1" or jab the program just stops: printf("Round %d: \nChoose Your Attack:(1/2/.../D)\n\n1.Jab\t\tOr D to defend\n2.Cross\n3.Hook\n",round); action = getch(); //Create the damage for each player if(action == '1') { UserAttack = rand() % (UserStats[0]-2); EnemyAttack = rand() % (EnemyStats[0]-3); break; } else if(action == '2') { UserAttack = rand() %UserStats[0]; EnemyAttack = rand() %EnemyStats[0]; break; } else if(action == '3') { UserAttack = rand() %(UserStats[0]+4); EnemyAttack = rand() %(EnemyStats[0]+2); break; } else if(action == 'D' || action == 'd') { UserAttack= 0; EnemyAttack = defense(); //Defense randomizes a number upto 3 if it is 1 the enemy attack is 1 point break; } else //Ensures the key pressed is a valid choice { system("cls"); printf("INVALID ACTION PRESS ANY KEY TO RECHOOSE:"); getch(); //TODO: Pressing this clears the health screen! system("cls"); //Clears screen just in case continue; } } I ran the debugger and all the variables were fine but call stack (which i do not know about returned this) ![Call Stack][1] If you need more info let me know! Thank you! [1]: http://i.stack.imgur.com/JMJEx.png
0
11,472,019
07/13/2012 14:00:57
1,167,088
01/24/2012 13:22:58
110
11
TCP/Ip network communication in c++
I am trying to write a threaded function that sends system information via Tcp/ip over the local network to another computer. I have been using sockets to achieve this and this has worked out quite allright thus far. But I am now at a point where this usually works but around 30% of the time I get error messages telling me that the socket can not be opened. I use the activeSocket library for the sockets. #include "tbb/tick_count.h" #include "ActiveSocket.h" using namespace std; CActiveSocket communicationSocket; extern int hardwareStatus; int establishTCP() { char time[11]; int communicationFailed = 0; memset(&time, 0, 11); socket.Initialize(); socket.SetConnectTimeout(0, 20); socket.SetSendTimeout(0, 20); return communicationFailed; } int monitor() { cout << "Monitor: init continious monitoring" << endl; int communicationFailed; tbb::tick_count monitorCounter = tbb::tick_count::now(); while (!closeProgram) { tbb::tick_count currentTick = tbb::tick_count::now(); tbb::tick_count::interval_t interval; interval = currentTick - monitorCounter; if (interval.seconds() > 2) { monitorCounter = tbb::tick_count::now(); communicationFailed = 1; char buffer[256]; sprintf(buffer, "%d;", hardwareStatus); establishTCP(); char *charip = new char[monitoringIP.size() + 1]; charip[monitoringIP.size()] = 0; memcpy(charip, monitoringIP.c_str(), monitoringIP.size()); const uint8* realip = (const uint8 *) charip; int monitorCount = 0; cout << "Monitor: " << buffer << endl; while (communicationFailed == 1 && monitorCount < 2) { monitorCount++; if (socket.Open(realip, 2417)) { if (socket.Send((const uint8 *) buffer, strlen(buffer))) { cout << "Monitor: Succeeded sending data" << endl; communicationFailed = 0; socket.Close(); } else { socket.Close(); communicationFailed = 1; cout << "Monitor: FAILED TO SEND DATA" << endl; } } else { socket.Close(); communicationFailed = 1; cout << "Monitor: FAILED TO OPEN SOCKET FOR DATA" << endl; } } if (monitorCount == 2) cout << "Monitor: UNABLE TO SEND DATA" << endl; } } return communicationFailed; } I think I am doing something wrong with these functions and that the problem is not on the other side of the line where this data is received. Can anyone see any obvious mistakes in this code that could cause the failure? I keep getting my own cout message `"Monitor: FAILED TO OPEN SOCKET FOR DATA"`
c++
sockets
tcp-ip
null
null
null
open
TCP/Ip network communication in c++ === I am trying to write a threaded function that sends system information via Tcp/ip over the local network to another computer. I have been using sockets to achieve this and this has worked out quite allright thus far. But I am now at a point where this usually works but around 30% of the time I get error messages telling me that the socket can not be opened. I use the activeSocket library for the sockets. #include "tbb/tick_count.h" #include "ActiveSocket.h" using namespace std; CActiveSocket communicationSocket; extern int hardwareStatus; int establishTCP() { char time[11]; int communicationFailed = 0; memset(&time, 0, 11); socket.Initialize(); socket.SetConnectTimeout(0, 20); socket.SetSendTimeout(0, 20); return communicationFailed; } int monitor() { cout << "Monitor: init continious monitoring" << endl; int communicationFailed; tbb::tick_count monitorCounter = tbb::tick_count::now(); while (!closeProgram) { tbb::tick_count currentTick = tbb::tick_count::now(); tbb::tick_count::interval_t interval; interval = currentTick - monitorCounter; if (interval.seconds() > 2) { monitorCounter = tbb::tick_count::now(); communicationFailed = 1; char buffer[256]; sprintf(buffer, "%d;", hardwareStatus); establishTCP(); char *charip = new char[monitoringIP.size() + 1]; charip[monitoringIP.size()] = 0; memcpy(charip, monitoringIP.c_str(), monitoringIP.size()); const uint8* realip = (const uint8 *) charip; int monitorCount = 0; cout << "Monitor: " << buffer << endl; while (communicationFailed == 1 && monitorCount < 2) { monitorCount++; if (socket.Open(realip, 2417)) { if (socket.Send((const uint8 *) buffer, strlen(buffer))) { cout << "Monitor: Succeeded sending data" << endl; communicationFailed = 0; socket.Close(); } else { socket.Close(); communicationFailed = 1; cout << "Monitor: FAILED TO SEND DATA" << endl; } } else { socket.Close(); communicationFailed = 1; cout << "Monitor: FAILED TO OPEN SOCKET FOR DATA" << endl; } } if (monitorCount == 2) cout << "Monitor: UNABLE TO SEND DATA" << endl; } } return communicationFailed; } I think I am doing something wrong with these functions and that the problem is not on the other side of the line where this data is received. Can anyone see any obvious mistakes in this code that could cause the failure? I keep getting my own cout message `"Monitor: FAILED TO OPEN SOCKET FOR DATA"`
0
11,472,021
07/13/2012 14:00:58
1,514,989
07/10/2012 13:55:29
8
1
ocropus installation on Ubuntu 11.04
I need to install ocropus on Ubuntu 11.04. I went through a long and painful process of trying ocropus 0.3 and 0.4 from the project's Downloads page, but to no avail - I could find no way of making it locate tesseract, which it recommended. I labored on Google and came across the page [http://code.google.com/p/ocropus/wiki/InstallTranscript][1]. Great. Except when I issue the command: hg clone $release https://ocropus.googlecode.com/hg/ ocropus I get the error message: abort: unknown revision 'ocropus-0.4.4'! A post here [http://aur.archlinux.org/packages.php?ID=13444][2] by the maintainer of the ocropus package for archlinux says > they have completely refactored ocropus and at the same time they have also completely removed the old repository so it's not possible to access the old "stable" versions. I suggest using the ocropus-hg package, at least for the time being. I thought I would go ahead with this idea and issued the command: hg clone https://ocropus.googlecode.com/hg/ ocropus #I deftly avoid any mention of the release The result is I get a folder with a file interestingly named ocroinst. I run it and it says I need to run the following commands: sudo ./ocroinst packages #checks the dependencies ./ocroinst install #installs ocropus sudo ./ocroinst dl #downloads models I was glad and I issued the first command, which is when I got the message: > Package libjpeg8-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package libjpeg8-dev has no installation candidate I think a certain Murphy may have had a point. The situation, with an delicious added complication, is this: (please correct me if I am wrong) 1. Ubuntu 11.04 comes with libjpeg62-dev. The required version for ocropus is libjpeg8-dev. 2. Ocropus requires libtiff4-dev, and libtiff4-dev depends on libjpeg62-dev. Therefore there is no way for me to uninstall libjpeg62-dev. 3. libjpeg62-dev conflicts with libjpeg8-dev. Therefore, I can have only one of libjpeg8-dev or libjpeg62-dev, and never both. 4. If libjpeg8-dev is installed, I will have no libjpeg62-dev, which means I must remove libtiff4-dev and therefore have no way to install ocropus. 5. If libjpeg62-dev is installed, I will have no libjpeg8-dev and thus I will have no way to install ocropus. **NOTE:** (An experiment description) I had libjpeg62-dev installed on the system already. I figured I could take a chance and I went right ahead and changed every libjpeg8-dev I could find to *libjpeg-dev*, and ran the 3 commands. It installed. No error. This gave me great joy until I ran the command ocropus <image-file-name> and I was greeted by the charming: ImportError: /usr/local/lib/python2.6/dist-packages/_iulib.so: undefined symbol: _ZN5iulib6dcloseEv The more sophisticated ocropus book2pages out image* failed with the same error. A [post on stack overflow][3] indicates that this is caused by incorrectly versioned libraries. **THE QUESTION:** How should I proceed? Thanks in advance. [1]: http://code.google.com/p/ocropus/wiki/InstallTranscript [2]: http://aur.archlinux.org/packages.php?ID=13444 [3]: http://stackoverflow.com/questions/5134118/installing-ocropus-0-4-4
ocr
null
null
null
null
null
open
ocropus installation on Ubuntu 11.04 === I need to install ocropus on Ubuntu 11.04. I went through a long and painful process of trying ocropus 0.3 and 0.4 from the project's Downloads page, but to no avail - I could find no way of making it locate tesseract, which it recommended. I labored on Google and came across the page [http://code.google.com/p/ocropus/wiki/InstallTranscript][1]. Great. Except when I issue the command: hg clone $release https://ocropus.googlecode.com/hg/ ocropus I get the error message: abort: unknown revision 'ocropus-0.4.4'! A post here [http://aur.archlinux.org/packages.php?ID=13444][2] by the maintainer of the ocropus package for archlinux says > they have completely refactored ocropus and at the same time they have also completely removed the old repository so it's not possible to access the old "stable" versions. I suggest using the ocropus-hg package, at least for the time being. I thought I would go ahead with this idea and issued the command: hg clone https://ocropus.googlecode.com/hg/ ocropus #I deftly avoid any mention of the release The result is I get a folder with a file interestingly named ocroinst. I run it and it says I need to run the following commands: sudo ./ocroinst packages #checks the dependencies ./ocroinst install #installs ocropus sudo ./ocroinst dl #downloads models I was glad and I issued the first command, which is when I got the message: > Package libjpeg8-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package libjpeg8-dev has no installation candidate I think a certain Murphy may have had a point. The situation, with an delicious added complication, is this: (please correct me if I am wrong) 1. Ubuntu 11.04 comes with libjpeg62-dev. The required version for ocropus is libjpeg8-dev. 2. Ocropus requires libtiff4-dev, and libtiff4-dev depends on libjpeg62-dev. Therefore there is no way for me to uninstall libjpeg62-dev. 3. libjpeg62-dev conflicts with libjpeg8-dev. Therefore, I can have only one of libjpeg8-dev or libjpeg62-dev, and never both. 4. If libjpeg8-dev is installed, I will have no libjpeg62-dev, which means I must remove libtiff4-dev and therefore have no way to install ocropus. 5. If libjpeg62-dev is installed, I will have no libjpeg8-dev and thus I will have no way to install ocropus. **NOTE:** (An experiment description) I had libjpeg62-dev installed on the system already. I figured I could take a chance and I went right ahead and changed every libjpeg8-dev I could find to *libjpeg-dev*, and ran the 3 commands. It installed. No error. This gave me great joy until I ran the command ocropus <image-file-name> and I was greeted by the charming: ImportError: /usr/local/lib/python2.6/dist-packages/_iulib.so: undefined symbol: _ZN5iulib6dcloseEv The more sophisticated ocropus book2pages out image* failed with the same error. A [post on stack overflow][3] indicates that this is caused by incorrectly versioned libraries. **THE QUESTION:** How should I proceed? Thanks in advance. [1]: http://code.google.com/p/ocropus/wiki/InstallTranscript [2]: http://aur.archlinux.org/packages.php?ID=13444 [3]: http://stackoverflow.com/questions/5134118/installing-ocropus-0-4-4
0
11,472,003
07/13/2012 13:59:57
136,416
07/10/2009 17:26:14
299
6
How shall I approach search result caching for this MVC3 / RavenDB app?
In my simple MVC3 application users can perform searches against my data, which is held in a RavenDB database at RavenHQ. I know that RavenDB caches proactively, but I'd like to avoid the http call to RavenHQ in the first place by caching searches. It's likely that each user will perform the same search more than once, and it's also likely that different users will perform the same searches. The data won't change more often than weekly. The search params are properties of a search object. I've tried without success using output caching on the action (below), varying on the search object. It may be that I need to vary by each property of the search object individually, but that seems unsatisfactory as I may in the future add more properties. How would you approach this? 1. Output caching on the action varying by search.AccName, etc. 2. No caching in web app, rely on RavenDB caching. 3. Use HttpRuntime.Cache (but if so, how)? 4. Some other strategy. Excuse code formatting, had some problems with that. public class AccItemSearch { public string Location { get; set; } public string AccName { get; set; } public int? MinPrice { get; set; } public int? MaxPrice { get; set; } } public class AccItemSearchResults { public IEnumerable<AccItem> AccItems { get; set; } public AccItemSearch Search { get; set; } } public PartialViewResult Accommodation(AccItemSearch search) { var accItems = new List<AccItem>(); using (IDocumentSession session = MvcApplication.Store.OpenSession()) { fill accItems collection by querying the RavenDB database } return PartialView(new AccItemSearchResults { AccItems = accItems.ToList(), Search = search }); }
asp.net-mvc-3
caching
ravendb
null
null
null
open
How shall I approach search result caching for this MVC3 / RavenDB app? === In my simple MVC3 application users can perform searches against my data, which is held in a RavenDB database at RavenHQ. I know that RavenDB caches proactively, but I'd like to avoid the http call to RavenHQ in the first place by caching searches. It's likely that each user will perform the same search more than once, and it's also likely that different users will perform the same searches. The data won't change more often than weekly. The search params are properties of a search object. I've tried without success using output caching on the action (below), varying on the search object. It may be that I need to vary by each property of the search object individually, but that seems unsatisfactory as I may in the future add more properties. How would you approach this? 1. Output caching on the action varying by search.AccName, etc. 2. No caching in web app, rely on RavenDB caching. 3. Use HttpRuntime.Cache (but if so, how)? 4. Some other strategy. Excuse code formatting, had some problems with that. public class AccItemSearch { public string Location { get; set; } public string AccName { get; set; } public int? MinPrice { get; set; } public int? MaxPrice { get; set; } } public class AccItemSearchResults { public IEnumerable<AccItem> AccItems { get; set; } public AccItemSearch Search { get; set; } } public PartialViewResult Accommodation(AccItemSearch search) { var accItems = new List<AccItem>(); using (IDocumentSession session = MvcApplication.Store.OpenSession()) { fill accItems collection by querying the RavenDB database } return PartialView(new AccItemSearchResults { AccItems = accItems.ToList(), Search = search }); }
0
11,472,028
07/13/2012 14:01:46
1,009,163
10/23/2011 03:14:35
23
1
Binding a trackball to NPAPI
I want to use a second pointing device (the trackball) as a control for a specific function on a program. This means I would NOT want any mouse functionality from the trackball, I just want to get the movement data and somehow use the NPAPI to get that into our web app. Thanks in advance!
binding
usb
npapi
hid
trackball
null
open
Binding a trackball to NPAPI === I want to use a second pointing device (the trackball) as a control for a specific function on a program. This means I would NOT want any mouse functionality from the trackball, I just want to get the movement data and somehow use the NPAPI to get that into our web app. Thanks in advance!
0
11,472,029
07/13/2012 14:01:48
858,356
07/22/2011 16:45:55
156
3
python print a line, if and only if x and y are found
I'm trying to print a line that contains specific keywords, and they both should be in the same line in order for it to print out. This is how I approached the problem, I made 2 variables and assigned them with the variables. One of them is a filename and that changes every time the program iterated through a list. for files in myfiles: for lines in info: if dir_key and files in lines: print lines else: print "line not found" This works, but the problem is, it also prints a line that only contains the filename. How do I ensure it doesn't do that ?. I tried the if line.beginswith(dir_key) and line.endswith(file) but that yielded no results what so ever. so I switched to the first method.
python
null
null
null
null
null
open
python print a line, if and only if x and y are found === I'm trying to print a line that contains specific keywords, and they both should be in the same line in order for it to print out. This is how I approached the problem, I made 2 variables and assigned them with the variables. One of them is a filename and that changes every time the program iterated through a list. for files in myfiles: for lines in info: if dir_key and files in lines: print lines else: print "line not found" This works, but the problem is, it also prints a line that only contains the filename. How do I ensure it doesn't do that ?. I tried the if line.beginswith(dir_key) and line.endswith(file) but that yielded no results what so ever. so I switched to the first method.
0
11,472,031
07/13/2012 14:01:54
1,220,255
02/20/2012 05:10:29
1
0
Delete ALL text to the left of a particular character in MS excel
This is an excel related question. I want to delete all text (all characters) to the left of a particular character or characters in the string. **For instance:** suppose I have an string in a cell **helloall welco metostackoverflow** now I want delete all the characters which are at the left side of "stack". means reasult should be **stackoverflow** (only stackoverflow) Thanks in advance for your support. Amit Rajput
excel
ms-office
null
null
null
null
open
Delete ALL text to the left of a particular character in MS excel === This is an excel related question. I want to delete all text (all characters) to the left of a particular character or characters in the string. **For instance:** suppose I have an string in a cell **helloall welco metostackoverflow** now I want delete all the characters which are at the left side of "stack". means reasult should be **stackoverflow** (only stackoverflow) Thanks in advance for your support. Amit Rajput
0
11,472,032
07/13/2012 14:01:55
1,418,182
05/25/2012 20:07:25
1
2
Gmaps4rails: How to add a custom marker to json in server?
Is it possible to add a custom marker to json after this: @json = @myObjects.to_gmaps4rails I'd like to add one more marker to that json, which would be other than myObject. Actually in my case it would be marker that would represent user location. I have all the needed information in my controller, but what is the easiest way to extend that json with one more marker?
ruby-on-rails
json
gmaps4rails
null
null
null
open
Gmaps4rails: How to add a custom marker to json in server? === Is it possible to add a custom marker to json after this: @json = @myObjects.to_gmaps4rails I'd like to add one more marker to that json, which would be other than myObject. Actually in my case it would be marker that would represent user location. I have all the needed information in my controller, but what is the easiest way to extend that json with one more marker?
0
11,472,033
07/13/2012 14:02:00
363,198
06/10/2010 07:30:19
220
19
linqpad and custom IPrincipal serializable
I'm using LINQPad to test code (what a great product, I must say) but now I'm encountering an exception when I try to set the Thread.CurrentPrincipal to a custom IPrincipal that is marked with the SerializableAttribute following a sample that demonstrate the problem void Main() { Thread.CurrentPrincipal = new MyCustomPrincipal(); } // Define other methods and classes here [Serializable] public class MyCustomPrincipal : IPrincipal { public bool IsInRole(string role) { return true; } public IIdentity Identity { get { return new WindowsIdentity("RECUPERA\\m.casamento"); } } } When I run this code in LINQPad (C# Program as Language) I get the following exception Type is not resolved for member 'UserQuery+MyCustomPrincipal,query_nhxfev, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' RuntimeMethodInfo: PluginWindowManager.get_Form () If I remove the Serializable attribute everything goes fine. It seems a problem related with the AppDomain architecture that LINQPad uses and the inability of the framework to find the assembly that define the MyCustomPrincipal. Also, I believe that defining MyCustomPrincipal into another assembly and putting it into the GAC would solve the problem, but that's not an option for me. Anyone have an idea ? Thanks, Marco
c#
linqpad
serializable
iprincipal
null
null
open
linqpad and custom IPrincipal serializable === I'm using LINQPad to test code (what a great product, I must say) but now I'm encountering an exception when I try to set the Thread.CurrentPrincipal to a custom IPrincipal that is marked with the SerializableAttribute following a sample that demonstrate the problem void Main() { Thread.CurrentPrincipal = new MyCustomPrincipal(); } // Define other methods and classes here [Serializable] public class MyCustomPrincipal : IPrincipal { public bool IsInRole(string role) { return true; } public IIdentity Identity { get { return new WindowsIdentity("RECUPERA\\m.casamento"); } } } When I run this code in LINQPad (C# Program as Language) I get the following exception Type is not resolved for member 'UserQuery+MyCustomPrincipal,query_nhxfev, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' RuntimeMethodInfo: PluginWindowManager.get_Form () If I remove the Serializable attribute everything goes fine. It seems a problem related with the AppDomain architecture that LINQPad uses and the inability of the framework to find the assembly that define the MyCustomPrincipal. Also, I believe that defining MyCustomPrincipal into another assembly and putting it into the GAC would solve the problem, but that's not an option for me. Anyone have an idea ? Thanks, Marco
0
11,541,921
07/18/2012 12:56:29
1,448,567
06/11/2012 09:17:57
1
0
Android My APK size Larger 50 MB
am developing a game app.,it contains more number of images,music files etc., it exceeded more than 50MB.but as per playstore , Market will allow on 50MB of apk size,plz provide me any solution to upload apk with more then 50MB of size, Thank in advance....
android
null
null
null
null
null
open
Android My APK size Larger 50 MB === am developing a game app.,it contains more number of images,music files etc., it exceeded more than 50MB.but as per playstore , Market will allow on 50MB of apk size,plz provide me any solution to upload apk with more then 50MB of size, Thank in advance....
0
11,540,886
07/18/2012 12:01:08
606,602
02/07/2011 14:45:39
38
2
Randomly throwing "InvalidCastException" during tests
On WatiN UI tests, I'm having an issue where when running tests, an error will sometimes will throw the following error: > InvalidCastException was unhandled by user code" ... "Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to interface type 'mshtml.IHTMLDocument2'. This operation failed because the QueryInterface call on the COM component for the interface with IID" ... "failed due to the following error. No such interface supported". It doesn't appear to matter whether WatiN is finding an element on a page, or interacting with it (clicking or using the Eval method). The errors happen on a frequency anywhere between all the time to some of the time. It's very inconsistent. It usually has a tendency to affect some elements more than others (in my case I had Javascript drop-down menus where it appeared to happen more often), but the error seems to be able to crop up almost anywhere. Anyone experienced this, or have any ideas of how this issue might be solved? Thanks
watin
null
null
null
null
null
open
Randomly throwing "InvalidCastException" during tests === On WatiN UI tests, I'm having an issue where when running tests, an error will sometimes will throw the following error: > InvalidCastException was unhandled by user code" ... "Unable to cast COM object of type 'mshtml.HTMLDocumentClass' to interface type 'mshtml.IHTMLDocument2'. This operation failed because the QueryInterface call on the COM component for the interface with IID" ... "failed due to the following error. No such interface supported". It doesn't appear to matter whether WatiN is finding an element on a page, or interacting with it (clicking or using the Eval method). The errors happen on a frequency anywhere between all the time to some of the time. It's very inconsistent. It usually has a tendency to affect some elements more than others (in my case I had Javascript drop-down menus where it appeared to happen more often), but the error seems to be able to crop up almost anywhere. Anyone experienced this, or have any ideas of how this issue might be solved? Thanks
0
11,541,925
07/18/2012 12:56:41
1,695
08/18/2008 02:49:06
36,157
983
How to propogate the fields of a custom exception from service to client via WCF?
Here's what I observe I need to throw a custom Exception subtype from the service to the client. (Listed as a FaultContract on the specific operation). I have certain fields on the CustomException, that should be received by the client. [Serializable] class MyCustomException : Exception { public string From { get; private set; } public MyCustomException(string where) { From = where; } } } I find that the field isn't being deserialized even though the exception is present inside the FaultException<MyCustomException> instance. I tried implementing ISerializable by overriding GetObjectData and the serialization ctor, but no dice. The only way I could get it across was changing MyCustomException to be a DataContract and not derive from Exception. [DataContract] class MyCustomException { [DataMember] public string From { get; private set; } public MyCustomException(string where) { From = where; } } This works. However it can't be derived from Exception anymore.. since Exception is marked with the Serializable attribute and you can't have both Serializable and DataContract on a type. (Confirmed: run time Exception thrown) So my question is : What is the right way to propogate the fields of a custom exception subtype in WCF?
wcf
null
null
null
null
null
open
How to propogate the fields of a custom exception from service to client via WCF? === Here's what I observe I need to throw a custom Exception subtype from the service to the client. (Listed as a FaultContract on the specific operation). I have certain fields on the CustomException, that should be received by the client. [Serializable] class MyCustomException : Exception { public string From { get; private set; } public MyCustomException(string where) { From = where; } } } I find that the field isn't being deserialized even though the exception is present inside the FaultException<MyCustomException> instance. I tried implementing ISerializable by overriding GetObjectData and the serialization ctor, but no dice. The only way I could get it across was changing MyCustomException to be a DataContract and not derive from Exception. [DataContract] class MyCustomException { [DataMember] public string From { get; private set; } public MyCustomException(string where) { From = where; } } This works. However it can't be derived from Exception anymore.. since Exception is marked with the Serializable attribute and you can't have both Serializable and DataContract on a type. (Confirmed: run time Exception thrown) So my question is : What is the right way to propogate the fields of a custom exception subtype in WCF?
0
11,541,926
07/18/2012 12:56:50
1,523,407
07/13/2012 11:27:18
12
4
All of the TextBoxes' Text are null in the gridview's footer template item
I have a problem about gridview. I can't read data I have entered to textbox in footer template. in Debugging it seems null. Thanks for considering.
asp.net
sql
gridview
textbox
null
null
open
All of the TextBoxes' Text are null in the gridview's footer template item === I have a problem about gridview. I can't read data I have entered to textbox in footer template. in Debugging it seems null. Thanks for considering.
0
11,541,927
07/18/2012 12:56:53
622,810
02/18/2011 08:38:38
10
1
Dojo "Select" widget and a hierarchical store
I am trying to mimic the behaviour of the <optgroup> tag from HTML in a *dijit.form.Select* widget. From what I've read through the tickets posted on the dojo issue tracker this can be accomplished using hierarchical stores. I created such a store, but the dropdown only displays only the "group names" and not the children. Does anybody know if a *dijit.form.Select* widget even works with a hierarchical store? Thank you and have a good day.
dijit.form
dojo.data
null
null
null
null
open
Dojo "Select" widget and a hierarchical store === I am trying to mimic the behaviour of the <optgroup> tag from HTML in a *dijit.form.Select* widget. From what I've read through the tickets posted on the dojo issue tracker this can be accomplished using hierarchical stores. I created such a store, but the dropdown only displays only the "group names" and not the children. Does anybody know if a *dijit.form.Select* widget even works with a hierarchical store? Thank you and have a good day.
0
11,541,283
07/18/2012 12:24:21
1,170,902
01/26/2012 08:59:00
190
3
Run webapi without installing .net4.5
I have a website running aspx pages, under asp.net4.0. I also have some DevExpress controls, that I purchased 4 years ago. I now want to add an API to the web application, however I understand that needs .net4.5 to be running. The DevExpress controls don't work under 4.5 - so I would need to renew them at considerable cost. 1. it possible, after installing .net4.5, for my site to continue to use .net4 - and not the new 4.5? so that I can have the site operate under 4.0, and the API under 4.5? 2. Or is it possible to have the API (using the Entity Framework) run under .net 4.0 Thank you, Mark
asp.net
asp.net-mvc
devexpress
asp.net-web-api
null
null
open
Run webapi without installing .net4.5 === I have a website running aspx pages, under asp.net4.0. I also have some DevExpress controls, that I purchased 4 years ago. I now want to add an API to the web application, however I understand that needs .net4.5 to be running. The DevExpress controls don't work under 4.5 - so I would need to renew them at considerable cost. 1. it possible, after installing .net4.5, for my site to continue to use .net4 - and not the new 4.5? so that I can have the site operate under 4.0, and the API under 4.5? 2. Or is it possible to have the API (using the Entity Framework) run under .net 4.0 Thank you, Mark
0
11,541,285
07/18/2012 12:24:24
1,517,541
07/11/2012 10:59:55
12
0
1064 error in MySql request
I have the following PHP code: function get_all_labels_by_language_id($language_code, $page_index, $user_id) { $language_id = $this->get_language_id($language_code); $users_query = "select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = " . $language_id . " and eng.label_value = loc.label_value and loc.user_id = '" . $user_id . "' where eng.language = 45 order by loc.language_value"; $data = $this->db->query($users_query)->result_array(); $result = array(); for ($i = 0; $i < count($data); $i++) { $result[$i]['language_id'] = $language_id; if (!$data[$i]['user_id']) { $result[$i]['translate'] = $data[$i]; $result[$i]['alternatives'] = NULL; $other_records_query = "select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = " . $language_id . " and eng.label_value = loc.label_value where eng.language = 45 and loc.label_value='" . $data[$i]['label_value'] . "' order by loc.language_value"; $other_records = $this->db->query($other_records_query)->result_array(); for ($k = 0; $k < count($other_records); $k++) { if ($other_records[$k]['approved'] == '1') { $result[$i]['translate'] = $other_records[$k]; } else { $result[$i]['alternatives'][] = $other_records[$k]; } } } else { $result[$i]['translate'] = $data[$i]; $result[$i]['alternatives'] = NULL; if ($data[$i]['approved'] == '1') { $other_records_query = "select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = " . $language_id . " and eng.label_value = loc.label_value and loc.approved='1' where eng.language = 45 and loc.label_value='" . $data[$i]['label_value'] . "' and approved='0' order by loc.language_value"; $other_records = $this->db->query($other_records_query)->result_array(); for ($k = 0; $k < count($other_records); $k++) { $result[$i]['alternatives'][] = $other_records[$k]; } } else { $other_records_query = "select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = " . $language_id . " and eng.label_value = loc.label_value and loc.approved='1' where eng.language = 45 and loc.label_value='" . $data[$i]['label_value'] . "' order by loc.language_value"; $other_records = $this->db->query($other_records_query)->result_array(); for ($k = 0; $k < count($other_records); $k++) { $result[$i]['alternatives'][] = $other_records[$k]; } } } } This code works right, but now I've got the following error: Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't set up correctly. If you're the store owner, please refer to' ' at line 8 select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = 24 and eng.label_value = loc.label_value where eng.language = 45 and loc.label_value='It looks like the payment gateway isn't set up correctly. If you're the store owner, please refer to' order by loc.language_value Filename: Z:\home\localhost\www\system\database\DB_driver.php Line Number: 330 Please, tell me, how can I fix it? I don't understand where I'm wrong. Thank you in advance.
php
mysql
null
null
null
null
open
1064 error in MySql request === I have the following PHP code: function get_all_labels_by_language_id($language_code, $page_index, $user_id) { $language_id = $this->get_language_id($language_code); $users_query = "select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = " . $language_id . " and eng.label_value = loc.label_value and loc.user_id = '" . $user_id . "' where eng.language = 45 order by loc.language_value"; $data = $this->db->query($users_query)->result_array(); $result = array(); for ($i = 0; $i < count($data); $i++) { $result[$i]['language_id'] = $language_id; if (!$data[$i]['user_id']) { $result[$i]['translate'] = $data[$i]; $result[$i]['alternatives'] = NULL; $other_records_query = "select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = " . $language_id . " and eng.label_value = loc.label_value where eng.language = 45 and loc.label_value='" . $data[$i]['label_value'] . "' order by loc.language_value"; $other_records = $this->db->query($other_records_query)->result_array(); for ($k = 0; $k < count($other_records); $k++) { if ($other_records[$k]['approved'] == '1') { $result[$i]['translate'] = $other_records[$k]; } else { $result[$i]['alternatives'][] = $other_records[$k]; } } } else { $result[$i]['translate'] = $data[$i]; $result[$i]['alternatives'] = NULL; if ($data[$i]['approved'] == '1') { $other_records_query = "select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = " . $language_id . " and eng.label_value = loc.label_value and loc.approved='1' where eng.language = 45 and loc.label_value='" . $data[$i]['label_value'] . "' and approved='0' order by loc.language_value"; $other_records = $this->db->query($other_records_query)->result_array(); for ($k = 0; $k < count($other_records); $k++) { $result[$i]['alternatives'][] = $other_records[$k]; } } else { $other_records_query = "select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = " . $language_id . " and eng.label_value = loc.label_value and loc.approved='1' where eng.language = 45 and loc.label_value='" . $data[$i]['label_value'] . "' order by loc.language_value"; $other_records = $this->db->query($other_records_query)->result_array(); for ($k = 0; $k < count($other_records); $k++) { $result[$i]['alternatives'][] = $other_records[$k]; } } } } This code works right, but now I've got the following error: Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't set up correctly. If you're the store owner, please refer to' ' at line 8 select eng.label_value, loc.votes, loc.user_id, loc.approved, eng.language_value, coalesce(loc.language_value) from labels eng left outer join labels loc on loc.language = 24 and eng.label_value = loc.label_value where eng.language = 45 and loc.label_value='It looks like the payment gateway isn't set up correctly. If you're the store owner, please refer to' order by loc.language_value Filename: Z:\home\localhost\www\system\database\DB_driver.php Line Number: 330 Please, tell me, how can I fix it? I don't understand where I'm wrong. Thank you in advance.
0
11,541,286
07/18/2012 12:24:26
449,449
09/16/2010 11:57:18
29,953
754
Selecting numbers "larger" than a given number
I have a table in PostgreSQL with one number column and I have a given number `x`. If `x` is in the table, I want all numbers `>= x`. If `x` is not in the table, I want all numbers `> x` and the greatest number `< x`. Example: id 5 10 15 20 For `x = 15` it should return `15` and `20`. For `x = 12` it should return `10`, `15` and `20`. I have tried the following: SELECT id FROM table_name WHERE id > 12 UNION SELECT MAX(id) FROM table_name WHERE id <= 12 which works correctly. Is there any single-query way? Thank you. (This is just an example with single column and numbers. The reality is a larger table and datetime column, but the principle should be the same.)
sql
postgresql
null
null
null
null
open
Selecting numbers "larger" than a given number === I have a table in PostgreSQL with one number column and I have a given number `x`. If `x` is in the table, I want all numbers `>= x`. If `x` is not in the table, I want all numbers `> x` and the greatest number `< x`. Example: id 5 10 15 20 For `x = 15` it should return `15` and `20`. For `x = 12` it should return `10`, `15` and `20`. I have tried the following: SELECT id FROM table_name WHERE id > 12 UNION SELECT MAX(id) FROM table_name WHERE id <= 12 which works correctly. Is there any single-query way? Thank you. (This is just an example with single column and numbers. The reality is a larger table and datetime column, but the principle should be the same.)
0
11,541,934
07/18/2012 12:57:05
371,465
06/20/2010 09:55:18
100
2
<a href="mailto:<emp-id>"> Validating Emp ID
In a web page, I can see a list of emp ids both existing and left. I've a script which clubs all these ids and prepares a mail to trigger. My problem here is, those who left the organisation (I cannot control the list) are still listed here and their ids are getting added in the list. I was been manually removing all those ids which is really a tough task. Is there a way I can check the emp-id (usually we do Ctrl + K) before I prepare the list?
javascript
html
null
null
null
null
open
<a href="mailto:<emp-id>"> Validating Emp ID === In a web page, I can see a list of emp ids both existing and left. I've a script which clubs all these ids and prepares a mail to trigger. My problem here is, those who left the organisation (I cannot control the list) are still listed here and their ids are getting added in the list. I was been manually removing all those ids which is really a tough task. Is there a way I can check the emp-id (usually we do Ctrl + K) before I prepare the list?
0
11,541,935
07/18/2012 12:57:06
1,534,814
07/18/2012 12:46:17
1
0
Error Fetching Children in Hibernate
When I try to access the database through my hibernate configuration and try to get a new one I am getting this issue "An internal error occurred during:"Fetching children of hibernate". > java.lang.NoClassDefFoundError: org/eclipse/jpt/jpa/core/JpaProject at > org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getProjectOverrides(EclipseLaunchConsoleConfigurationPreferences.java:228) > at The class: org/eclipse/jpt/jpa/core/JpaProject The stack trace is: org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getProperties(EclipseLaunchConsoleConfigurationPreferences.java:163) at org.hibernate.console.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:84) at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:240) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:237) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:188) at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:42) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
java
database
hibernate
children
null
07/18/2012 20:59:45
too localized
Error Fetching Children in Hibernate === When I try to access the database through my hibernate configuration and try to get a new one I am getting this issue "An internal error occurred during:"Fetching children of hibernate". > java.lang.NoClassDefFoundError: org/eclipse/jpt/jpa/core/JpaProject at > org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getProjectOverrides(EclipseLaunchConsoleConfigurationPreferences.java:228) > at The class: org/eclipse/jpt/jpa/core/JpaProject The stack trace is: org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getProperties(EclipseLaunchConsoleConfigurationPreferences.java:163) at org.hibernate.console.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:84) at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:240) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:237) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:188) at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:42) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
3
11,387,407
07/08/2012 22:59:09
531,030
12/05/2010 07:01:19
141
21
Facebook android sdk get all status updates
I'm trying to make an app where I need to grab all of the user's status updates. Below is the code I use to do this, but it only returns about 2 year's worth of data and not everything. My question is, is there something special I need to do in order to get EVERY status update? Bundle bundle = new Bundle(); bundle.putString("fields", "message"); mAsyncRunner.request("me/statuses", bundle, new StatusRequestListener()); Thanks!
android
facebook
null
null
null
null
open
Facebook android sdk get all status updates === I'm trying to make an app where I need to grab all of the user's status updates. Below is the code I use to do this, but it only returns about 2 year's worth of data and not everything. My question is, is there something special I need to do in order to get EVERY status update? Bundle bundle = new Bundle(); bundle.putString("fields", "message"); mAsyncRunner.request("me/statuses", bundle, new StatusRequestListener()); Thanks!
0
11,387,411
07/08/2012 22:59:46
938,972
09/11/2011 07:54:51
29
0
Plot Seismic Volume walls in Petrel 3D window using ocean
Can I programmatically plot a 3D seismic data volume render in 3D window through ocean? I can plot a random inline/xline with Window3d.showobject(seismic_cube) but i want to see the volume render directly without going into the setting tab. How can I do this?
c#
ocean
petrel
null
null
null
open
Plot Seismic Volume walls in Petrel 3D window using ocean === Can I programmatically plot a 3D seismic data volume render in 3D window through ocean? I can plot a random inline/xline with Window3d.showobject(seismic_cube) but i want to see the volume render directly without going into the setting tab. How can I do this?
0
11,387,412
07/08/2012 22:59:52
682,763
03/29/2011 19:41:24
356
1
Linq and EF4, Inner join conditional statement
OrdersRepository ordersRepository = new OrdersRepository(); var productInQuery = ordersRepository.ProductIn; var orderInfoQuery = ordersRepository.OrderInfo; var result = (from p in productInQuery from o in orderInfoQuery where p.refNo == o.refNo select new { t1 = p.no, t2 = o.no}).ToArray(); I wrote like above code for inner join. and I want to **add some conditional statement for OrderInfo context**. ... if(orderDate != DateTime.MinValue){ orderInfoQuery = orderInfoQuery.Where(x => x.orderDate = orderDate); } var result = (from p in productInQuery from o in orderInfoQuery where p.refNo == o.refNo select new { t1 = p.no, t2 = o.no}).ToArray(); I add the conditional statement but **it return always null**. (I check DB(Mysql) value is existed) And is it not **inner join**? var result = (from p in productInQuery join o in orderInfoQuery on p.refNo equals o.refNo select new { t1 = p.no, t2 = o.no}).ToArray(); Any body know this, please advice me~ Thank you!
asp.net
asp.net-mvc-3
linq
entity-framework-4
null
null
open
Linq and EF4, Inner join conditional statement === OrdersRepository ordersRepository = new OrdersRepository(); var productInQuery = ordersRepository.ProductIn; var orderInfoQuery = ordersRepository.OrderInfo; var result = (from p in productInQuery from o in orderInfoQuery where p.refNo == o.refNo select new { t1 = p.no, t2 = o.no}).ToArray(); I wrote like above code for inner join. and I want to **add some conditional statement for OrderInfo context**. ... if(orderDate != DateTime.MinValue){ orderInfoQuery = orderInfoQuery.Where(x => x.orderDate = orderDate); } var result = (from p in productInQuery from o in orderInfoQuery where p.refNo == o.refNo select new { t1 = p.no, t2 = o.no}).ToArray(); I add the conditional statement but **it return always null**. (I check DB(Mysql) value is existed) And is it not **inner join**? var result = (from p in productInQuery join o in orderInfoQuery on p.refNo equals o.refNo select new { t1 = p.no, t2 = o.no}).ToArray(); Any body know this, please advice me~ Thank you!
0
11,387,402
07/08/2012 22:58:39
980,781
10/05/2011 16:31:37
92
0
C++ based scientific mobile application
I'm going to write scientific application for iOS/Android, possibly Windows Phone, so would like to hear your suggestions and ideas regarding such moments: 1. C++ seems the best choice, so what C++ based frameworks would you recommend? 2. Cryptography is very important, I mean not simple obfuscating, so what could be done in a C++ mobile app to achieve higher security level? Basicly application would perform some calculations, also maybe some simple visualization.
android
c++
ios
null
null
null
open
C++ based scientific mobile application === I'm going to write scientific application for iOS/Android, possibly Windows Phone, so would like to hear your suggestions and ideas regarding such moments: 1. C++ seems the best choice, so what C++ based frameworks would you recommend? 2. Cryptography is very important, I mean not simple obfuscating, so what could be done in a C++ mobile app to achieve higher security level? Basicly application would perform some calculations, also maybe some simple visualization.
0
11,387,403
07/08/2012 22:58:49
1,139,419
01/09/2012 19:14:56
34
1
InAppPurchase invalid product identifiers - Possible Reasons
It has been a long night chasing the problem within my in-app purchase trials yet I can not seem to solve this issue. Hopefully someone will point it out; (With current provisioning profile and appId I got push notifications working) 1- My App ID is generated (with no wildcards) - inApp purchase is enabled 2- My IAP(In-App Purchase) is added in "Manage your in-app purchases" and cleared for sale. 3- My IAP is added 24 hours ago ( maybe couple of hours more) and is in "Waiting For Review" state 4- My App itself is developer rejected > and it is state "ready to upload", in-app purchase is added to the App. 5- My phone is not jailbroken (at least not anymore, didn't worked either way) 6- I am working with a 3GS, 5.1 iOS. 7- My current provisioning profile is a "Developer Profile" not a "Distribution Profile". "Distribution Profile" is used only while uploading the Application Binary. 8- I am building for iOS 5.0 and build configuration is set to Debug. 9- I deleted the app like 100 times now, literally. 10- All details are set in iTunes Connect, including bank details. 11- I have created a test user, and I logged in from "Settings > Store" on my device. 12- My `SKProductRequest`: SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"com.my_site.my_app.my_product"]]; Any other information can be supplied.
iphone
ios
ios5
in-app-purchase
iap
null
open
InAppPurchase invalid product identifiers - Possible Reasons === It has been a long night chasing the problem within my in-app purchase trials yet I can not seem to solve this issue. Hopefully someone will point it out; (With current provisioning profile and appId I got push notifications working) 1- My App ID is generated (with no wildcards) - inApp purchase is enabled 2- My IAP(In-App Purchase) is added in "Manage your in-app purchases" and cleared for sale. 3- My IAP is added 24 hours ago ( maybe couple of hours more) and is in "Waiting For Review" state 4- My App itself is developer rejected > and it is state "ready to upload", in-app purchase is added to the App. 5- My phone is not jailbroken (at least not anymore, didn't worked either way) 6- I am working with a 3GS, 5.1 iOS. 7- My current provisioning profile is a "Developer Profile" not a "Distribution Profile". "Distribution Profile" is used only while uploading the Application Binary. 8- I am building for iOS 5.0 and build configuration is set to Debug. 9- I deleted the app like 100 times now, literally. 10- All details are set in iTunes Connect, including bank details. 11- I have created a test user, and I logged in from "Settings > Store" on my device. 12- My `SKProductRequest`: SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"com.my_site.my_app.my_product"]]; Any other information can be supplied.
0
11,387,418
07/08/2012 23:01:00
651,174
03/09/2011 08:26:41
2,388
60
OnBlur equivalent for select dropdown
I have a select dropdown and if a user clicks 'outside' of that select dropdown, I want it to disappear. This is what I currently have: $(this).html($("<select/>", { id: 'sel', change: function() { selectdone(this, title_id, status_type); }, blur: function() { selectdone(this, title_id, status_type); }, How would I accomplish the above, such that when a user clicks anywhere on the document outside of the select dropdown, it fires this function?
javascript
jquery
null
null
null
null
open
OnBlur equivalent for select dropdown === I have a select dropdown and if a user clicks 'outside' of that select dropdown, I want it to disappear. This is what I currently have: $(this).html($("<select/>", { id: 'sel', change: function() { selectdone(this, title_id, status_type); }, blur: function() { selectdone(this, title_id, status_type); }, How would I accomplish the above, such that when a user clicks anywhere on the document outside of the select dropdown, it fires this function?
0
11,387,419
07/08/2012 23:01:02
918,693
08/29/2011 22:54:53
24
0
Direct SQL function access or using WCF services to talk to SQL functions -- for implementing Business Rule
We have a team of Database programmers but did not had the Web programmers in the company.Thus outsourced a software development application to a third party. The Database is at our end for that software application. We are responsible for the schema of that database. The software has many web screens which should satisfy a set of business rules whenever user performs an action on the screen. We are thinking of building a set of SQL functions for this Business Rule implementation. We would expose a set of SQL function to web developers which would allow them to validate business rules and notify the user whether a particular can be done or not on the screen. Recently I read about the WCF service. You can create a set of WCF services which the web developers would use in their code to validate business rules. Should I have the web developers access the SQL functions directly or create WCF services for each business rule. These WCF services eventually would call the SQL functions in their implementation .In this case which one is the better approach 1) Direct access to SQL functions or 2) Create WCF service which would ultimately call the SQL functions Please advise
sql
wcf
null
null
null
null
open
Direct SQL function access or using WCF services to talk to SQL functions -- for implementing Business Rule === We have a team of Database programmers but did not had the Web programmers in the company.Thus outsourced a software development application to a third party. The Database is at our end for that software application. We are responsible for the schema of that database. The software has many web screens which should satisfy a set of business rules whenever user performs an action on the screen. We are thinking of building a set of SQL functions for this Business Rule implementation. We would expose a set of SQL function to web developers which would allow them to validate business rules and notify the user whether a particular can be done or not on the screen. Recently I read about the WCF service. You can create a set of WCF services which the web developers would use in their code to validate business rules. Should I have the web developers access the SQL functions directly or create WCF services for each business rule. These WCF services eventually would call the SQL functions in their implementation .In this case which one is the better approach 1) Direct access to SQL functions or 2) Create WCF service which would ultimately call the SQL functions Please advise
0
11,387,353
07/08/2012 22:50:15
334,554
05/06/2010 15:03:56
317
9
Manually Implementing string.IndexOf
I need to implement string.IndexOf functionality without using any c# string search related built in methods. Could you suggest a simple algorithm for this. Search does not involve really large strings. you can assume the maximum lenghth of the string to be search as 1000 characters.
c#
algorithm
data-structures
null
null
null
open
Manually Implementing string.IndexOf === I need to implement string.IndexOf functionality without using any c# string search related built in methods. Could you suggest a simple algorithm for this. Search does not involve really large strings. you can assume the maximum lenghth of the string to be search as 1000 characters.
0
11,387,354
07/08/2012 22:50:23
64,734
02/10/2009 19:53:12
521
17
Get default project directory in Visual Studio 2010 extension
How do I get the default project creation directory from within a Visual Studio 2010 extension? By default this directory is: C:\Users\<username>\Documents\Visual Studio 2010\Projects I'm guessing this is done via the Tools->Options window, but I don't know how to get at this via the SDK.
visual-studio-2010-sp1
visual-studio-extensions
visual-studio-sdk
null
null
null
open
Get default project directory in Visual Studio 2010 extension === How do I get the default project creation directory from within a Visual Studio 2010 extension? By default this directory is: C:\Users\<username>\Documents\Visual Studio 2010\Projects I'm guessing this is done via the Tools->Options window, but I don't know how to get at this via the SDK.
0
11,387,355
07/08/2012 22:50:31
16,828
09/17/2008 21:12:54
6,338
289
How can I export Eclipse compiler settings to a file?
In Eclipse I have exported code formatting, cleanup, import orders etc to files and checked them into svn. This is useful for my team so that they can all use the same setup. However, I can't find a way to do the same for Compiler options. There are quite a few useful settings that aren't switched on by default and its error prone for everyone to change them manually. I know that I can use FindBugs (and we do through CI) but the Eclipse compiler options are better integrated and faster.
eclipse
null
null
null
null
null
open
How can I export Eclipse compiler settings to a file? === In Eclipse I have exported code formatting, cleanup, import orders etc to files and checked them into svn. This is useful for my team so that they can all use the same setup. However, I can't find a way to do the same for Compiler options. There are quite a few useful settings that aren't switched on by default and its error prone for everyone to change them manually. I know that I can use FindBugs (and we do through CI) but the Eclipse compiler options are better integrated and faster.
0
11,567,760
07/19/2012 19:16:13
803,077
06/17/2011 10:44:47
75
4
xcode array access with IBOutletCollections. Mind-boggled.
I have 2 arrays. One is a collection of buttons. The other one should be an array of dictionaries. I am logging the length/size/count of object in the arrays in the console using [arrayListName count]: 2012-07-19 19:56:59.001 ABC[3224:707] lastest_badge_outlet_collection count: 4 2012-07-19 19:56:59.007 ABC[3224:707] badges_array count: 1 ok so when running this loop I want to populate the images with the key value 'name' from each of the dictionaries in existence in the array (that is badges_array). At the moment I have dictionary stored in that array (which is fine). However when I run this through the loop it always populates the third image along for(int i = 0; i < [lastest_badge_outlet_collection count]; i++){ UIButton *button = [lastest_badge_outlet_collection objectAtIndex:i]; if(i < [badges_array count]){ NSDictionary *badge_d = [badges_array objectAtIndex:i]; NSString *badge_d_image_string = [badge_d objectForKey:@"image"]; UIImage *badge_d_image = [UIImage imageNamed: badge_d_image_string]; [[button imageView] setImage:badge_d_image]; [[button imageView] setContentMode: UIViewContentModeScaleAspectFit]; [button setAlpha:1.0f]; } else { [button setAlpha:0.5f]; } } Theoretically it should be populating the first image. Why is it doing this? How does it decide which order the items are in the outlet collection for example... Mind boggled. I tried rewiring them to the collection 1 by 1 by wiring them up in order with no success.... Here is a screenshot. Thanks! ![mindboggled][1] [1]: http://i.stack.imgur.com/tUA55.png
xcode
arrays
uiimage
iboutletcollection
null
null
open
xcode array access with IBOutletCollections. Mind-boggled. === I have 2 arrays. One is a collection of buttons. The other one should be an array of dictionaries. I am logging the length/size/count of object in the arrays in the console using [arrayListName count]: 2012-07-19 19:56:59.001 ABC[3224:707] lastest_badge_outlet_collection count: 4 2012-07-19 19:56:59.007 ABC[3224:707] badges_array count: 1 ok so when running this loop I want to populate the images with the key value 'name' from each of the dictionaries in existence in the array (that is badges_array). At the moment I have dictionary stored in that array (which is fine). However when I run this through the loop it always populates the third image along for(int i = 0; i < [lastest_badge_outlet_collection count]; i++){ UIButton *button = [lastest_badge_outlet_collection objectAtIndex:i]; if(i < [badges_array count]){ NSDictionary *badge_d = [badges_array objectAtIndex:i]; NSString *badge_d_image_string = [badge_d objectForKey:@"image"]; UIImage *badge_d_image = [UIImage imageNamed: badge_d_image_string]; [[button imageView] setImage:badge_d_image]; [[button imageView] setContentMode: UIViewContentModeScaleAspectFit]; [button setAlpha:1.0f]; } else { [button setAlpha:0.5f]; } } Theoretically it should be populating the first image. Why is it doing this? How does it decide which order the items are in the outlet collection for example... Mind boggled. I tried rewiring them to the collection 1 by 1 by wiring them up in order with no success.... Here is a screenshot. Thanks! ![mindboggled][1] [1]: http://i.stack.imgur.com/tUA55.png
0
11,567,763
07/19/2012 19:16:23
1,499,209
07/03/2012 15:10:58
35
0
How to save drop-down list choice upon update using PHP/HTML?
I want to create a drop down list that allows the user to choose a value that is pulled from a database. When the page is updated based on the chosen value, the choice is reverted to the "original," default choice. How can I allow the selected value to save and remain when the page is updated? // Drop Down Menu to choose Session if (isset($_POST['action'])) { $action = $_POST['action']; $session = $_POST['session']; } else { $action = ""; if (!isset($_POST['session'])) { $session = ""; } else { $session = $_POST['session']; } } ?> <form name='update' action='emailinquiry_webinarnew.php' method='POST'> Session: <select name='session'> <?php $query = "SELECT distinct session FROM web_attendees"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { echo "<option>".$row['session']."</option>"; } ?> </select> <input type='submit' name="ViewButton" value='View'/> </form>
php
html
null
null
null
null
open
How to save drop-down list choice upon update using PHP/HTML? === I want to create a drop down list that allows the user to choose a value that is pulled from a database. When the page is updated based on the chosen value, the choice is reverted to the "original," default choice. How can I allow the selected value to save and remain when the page is updated? // Drop Down Menu to choose Session if (isset($_POST['action'])) { $action = $_POST['action']; $session = $_POST['session']; } else { $action = ""; if (!isset($_POST['session'])) { $session = ""; } else { $session = $_POST['session']; } } ?> <form name='update' action='emailinquiry_webinarnew.php' method='POST'> Session: <select name='session'> <?php $query = "SELECT distinct session FROM web_attendees"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { echo "<option>".$row['session']."</option>"; } ?> </select> <input type='submit' name="ViewButton" value='View'/> </form>
0
11,567,764
07/19/2012 19:16:26
744,228
05/08/2011 20:49:47
176
10
jQueryUI Tabs jumps on load
I am having an issue where the page jumps to the jqueryUI tabs whenever the page loads. For example when you go to: http://jqueryui.com/demos/tabs/#tabs-2 it jumps to the content within that tab. I want it so that the page is at the top as normal but that tab is open.
jquery-ui
jquery-ui-tabs
null
null
null
null
open
jQueryUI Tabs jumps on load === I am having an issue where the page jumps to the jqueryUI tabs whenever the page loads. For example when you go to: http://jqueryui.com/demos/tabs/#tabs-2 it jumps to the content within that tab. I want it so that the page is at the top as normal but that tab is open.
0
11,567,765
07/19/2012 19:16:29
1,503,723
07/05/2012 10:43:40
7
1
PHP Image Upload MySQL
Trying since some days to clear my Error with uploading an Image to a Folder and link to MySQL. I posted already my Problem but changed some codes thats why i want to post it again. Sorry if i spam. This is my Code "adresse-bearbeiten.php" <?php require_once ('konfiguration.php'); $target = "images/"; $target = $target . basename( $_FILES['photo']['name']); function sanitize( $input ){ return mysql_real_escape_string( htmlspecialchars( stripslashes( trim( $input ) ) ) ); } if(isset($_POST['title'])) { $title = sanitize($_POST['title']); $description = sanitize($_POST['description']); $applepart = sanitize($_POST['applepart']); $partnumber = sanitize($_POST['partnumber']); $productcode = sanitize($_POST['productcode']); $compatibility = sanitize($_POST['compatibility']); $image = sanitize($_FILES['photo']['name']); $price = sanitize($_POST['price']); $insert = mysql_query("INSERT INTO `adressbuch` (`title`,`description`,`applepart`,`partnumber`,`productcode`,`compatibility`,`photo`,`price`) VALUES ('$title','$description','$applepart','$partnumber','$productcode','$compatibility','$image','$price')"); if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['photo']['name']). " has been uploaded, and your information has been added to the directory"; } else { echo "Sorry, there was a problem uploading your file."; } if (!$insert) { die('Not saved: ' . mysql_error()); } } ?> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <span>Neuer Eintrag:</span> <br /> <span>Title</span><input type="text" name="title" /> <br /> <span>Description</span><textarea cols="16" rows="5" name="description"></textarea> <br /> <span>Apple Part</span><input type="text" name="applepart" /> <br /> <span>Part Number</span><input type="text" name="partnumber" /> <br /> <span>Product Code</span><input type="text" name="productcode" /> <br /> <span>Compatibility</span><input type="text" name="compatibility" /> <br /> <span>Image</span><input type="file" name="photo" /> <br /> <span>Price</span><input type="text" name="price" /> <br /> <input type="submit" value="Speichern"/> <br /> </form> The MySQL CREATE TABLE IF NOT EXISTS `adressbuch` ( `id` int(10) NOT NULL AUTO_INCREMENT, `title` text, `description` text, `applepart` text, `partnumber` text, `productcode` text, `compatibility` text, `photo` text, `price` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ; The Errors i get is listed below - Notice: Undefined index: photo in /Users/fatih/Sites/phpform/neu/adresse-bearbeiten.php on line 11 - Notice: Undefined index: photo in /Users/fatih/Sites/phpform/neu/adresse-bearbeiten.php on line 18 - Notice: Undefined index: photo in /Users/fatih/Sites/phpform/neu/adresse-bearbeiten.php on line 23 - Sorry, there was a problem uploading your file. Would be happy if someone can tell me what am i doing wrong? Regards
php
mysql
image
upload
null
null
open
PHP Image Upload MySQL === Trying since some days to clear my Error with uploading an Image to a Folder and link to MySQL. I posted already my Problem but changed some codes thats why i want to post it again. Sorry if i spam. This is my Code "adresse-bearbeiten.php" <?php require_once ('konfiguration.php'); $target = "images/"; $target = $target . basename( $_FILES['photo']['name']); function sanitize( $input ){ return mysql_real_escape_string( htmlspecialchars( stripslashes( trim( $input ) ) ) ); } if(isset($_POST['title'])) { $title = sanitize($_POST['title']); $description = sanitize($_POST['description']); $applepart = sanitize($_POST['applepart']); $partnumber = sanitize($_POST['partnumber']); $productcode = sanitize($_POST['productcode']); $compatibility = sanitize($_POST['compatibility']); $image = sanitize($_FILES['photo']['name']); $price = sanitize($_POST['price']); $insert = mysql_query("INSERT INTO `adressbuch` (`title`,`description`,`applepart`,`partnumber`,`productcode`,`compatibility`,`photo`,`price`) VALUES ('$title','$description','$applepart','$partnumber','$productcode','$compatibility','$image','$price')"); if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['photo']['name']). " has been uploaded, and your information has been added to the directory"; } else { echo "Sorry, there was a problem uploading your file."; } if (!$insert) { die('Not saved: ' . mysql_error()); } } ?> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <span>Neuer Eintrag:</span> <br /> <span>Title</span><input type="text" name="title" /> <br /> <span>Description</span><textarea cols="16" rows="5" name="description"></textarea> <br /> <span>Apple Part</span><input type="text" name="applepart" /> <br /> <span>Part Number</span><input type="text" name="partnumber" /> <br /> <span>Product Code</span><input type="text" name="productcode" /> <br /> <span>Compatibility</span><input type="text" name="compatibility" /> <br /> <span>Image</span><input type="file" name="photo" /> <br /> <span>Price</span><input type="text" name="price" /> <br /> <input type="submit" value="Speichern"/> <br /> </form> The MySQL CREATE TABLE IF NOT EXISTS `adressbuch` ( `id` int(10) NOT NULL AUTO_INCREMENT, `title` text, `description` text, `applepart` text, `partnumber` text, `productcode` text, `compatibility` text, `photo` text, `price` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ; The Errors i get is listed below - Notice: Undefined index: photo in /Users/fatih/Sites/phpform/neu/adresse-bearbeiten.php on line 11 - Notice: Undefined index: photo in /Users/fatih/Sites/phpform/neu/adresse-bearbeiten.php on line 18 - Notice: Undefined index: photo in /Users/fatih/Sites/phpform/neu/adresse-bearbeiten.php on line 23 - Sorry, there was a problem uploading your file. Would be happy if someone can tell me what am i doing wrong? Regards
0
11,567,767
07/19/2012 19:16:40
1,535,210
07/18/2012 14:50:49
1
0
Limit to the number switch/if options?
**Small disclaimer** I am new to Java and this is my first real programme i am trying to write. I am currently writing a programme with 3 class's. The first is a GUI with a JComboBox, 4 JButtons and 20 JTextFields. The second takes information from the JComboBox box and uses it to give labels to the 4 JButtons using a set of if statements. The third populates the JTextFields when one of the the JButtons is clicked depending on the button clicked and the choice in the JComboBox using a set of switch statements. The first 2 class's work fine and the third works fine until i enter x amount of switches and then i start to get an error. A small example of my code for the third class is switch (hiddenText) { case "Abecean Longfin": if (command.equals("Weakness to Frost")){ gui.r1.setText("Elves Ear"); gui.r2.setText("Fire Salts"); gui.r3.setText("Ice Wraith Teeth"); gui.r4.setText("White Cap"); gui.r5.setText(""); gui.r6.setText(""); gui.r7.setText(""); gui.r8.setText(""); gui.r9.setText(""); gui.r10.setText(""); gui.r11.setText(""); gui.r12.setText(""); gui.r13.setText(""); gui.r14.setText(""); gui.r15.setText(""); gui.r16.setText(""); gui.r17.setText(""); gui.r18.setText(""); gui.r19.setText(""); gui.r20.setText(""); } if (command.equals("Fortify Sneak")){ gui.r1.setText("Beehive Husk"); gui.r2.setText("Frost Mirriam"); gui.r3.setText("Hawk Feathers"); gui.r4.setText("Human Flesh"); gui.r5.setText("Powdered Mammoth Tusk"); gui.r6.setText("Purple Mountain Flower"); gui.r7.setText(""); gui.r8.setText(""); gui.r9.setText(""); gui.r10.setText(""); gui.r11.setText(""); gui.r12.setText(""); gui.r13.setText(""); gui.r14.setText(""); gui.r15.setText(""); gui.r16.setText(""); gui.r17.setText(""); gui.r18.setText(""); gui.r19.setText(""); gui.r20.setText(""); } if (command.equals("Weakness to Poison")){ gui.r1.setText("Bleeding Crown"); gui.r2.setText("Chaurus Eggs"); gui.r3.setText("Deathbell"); gui.r4.setText("Giant Lichen"); gui.r5.setText("Pine Thrush Egg"); gui.r6.setText("Sabre Cat Tooth"); gui.r7.setText("Small Antlers"); gui.r8.setText(""); gui.r9.setText(""); gui.r10.setText(""); gui.r11.setText(""); gui.r12.setText(""); gui.r13.setText(""); gui.r14.setText(""); gui.r15.setText(""); gui.r16.setText(""); gui.r17.setText(""); gui.r18.setText(""); gui.r19.setText(""); gui.r20.setText(""); } if (command.equals("Fortify Restoration")){ gui.r1.setText("Cyrodilic Spadetail"); gui.r2.setText("Salt Pile"); gui.r3.setText("Small Antlers"); gui.r4.setText("Small Pearl"); gui.r5.setText(""); gui.r6.setText(""); gui.r7.setText(""); gui.r8.setText(""); gui.r9.setText(""); gui.r10.setText(""); gui.r11.setText(""); gui.r12.setText(""); gui.r13.setText(""); gui.r14.setText(""); gui.r15.setText(""); gui.r16.setText(""); gui.r17.setText(""); gui.r18.setText(""); gui.r19.setText(""); gui.r20.setText(""); } break; There are a total of 92 cases, each with 4 if statements and the programme works fine until i get to 57 cases and 2 if statements then i get an error symbol in the class tab title in IDE (using NetBeans) but not within the code itself. When i compile and run the code i get an error box appearing saying "One or more projects compiled with errors" but if i choose to run anyway the programme will run fine as far as i have seen. I have tried writing the code in various ways.e.g. originally using if statements and originally having class 2 and 3 as the same class and i always get this error at reaching x amount of choices. In previous versions i would sometimes get the error symbol appear in the class tab title in the IDE and not within the code as usual but when trying to run the programme it wouldn 't run at all and gave some classpath error which i can't seem to reproduce now so can't post the exact code. From the testing i have done.e.g. removing different sections of code it appears that it happens when x amount of choices are added.i.e. i can add the 52nd case and 3rd if statement and the error appears but if i remove a previous if statement so there are 52 cases and 2 if statements still then everything if fine. From experimenting it would seem there is a limit to the amount of switches/if statements i can use although from looking around i could in theory have an infinite amount? So my question is, is there a limit to the amount of switches/if statements i can use or is there something else going on which is causing an error when i enter x number of switches/if statements?
java
null
null
null
null
null
open
Limit to the number switch/if options? === **Small disclaimer** I am new to Java and this is my first real programme i am trying to write. I am currently writing a programme with 3 class's. The first is a GUI with a JComboBox, 4 JButtons and 20 JTextFields. The second takes information from the JComboBox box and uses it to give labels to the 4 JButtons using a set of if statements. The third populates the JTextFields when one of the the JButtons is clicked depending on the button clicked and the choice in the JComboBox using a set of switch statements. The first 2 class's work fine and the third works fine until i enter x amount of switches and then i start to get an error. A small example of my code for the third class is switch (hiddenText) { case "Abecean Longfin": if (command.equals("Weakness to Frost")){ gui.r1.setText("Elves Ear"); gui.r2.setText("Fire Salts"); gui.r3.setText("Ice Wraith Teeth"); gui.r4.setText("White Cap"); gui.r5.setText(""); gui.r6.setText(""); gui.r7.setText(""); gui.r8.setText(""); gui.r9.setText(""); gui.r10.setText(""); gui.r11.setText(""); gui.r12.setText(""); gui.r13.setText(""); gui.r14.setText(""); gui.r15.setText(""); gui.r16.setText(""); gui.r17.setText(""); gui.r18.setText(""); gui.r19.setText(""); gui.r20.setText(""); } if (command.equals("Fortify Sneak")){ gui.r1.setText("Beehive Husk"); gui.r2.setText("Frost Mirriam"); gui.r3.setText("Hawk Feathers"); gui.r4.setText("Human Flesh"); gui.r5.setText("Powdered Mammoth Tusk"); gui.r6.setText("Purple Mountain Flower"); gui.r7.setText(""); gui.r8.setText(""); gui.r9.setText(""); gui.r10.setText(""); gui.r11.setText(""); gui.r12.setText(""); gui.r13.setText(""); gui.r14.setText(""); gui.r15.setText(""); gui.r16.setText(""); gui.r17.setText(""); gui.r18.setText(""); gui.r19.setText(""); gui.r20.setText(""); } if (command.equals("Weakness to Poison")){ gui.r1.setText("Bleeding Crown"); gui.r2.setText("Chaurus Eggs"); gui.r3.setText("Deathbell"); gui.r4.setText("Giant Lichen"); gui.r5.setText("Pine Thrush Egg"); gui.r6.setText("Sabre Cat Tooth"); gui.r7.setText("Small Antlers"); gui.r8.setText(""); gui.r9.setText(""); gui.r10.setText(""); gui.r11.setText(""); gui.r12.setText(""); gui.r13.setText(""); gui.r14.setText(""); gui.r15.setText(""); gui.r16.setText(""); gui.r17.setText(""); gui.r18.setText(""); gui.r19.setText(""); gui.r20.setText(""); } if (command.equals("Fortify Restoration")){ gui.r1.setText("Cyrodilic Spadetail"); gui.r2.setText("Salt Pile"); gui.r3.setText("Small Antlers"); gui.r4.setText("Small Pearl"); gui.r5.setText(""); gui.r6.setText(""); gui.r7.setText(""); gui.r8.setText(""); gui.r9.setText(""); gui.r10.setText(""); gui.r11.setText(""); gui.r12.setText(""); gui.r13.setText(""); gui.r14.setText(""); gui.r15.setText(""); gui.r16.setText(""); gui.r17.setText(""); gui.r18.setText(""); gui.r19.setText(""); gui.r20.setText(""); } break; There are a total of 92 cases, each with 4 if statements and the programme works fine until i get to 57 cases and 2 if statements then i get an error symbol in the class tab title in IDE (using NetBeans) but not within the code itself. When i compile and run the code i get an error box appearing saying "One or more projects compiled with errors" but if i choose to run anyway the programme will run fine as far as i have seen. I have tried writing the code in various ways.e.g. originally using if statements and originally having class 2 and 3 as the same class and i always get this error at reaching x amount of choices. In previous versions i would sometimes get the error symbol appear in the class tab title in the IDE and not within the code as usual but when trying to run the programme it wouldn 't run at all and gave some classpath error which i can't seem to reproduce now so can't post the exact code. From the testing i have done.e.g. removing different sections of code it appears that it happens when x amount of choices are added.i.e. i can add the 52nd case and 3rd if statement and the error appears but if i remove a previous if statement so there are 52 cases and 2 if statements still then everything if fine. From experimenting it would seem there is a limit to the amount of switches/if statements i can use although from looking around i could in theory have an infinite amount? So my question is, is there a limit to the amount of switches/if statements i can use or is there something else going on which is causing an error when i enter x number of switches/if statements?
0
11,567,773
07/19/2012 19:16:55
731,136
04/29/2011 13:21:54
558
27
select multiple images with pagination in jQuery
I wonder if anyone knows a jQuery plugin that meets the following characteristics: - It show a list of images. - This list can be paged (to avoid the scroll bar appears). - It can select multiple images (with checkbox or in other way). I found options like these: - [multiselect][1]: but it contains the scrollbar and the resulting size is too small, I need adjust better size (especially in width). - [fcbklistselection][2]: it has similar "disadvantages". Thanks in advance. [1]: http://loudev.com/#demos [2]: http://www.emposha.com/javascript/fcbklistselection-like-facebook-friends-selector.html
jquery
jquery-ui
jquery-plugins
null
null
null
open
select multiple images with pagination in jQuery === I wonder if anyone knows a jQuery plugin that meets the following characteristics: - It show a list of images. - This list can be paged (to avoid the scroll bar appears). - It can select multiple images (with checkbox or in other way). I found options like these: - [multiselect][1]: but it contains the scrollbar and the resulting size is too small, I need adjust better size (especially in width). - [fcbklistselection][2]: it has similar "disadvantages". Thanks in advance. [1]: http://loudev.com/#demos [2]: http://www.emposha.com/javascript/fcbklistselection-like-facebook-friends-selector.html
0
11,567,778
07/19/2012 19:17:18
1,241,519
03/01/2012 00:05:13
149
6
Handler.postDelayed() causing huge heap size of android.os.message
Hi i have multiple handlers in my app and after playing for around 5 minutes the retained heap size of android.os.message is 10mb. How can i fix this problem?
android
memory
memory-leaks
handler
null
null
open
Handler.postDelayed() causing huge heap size of android.os.message === Hi i have multiple handlers in my app and after playing for around 5 minutes the retained heap size of android.os.message is 10mb. How can i fix this problem?
0
11,567,779
07/19/2012 19:17:20
1,037,200
11/09/2011 08:21:53
169
9
CLI support for App Store app
Is there a way to add a command line interface to a _sandboxed_ app downloaded through the Mac AppStore? Something similar to the XCode command line tools, do not just use the whole executable name and path.
objective-c
osx
cocoa
app-store
cli
null
open
CLI support for App Store app === Is there a way to add a command line interface to a _sandboxed_ app downloaded through the Mac AppStore? Something similar to the XCode command line tools, do not just use the whole executable name and path.
0
11,567,783
07/19/2012 19:17:22
1,121,845
12/29/2011 20:05:28
16
2
Can the Powershell runspace pool establish a remote connection and load a snap-in?
I'm working on a multi-tenant SharePoint provisioning application and plan to use Powershell for most of the provisioning. I would like to use remote Powershell to invoke my cmdlets from a server that does not have SharePoint installed. However, before I can run any of the SharePoint cmdlets the SharePoint snap-in must be loaded into the runspace. Unfortunately, I can't find a way to provide both the connection info and the snap-in when creating the runspace pool. Runspace pool with connection Dim connectionUrl = New Uri(String.Format("http://{0}/PowerShell/", remoteServer)) Dim connectionInfo = New WSManConnectionInfo(connectionUrl) Me._runspacePool = RunspaceFactory.CreateRunspacePool(10, 20, connectionInfo) Runspace pool with snap-in Dim sessionState = InitialSessionState.Create("Microsoft.Sharepoint.Powershell") Me._runspacePool = RunspaceFactory.CreateRunspacePool(sessionState) Does anyone know of a way to do this?
sharepoint
powershell
powershell-v2.0
null
null
null
open
Can the Powershell runspace pool establish a remote connection and load a snap-in? === I'm working on a multi-tenant SharePoint provisioning application and plan to use Powershell for most of the provisioning. I would like to use remote Powershell to invoke my cmdlets from a server that does not have SharePoint installed. However, before I can run any of the SharePoint cmdlets the SharePoint snap-in must be loaded into the runspace. Unfortunately, I can't find a way to provide both the connection info and the snap-in when creating the runspace pool. Runspace pool with connection Dim connectionUrl = New Uri(String.Format("http://{0}/PowerShell/", remoteServer)) Dim connectionInfo = New WSManConnectionInfo(connectionUrl) Me._runspacePool = RunspaceFactory.CreateRunspacePool(10, 20, connectionInfo) Runspace pool with snap-in Dim sessionState = InitialSessionState.Create("Microsoft.Sharepoint.Powershell") Me._runspacePool = RunspaceFactory.CreateRunspacePool(sessionState) Does anyone know of a way to do this?
0
11,567,786
07/19/2012 19:17:28
432,354
08/26/2010 21:11:43
336
9
Global Plugins in Gradle
I am using Gradle as a build tool for my Scala projects. I am also using Eclipse for development, so I always use the `apply plugin: 'eclipse'` in my build files. Is there also a way to define the `apply plugin` globally? SBT already has [such a feature](https://github.com/harrah/xsbt/wiki/Getting-Started-Using-Plugins). The reason why I want this, is that other developers who’re using my project probably don’t use Eclipse but another IDE and they would have to change the build script for their needs. If there were a global configuration file, one could put personal configurations in there and it wouldn’t conflict other ones.
plugins
gradle
null
null
null
null
open
Global Plugins in Gradle === I am using Gradle as a build tool for my Scala projects. I am also using Eclipse for development, so I always use the `apply plugin: 'eclipse'` in my build files. Is there also a way to define the `apply plugin` globally? SBT already has [such a feature](https://github.com/harrah/xsbt/wiki/Getting-Started-Using-Plugins). The reason why I want this, is that other developers who’re using my project probably don’t use Eclipse but another IDE and they would have to change the build script for their needs. If there were a global configuration file, one could put personal configurations in there and it wouldn’t conflict other ones.
0
11,350,137
07/05/2012 18:14:43
627,473
03/01/2010 16:37:51
2,395
35
Core Data, storing html in string type
How much info will String data type allow me to store? I am looking to store full html text. Is this possible/recommended?
core-data
null
null
null
null
null
open
Core Data, storing html in string type === How much info will String data type allow me to store? I am looking to store full html text. Is this possible/recommended?
0
11,350,145
07/05/2012 18:15:19
1,340,048
04/18/2012 00:36:15
1
0
Are there simple descriptions on port forwarding using python?
I can do simply socket communication on the same machine using server: import socket s = socket.socket() host = socket.socket() port = 8000 s.bind((host,port)) s.listen(5) while true: c,addr = s.accept() print 'got connection from', addr c.send('thank you for connecting') c.close() client: import socket s = socket.socket() host=socket.gethostname() port = 8000 s.connect((host,port)) print s.recv(1024) What changes would need to be made have this communicate between my laptop and a private server I work on? I have figured from my searching that portforwarding is the best way to go about it but haven't found any explanations or tutorials on how to go about it. thank you
python
sockets
networking
port
null
null
open
Are there simple descriptions on port forwarding using python? === I can do simply socket communication on the same machine using server: import socket s = socket.socket() host = socket.socket() port = 8000 s.bind((host,port)) s.listen(5) while true: c,addr = s.accept() print 'got connection from', addr c.send('thank you for connecting') c.close() client: import socket s = socket.socket() host=socket.gethostname() port = 8000 s.connect((host,port)) print s.recv(1024) What changes would need to be made have this communicate between my laptop and a private server I work on? I have figured from my searching that portforwarding is the best way to go about it but haven't found any explanations or tutorials on how to go about it. thank you
0
11,350,153
07/05/2012 18:16:03
236,220
12/21/2009 17:41:45
315
12
How to retain values in yii after submit
Doing a search form in PHP YII in which i need to enter 2 dates field Startdate and enddate, after submitting i will be fetching all the records from table where the contacteddate falls between these start and end date. The problem is after submitting my textbox values are vanishing. How to retain after submitting?
php
yii
null
null
null
null
open
How to retain values in yii after submit === Doing a search form in PHP YII in which i need to enter 2 dates field Startdate and enddate, after submitting i will be fetching all the records from table where the contacteddate falls between these start and end date. The problem is after submitting my textbox values are vanishing. How to retain after submitting?
0
11,350,154
07/05/2012 18:16:05
1,389,697
05/11/2012 14:42:51
31
0
Grails remoteFunction updating view using templates which has Jquery does recognize elements from templates
I have a view with a button, and when it is clicked it calls remoteFunction(ajax Call) to update a div with a template which has jQuery function associated with it. But that jQuery function does not recognize the elements in the updated div. So the jQuery function is not working correctly to render the view.<br> **My view** looks like <input type="button" value="Something" id="someButton" class="button" onclick="someFunction()"/> <div id="updateDiv"> </div> And **js** called when the button is clicked looks like function someFunction() { ${remoteFunction(controller:'myController, action:'someAction',update: 'updateDiv' )}; functionForJQuery(); } function functionForJQuery(){ var $someThing = $('.someClassName'); } In **myController**, def someAction= { //doSomething render (view:"/templates/_myTemplate") } Finally **_myTemplatetemplate**, <g:textField class="someClassName" value="someValue" /> But like I said above, when functionForJquery is called, it does not recognize that textField. Can somebody help me with this, please?
jquery
ajax
templates
grails
null
null
open
Grails remoteFunction updating view using templates which has Jquery does recognize elements from templates === I have a view with a button, and when it is clicked it calls remoteFunction(ajax Call) to update a div with a template which has jQuery function associated with it. But that jQuery function does not recognize the elements in the updated div. So the jQuery function is not working correctly to render the view.<br> **My view** looks like <input type="button" value="Something" id="someButton" class="button" onclick="someFunction()"/> <div id="updateDiv"> </div> And **js** called when the button is clicked looks like function someFunction() { ${remoteFunction(controller:'myController, action:'someAction',update: 'updateDiv' )}; functionForJQuery(); } function functionForJQuery(){ var $someThing = $('.someClassName'); } In **myController**, def someAction= { //doSomething render (view:"/templates/_myTemplate") } Finally **_myTemplatetemplate**, <g:textField class="someClassName" value="someValue" /> But like I said above, when functionForJquery is called, it does not recognize that textField. Can somebody help me with this, please?
0
11,350,161
07/05/2012 18:16:35
1,234,081
02/26/2012 16:52:46
11
0
JFrame in java jframe.add(button);
I have to write: jframe.getContentPane().add(button); But I found out that it also works when I only write jframe.add(button); What are the differences between the two approaches? Is it favorable to write JFrame.getContentPane().add(button); ?
swing
null
null
null
null
null
open
JFrame in java jframe.add(button); === I have to write: jframe.getContentPane().add(button); But I found out that it also works when I only write jframe.add(button); What are the differences between the two approaches? Is it favorable to write JFrame.getContentPane().add(button); ?
0