PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 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 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,706,812 | 07/29/2012 05:01:34 | 1,169,349 | 01/25/2012 13:53:30 | 323 | 16 | Is the book "Expert One-on-One J2EE Design and Development" still worth it? | I am Java SE developer, and I am try to start with Java EE.
I came across the book "Expert One-on-One J2EE Design and Development", and it got excellent reviews, but I see it was published in 2002.
My gut tells me I should not bother, since everything changes so quickly regarding software...
Is there anybody that maybe owns this book that can give me good advice?
Is it still worth reading?
Thank you
| java | books | java-ee-6 | null | null | 07/29/2012 05:59:20 | not constructive | Is the book "Expert One-on-One J2EE Design and Development" still worth it?
===
I am Java SE developer, and I am try to start with Java EE.
I came across the book "Expert One-on-One J2EE Design and Development", and it got excellent reviews, but I see it was published in 2002.
My gut tells me I should not bother, since everything changes so quickly regarding software...
Is there anybody that maybe owns this book that can give me good advice?
Is it still worth reading?
Thank you
| 4 |
7,986,712 | 11/02/2011 20:10:22 | 1,026,423 | 11/02/2011 20:03:55 | 1 | 0 | Java , how to find white square in the picture | I have to write app which get jpeg from me and tells if there is **white square with black letters/numbers** etc or there isn't any of them. What is easiest way to do it ? I read a lot about transformations of pictures (Binarization etc) than using Hough trans. to find lines or something but.. is it the right way of thinking ? Maybe there is better way to find that object in java ? | java | image-recognition | null | null | null | 11/02/2011 20:35:17 | not a real question | Java , how to find white square in the picture
===
I have to write app which get jpeg from me and tells if there is **white square with black letters/numbers** etc or there isn't any of them. What is easiest way to do it ? I read a lot about transformations of pictures (Binarization etc) than using Hough trans. to find lines or something but.. is it the right way of thinking ? Maybe there is better way to find that object in java ? | 1 |
9,322,710 | 02/17/2012 04:01:33 | 1,215,071 | 02/16/2012 23:45:24 | 1 | 0 | Why is my site's flaoted sidebar collapsing? | I floated the sidebar on my site and it seems to collapse down from the main content section? How do I go about keep it at the same level?
My site: bryanseacrest.com | html | css | null | null | null | 02/18/2012 13:28:22 | not a real question | Why is my site's flaoted sidebar collapsing?
===
I floated the sidebar on my site and it seems to collapse down from the main content section? How do I go about keep it at the same level?
My site: bryanseacrest.com | 1 |
7,651 | 08/11/2008 10:04:32 | 381 | 08/05/2008 10:39:26 | 504 | 10 | Perl - how do I remove duplicate items from an array ? | I have an array in Perl:
@my_array = ("one","two","three","two","three")
How do I remove the duplicates from the array ? | perl | beginner | null | null | null | null | open | Perl - how do I remove duplicate items from an array ?
===
I have an array in Perl:
@my_array = ("one","two","three","two","three")
How do I remove the duplicates from the array ? | 0 |
8,730,952 | 01/04/2012 17:12:32 | 66,584 | 02/15/2009 05:51:32 | 735 | 32 | What to make with C++ to learn the language? | I grew up with high level languages like AS3, Java, Javascript, etc and my furthest exploration of C is playing around with Arduinos occasionally. I've been meaning to teach myself C++, but I can't figure out *what* to make to really start learning the ins and outs and keep myself motivated. Something ambitious to keep me interested, yet simple enough that I can Google through errors and instructions.
Any suggestions? | c++ | null | null | null | null | 01/04/2012 17:18:45 | off topic | What to make with C++ to learn the language?
===
I grew up with high level languages like AS3, Java, Javascript, etc and my furthest exploration of C is playing around with Arduinos occasionally. I've been meaning to teach myself C++, but I can't figure out *what* to make to really start learning the ins and outs and keep myself motivated. Something ambitious to keep me interested, yet simple enough that I can Google through errors and instructions.
Any suggestions? | 2 |
6,656,546 | 07/11/2011 21:04:13 | 745,666 | 05/09/2011 18:46:07 | 20 | 1 | Is there a belongs_to 'sometimes' concept in rails? | I have an application where there are Products and a Cart. The Products will only belong_to the cart after they have been added to the Cart, and then the Cart will has_many Products. But before Products are added to the Cart, they are just in a stand alone model without associations. How do I capture this in rails?
I am confused about whether I should add the cart_id to the Products table, if they will only belong_to the Cart if and when they are added? | ruby-on-rails-3 | null | null | null | null | null | open | Is there a belongs_to 'sometimes' concept in rails?
===
I have an application where there are Products and a Cart. The Products will only belong_to the cart after they have been added to the Cart, and then the Cart will has_many Products. But before Products are added to the Cart, they are just in a stand alone model without associations. How do I capture this in rails?
I am confused about whether I should add the cart_id to the Products table, if they will only belong_to the Cart if and when they are added? | 0 |
10,966,526 | 06/10/2012 05:17:33 | 1,243,679 | 03/01/2012 20:37:25 | 132 | 12 | I get 500 Internal Server Error when opening a python file on the browser | I can't get my python files to open. I am new at using python, I come from a PHP background and this is completely different for me.
I created a test file on the server `public_html/python/index.py' with a simple hello world code:
#!/usr/bin/python
print 'Content-type: text/html'
print ''
print 'Hello, World!'
I have been looking around and apparenlty I needed to do some configuration steps in order to run python files.
On shell y made sure that python is installed by running `python` and worked:
Python 2.4.3 (#1, Feb 22 2012, 16:05:45)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Then I looked for the correct path where python was instsalled `type -p python` and it is correct:
user@domain.com [~]# type -p python
/usr/bin/python
Finally I read in a blog that in order to execute python files oustide the cgi-bin folder I needed to modify my .htaccess file with the following lines:
Options +ExecCGI
AddHandler cgi-script .cgi .pl .py
This didn't work either, but even if I try to run it inside the `cgi-bin` folder I still get the same error.
Just in case I also changed the permissions of the file, and nothing:
user@domain.com [~]# chmod a+x public_html/python/index.py
After all of this I still get a 500 Internal Server Error when I try to open the url on the web browser.
Thanks for the help and guidance to this humble python newbie.
BTW I am using WHM and CPanel in a dedicated server. | python | apache | server-configuration | null | null | 06/11/2012 02:12:46 | off topic | I get 500 Internal Server Error when opening a python file on the browser
===
I can't get my python files to open. I am new at using python, I come from a PHP background and this is completely different for me.
I created a test file on the server `public_html/python/index.py' with a simple hello world code:
#!/usr/bin/python
print 'Content-type: text/html'
print ''
print 'Hello, World!'
I have been looking around and apparenlty I needed to do some configuration steps in order to run python files.
On shell y made sure that python is installed by running `python` and worked:
Python 2.4.3 (#1, Feb 22 2012, 16:05:45)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Then I looked for the correct path where python was instsalled `type -p python` and it is correct:
user@domain.com [~]# type -p python
/usr/bin/python
Finally I read in a blog that in order to execute python files oustide the cgi-bin folder I needed to modify my .htaccess file with the following lines:
Options +ExecCGI
AddHandler cgi-script .cgi .pl .py
This didn't work either, but even if I try to run it inside the `cgi-bin` folder I still get the same error.
Just in case I also changed the permissions of the file, and nothing:
user@domain.com [~]# chmod a+x public_html/python/index.py
After all of this I still get a 500 Internal Server Error when I try to open the url on the web browser.
Thanks for the help and guidance to this humble python newbie.
BTW I am using WHM and CPanel in a dedicated server. | 2 |
7,145,718 | 08/22/2011 09:55:14 | 905,397 | 08/22/2011 07:23:16 | 1 | 0 | Can Ninject inject a class and make it reference the target class as a back reference? | I want to inject a presenter into my webform class. While doing so I would like the injected presenter to contain a reference to the view it is being injected into. Inject a class with a reference to the class it is injected into. Is it possible to do this with Ninject? When injecting into a webforms class, is the injection performed before the constructor is executed? Should I rather just inject the presenter and use the constructor to pass the view? | webforms | ninject | presenter | ninject.web | null | null | open | Can Ninject inject a class and make it reference the target class as a back reference?
===
I want to inject a presenter into my webform class. While doing so I would like the injected presenter to contain a reference to the view it is being injected into. Inject a class with a reference to the class it is injected into. Is it possible to do this with Ninject? When injecting into a webforms class, is the injection performed before the constructor is executed? Should I rather just inject the presenter and use the constructor to pass the view? | 0 |
9,436,885 | 02/24/2012 19:32:35 | 1,215,938 | 02/17/2012 10:07:27 | 1 | 0 | Ruby (on Rails) arrays in array | How to create an array with Ruby (on Rails) in this form:
###[[0,5], [1,5], [3,7]]### | ruby-on-rails | ruby | arrays | null | null | 02/24/2012 20:36:24 | not a real question | Ruby (on Rails) arrays in array
===
How to create an array with Ruby (on Rails) in this form:
###[[0,5], [1,5], [3,7]]### | 1 |
9,619,634 | 03/08/2012 14:58:02 | 1,209,188 | 02/14/2012 13:38:05 | 5 | 0 | How to make a C program interact with web browser? | Objective is to create a windows program in C which can send strings of data to browser and vice versa. I know it can be done with Websocket but I am not able to find any example code for a simple websocket server written in C.
Can anyone tell me how to write a simple web socket server program in C ? When I say simple, I mean, there is no need for concurrency or anything. And the Client will be browser which will connect to the server using javascript.
Is there is any way other than Websockets to achieve this objective ? There are lots of other things for duplex communication with browser but none are in C or for windows.
If you can point me to any tutorial related to my objective, that would be great. (I have gone thru almost every tutorial google offered. All were in C++ (with complex concurrency) or in other languages like PHP, Js, etc.) ..
If there is a way to use js or php or ruby websocket or Socket.Io code inside C program, please let me know.
Thankyou | c | windows | browser | websocket | null | 03/09/2012 01:42:16 | not a real question | How to make a C program interact with web browser?
===
Objective is to create a windows program in C which can send strings of data to browser and vice versa. I know it can be done with Websocket but I am not able to find any example code for a simple websocket server written in C.
Can anyone tell me how to write a simple web socket server program in C ? When I say simple, I mean, there is no need for concurrency or anything. And the Client will be browser which will connect to the server using javascript.
Is there is any way other than Websockets to achieve this objective ? There are lots of other things for duplex communication with browser but none are in C or for windows.
If you can point me to any tutorial related to my objective, that would be great. (I have gone thru almost every tutorial google offered. All were in C++ (with complex concurrency) or in other languages like PHP, Js, etc.) ..
If there is a way to use js or php or ruby websocket or Socket.Io code inside C program, please let me know.
Thankyou | 1 |
6,302,661 | 06/10/2011 06:20:04 | 792,221 | 06/10/2011 06:20:04 | 1 | 0 | jQuery capture href (heatmap/usability) | I want to create a heatmap from mousedown event, but before this i need to capture the A element on a website. Does anyone know how i could achieve this?
in short:
if i click a link it should be doing the following:
1. capture the link.
2. wait for $.POST/AJAX request.
3. go to the link | jquery | ajax | usability | href | heatmap | null | open | jQuery capture href (heatmap/usability)
===
I want to create a heatmap from mousedown event, but before this i need to capture the A element on a website. Does anyone know how i could achieve this?
in short:
if i click a link it should be doing the following:
1. capture the link.
2. wait for $.POST/AJAX request.
3. go to the link | 0 |
4,845,627 | 01/30/2011 21:23:32 | 143,741 | 07/23/2009 13:45:46 | 13 | 0 | Areas of research related to algorithms operating on volume data | I am writing a masters thesis and would like some input from people who are knowledgeable about one or more of these fields: AI, computer vision, volume graphics, segmentation (3D), feature extraction (3D) image registration (3D) or other interesting challenges related to algorithms operating on 3D grids / volumes / scalar fields. I would especially like to hear from people working with medical imaging.
I am still in the process of narrowing down my area of research and would therefore like some input on areas that people feel are not addressed sufficiently at the moment. For instance, if your area of expertise is the segmentation of volumes, what needs to be improved? What types of features would you like to add? Are volume segmentation systems "mature" and pretty much perfected, or is there still active progress being made?
I know game developers have an increasing interest in voxel graphics (Sparse Voxel Octrees etc). Research related to voxel graphics in games could also be of interest, but I don't really see myself competing with the highly skilled professionals in that field. What I am looking for are niches that perhaps are less cool and less profitable than what game developers and others focus on, but that still could be useful and rewarding to work on.
Any and all suggestions for research topics related to algorithms operating on volume data are very welcome.
Thank you for your time. | thesis | segmentation | feature-extraction | voxels | volumes | 09/26/2011 05:29:05 | off topic | Areas of research related to algorithms operating on volume data
===
I am writing a masters thesis and would like some input from people who are knowledgeable about one or more of these fields: AI, computer vision, volume graphics, segmentation (3D), feature extraction (3D) image registration (3D) or other interesting challenges related to algorithms operating on 3D grids / volumes / scalar fields. I would especially like to hear from people working with medical imaging.
I am still in the process of narrowing down my area of research and would therefore like some input on areas that people feel are not addressed sufficiently at the moment. For instance, if your area of expertise is the segmentation of volumes, what needs to be improved? What types of features would you like to add? Are volume segmentation systems "mature" and pretty much perfected, or is there still active progress being made?
I know game developers have an increasing interest in voxel graphics (Sparse Voxel Octrees etc). Research related to voxel graphics in games could also be of interest, but I don't really see myself competing with the highly skilled professionals in that field. What I am looking for are niches that perhaps are less cool and less profitable than what game developers and others focus on, but that still could be useful and rewarding to work on.
Any and all suggestions for research topics related to algorithms operating on volume data are very welcome.
Thank you for your time. | 2 |
8,180,718 | 11/18/2011 10:06:00 | 531,199 | 12/05/2010 12:59:48 | 489 | 12 | Using Indy 9.0.0.12, TIdTcpClient.Connect(ATimeOut) does not time out as specified | Using Indy 9.0.0.12, the choice of `ATimeOut` of `TIdTcpClient.Connect(ATimeOut)` doesn't seem to make a difference. For example, if the server application using TIdTcpServer is not launched, the client application using TIdTcpClient will hang where `TIdTcpClient.Connect(ATimeOut)` is called.
It seems that issues about timing out when sending plain msg/receiving plain msg/downloading file should necessicate heartbeat-wise algorithms. However, if the `TIdTcpClient.Connect(ATimeOut)` does not return after ATimeOut, how should the hearbeat algorithms be implement? | delphi | sockets | timeout | indy | kylix | 11/18/2011 19:52:50 | too localized | Using Indy 9.0.0.12, TIdTcpClient.Connect(ATimeOut) does not time out as specified
===
Using Indy 9.0.0.12, the choice of `ATimeOut` of `TIdTcpClient.Connect(ATimeOut)` doesn't seem to make a difference. For example, if the server application using TIdTcpServer is not launched, the client application using TIdTcpClient will hang where `TIdTcpClient.Connect(ATimeOut)` is called.
It seems that issues about timing out when sending plain msg/receiving plain msg/downloading file should necessicate heartbeat-wise algorithms. However, if the `TIdTcpClient.Connect(ATimeOut)` does not return after ATimeOut, how should the hearbeat algorithms be implement? | 3 |
7,242,292 | 08/30/2011 11:16:00 | 653,406 | 03/10/2011 06:29:37 | 598 | 21 | Magento Helper Class Not Found Error | I am learning to create a custom extension by following this tutorial, [http://www.pierrefay.fr/category/developpement/magento][1]
[1]: http://www.pierrefay.fr/category/developpement/magento
When I try to open extension admin I m getting `Fatal error: Class 'Mage_Test_Helper_Data' not found in /var/www/html/dev/app/Mage.php on line 520`
But I think I am not using helper class anywhere in the extension.Your suggestions are welcome.
Here is my config.xml file
<?xml version="1.0"?>
<config>
<modules>
<Package_Test>
<version>1.0.0</version>
</Package_Test>
</modules>
<frontend>
<routers>
<routerfrontend>
<use>standard</use>
<args>
<module>Package_Test</module>
<frontName>test</frontName>
</args>
</routerfrontend>
</routers>
<layout>
<updates>
<test>
<file>test.xml</file>
</test>
</updates>
</layout>
</frontend>
<admin>
<routers>
<test>
<use>admin</use>
<args>
<module>Package_Test</module>
<frontName>admintest</frontName>
</args>
</test>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<test>
<file>test.xml</file>
</test>
</updates>
</layout>
<menu>
<test translate="title" module="adminhtml">
<title>My Module</title>
<sort_order>100</sort_order>
<children>
<items module="Test">
<title>Address Book</title>
<action>admintest/adminhtml_index</action>
</items>
</children>
</test>
</menu>
</adminhtml>
<global>
<helpers>
<class>Package_Test_Helper</class>
</helpers>
<blocks>
<test>
<class>Package_Test_Block</class>
</test>
</blocks>
<models>
<test>
<class>Package_Test_Model</class>
<resourceModel>test_mysql4</resourceModel>
</test>
<test_mysql4>
<class>Package_Test_Model_Mysql4</class>
<entities>
<test>
<table>package_test</table>
</test>
</entities>
</test_mysql4>
</models>
<resources>
<test_write>
<connection>
<use>core_write</use>
</connection>
</test_write>
<test_read>
<connection>
<use>core_read</use>
</connection>
</test_read>
</resources>
</global>
</config>
| magento | null | null | null | null | null | open | Magento Helper Class Not Found Error
===
I am learning to create a custom extension by following this tutorial, [http://www.pierrefay.fr/category/developpement/magento][1]
[1]: http://www.pierrefay.fr/category/developpement/magento
When I try to open extension admin I m getting `Fatal error: Class 'Mage_Test_Helper_Data' not found in /var/www/html/dev/app/Mage.php on line 520`
But I think I am not using helper class anywhere in the extension.Your suggestions are welcome.
Here is my config.xml file
<?xml version="1.0"?>
<config>
<modules>
<Package_Test>
<version>1.0.0</version>
</Package_Test>
</modules>
<frontend>
<routers>
<routerfrontend>
<use>standard</use>
<args>
<module>Package_Test</module>
<frontName>test</frontName>
</args>
</routerfrontend>
</routers>
<layout>
<updates>
<test>
<file>test.xml</file>
</test>
</updates>
</layout>
</frontend>
<admin>
<routers>
<test>
<use>admin</use>
<args>
<module>Package_Test</module>
<frontName>admintest</frontName>
</args>
</test>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<test>
<file>test.xml</file>
</test>
</updates>
</layout>
<menu>
<test translate="title" module="adminhtml">
<title>My Module</title>
<sort_order>100</sort_order>
<children>
<items module="Test">
<title>Address Book</title>
<action>admintest/adminhtml_index</action>
</items>
</children>
</test>
</menu>
</adminhtml>
<global>
<helpers>
<class>Package_Test_Helper</class>
</helpers>
<blocks>
<test>
<class>Package_Test_Block</class>
</test>
</blocks>
<models>
<test>
<class>Package_Test_Model</class>
<resourceModel>test_mysql4</resourceModel>
</test>
<test_mysql4>
<class>Package_Test_Model_Mysql4</class>
<entities>
<test>
<table>package_test</table>
</test>
</entities>
</test_mysql4>
</models>
<resources>
<test_write>
<connection>
<use>core_write</use>
</connection>
</test_write>
<test_read>
<connection>
<use>core_read</use>
</connection>
</test_read>
</resources>
</global>
</config>
| 0 |
9,852,274 | 03/24/2012 13:51:46 | 1,246,993 | 03/03/2012 15:23:02 | 1 | 0 | After click on login button automatically display home page instead of dashboard in wordpress | I am developing one blog in wordpress and I have create some user contributor type. When I am log-in as a admin at that time it work properly but when I am log-in as a user at that time it display home page instead of dashboard. Give me a suggestion | wordpress | login | null | null | null | 03/25/2012 16:56:14 | off topic | After click on login button automatically display home page instead of dashboard in wordpress
===
I am developing one blog in wordpress and I have create some user contributor type. When I am log-in as a admin at that time it work properly but when I am log-in as a user at that time it display home page instead of dashboard. Give me a suggestion | 2 |
7,225,633 | 08/29/2011 02:54:25 | 698,574 | 04/08/2011 11:45:47 | 769 | 3 | the table field design in mysql database? | i made a research to a cms's database:
`uid(Unique user ID):` it set to `int(11)`
`name(nique user name` it set to `varchar(60)`
`created(tiemstamp for when user was created)` it set to `int(11)`
`title` the title of article it set to `varchar(255)`
1, when i should use Int or char or varchar or other types
2, how to set the number in the parenthesis。eg: `varchar(60)` thank you! | mysql | null | null | null | null | null | open | the table field design in mysql database?
===
i made a research to a cms's database:
`uid(Unique user ID):` it set to `int(11)`
`name(nique user name` it set to `varchar(60)`
`created(tiemstamp for when user was created)` it set to `int(11)`
`title` the title of article it set to `varchar(255)`
1, when i should use Int or char or varchar or other types
2, how to set the number in the parenthesis。eg: `varchar(60)` thank you! | 0 |
1,017,177 | 06/19/2009 09:50:09 | 26,414 | 10/09/2008 08:07:53 | 3,858 | 178 | SQL Server SELECT statements causing blocking | We're using a SQL Server 2005 database (no row versioning) with a huge select statement, and we're seeing it block other statements from running (seen using `sp_who2`). I didn't realise SELECT statements could cause blocking - is there anything I can do to mitigate this? | sql-server | blocking | performance | null | null | null | open | SQL Server SELECT statements causing blocking
===
We're using a SQL Server 2005 database (no row versioning) with a huge select statement, and we're seeing it block other statements from running (seen using `sp_who2`). I didn't realise SELECT statements could cause blocking - is there anything I can do to mitigate this? | 0 |
4,264,083 | 11/24/2010 06:36:58 | 479,027 | 10/18/2010 06:40:03 | 30 | 0 | send an email and sms of application to another user | Hi I want to share one app to another persons through mail or sms.For example if i am downloading one app from android market.If i want to send that app link to other persons how i am sending the link to that ones through mail or sms. | android | null | null | null | null | null | open | send an email and sms of application to another user
===
Hi I want to share one app to another persons through mail or sms.For example if i am downloading one app from android market.If i want to send that app link to other persons how i am sending the link to that ones through mail or sms. | 0 |
2,824,341 | 05/13/2010 04:03:13 | 300,371 | 03/23/2010 22:39:57 | 507 | 15 | How can I secure my $_GETs in PHP? | My profile.php displays all the user's postings,comments,pictures. If the user wants to delete, it sends the posting's id to the remove.php so it's like remove.php?action=removeposting&posting_id=2. If they want to remove a picture, it's remove.php?action=removepicture&picture_id=1.
Using the get data, I do a query to the database to display the info they want to delete and if they want to delete it, they click "yes". So the data is deleted via $POST NOT $GET to prevent cross-site request forgery.
My question is how do I make sure the GETs are not some javascript code, sql injection that will mess me up.
**here is my remove.php**
//how do I make $action safe?
//should I use mysqli_real_escape_string?
//use strip_tags()?
$action=trim($_GET['action']);
if (($action != 'removeposting') && ($action != 'removefriend')
&& ($action != 'removecomment'))
{
echo "please don't change the action. go back and refresh";
header("Location: index.php");
exit();
}
if ($action == 'removeposting')
{
//get the info and display it in a form. if user clicks "yes", deletes
}
if ($action =='removepicture')
{
//remove pic
}
I know I can't be 100% safe, but what are some common defenses I can use. | php | mysql | null | null | null | null | open | How can I secure my $_GETs in PHP?
===
My profile.php displays all the user's postings,comments,pictures. If the user wants to delete, it sends the posting's id to the remove.php so it's like remove.php?action=removeposting&posting_id=2. If they want to remove a picture, it's remove.php?action=removepicture&picture_id=1.
Using the get data, I do a query to the database to display the info they want to delete and if they want to delete it, they click "yes". So the data is deleted via $POST NOT $GET to prevent cross-site request forgery.
My question is how do I make sure the GETs are not some javascript code, sql injection that will mess me up.
**here is my remove.php**
//how do I make $action safe?
//should I use mysqli_real_escape_string?
//use strip_tags()?
$action=trim($_GET['action']);
if (($action != 'removeposting') && ($action != 'removefriend')
&& ($action != 'removecomment'))
{
echo "please don't change the action. go back and refresh";
header("Location: index.php");
exit();
}
if ($action == 'removeposting')
{
//get the info and display it in a form. if user clicks "yes", deletes
}
if ($action =='removepicture')
{
//remove pic
}
I know I can't be 100% safe, but what are some common defenses I can use. | 0 |
8,988,858 | 01/24/2012 14:51:32 | 444,569 | 09/10/2010 17:02:55 | 285 | 14 | SSRS 2008 Web service | I need to get all on-demand reports name from report server
http://stackoverflow.com/questions/3169063/ssrs-get-list-of-all-reports-and-parameters-in-a-single-web-service-call
That link specify how to do it in sql server 2005 report server.
I have sql server 2008
i have tried http://10.230.193.131/ReportServer/ReportService2008.asmx?wsdl
but it gives
"The path of the item 'wsdl' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. (rsInvalidItemPath) Get Online Help"
But I am able to see http://10.230.193.131/ReportServer/ReportService2010.asmx?wsdl
But I am not able to find the node where i get names of all reports
In short how can i get the name of all reports by consuming a service of SSRS 2008
| ssrs-2008 | null | null | null | null | null | open | SSRS 2008 Web service
===
I need to get all on-demand reports name from report server
http://stackoverflow.com/questions/3169063/ssrs-get-list-of-all-reports-and-parameters-in-a-single-web-service-call
That link specify how to do it in sql server 2005 report server.
I have sql server 2008
i have tried http://10.230.193.131/ReportServer/ReportService2008.asmx?wsdl
but it gives
"The path of the item 'wsdl' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. (rsInvalidItemPath) Get Online Help"
But I am able to see http://10.230.193.131/ReportServer/ReportService2010.asmx?wsdl
But I am not able to find the node where i get names of all reports
In short how can i get the name of all reports by consuming a service of SSRS 2008
| 0 |
11,003,591 | 06/12/2012 19:35:57 | 663,902 | 03/17/2011 07:58:23 | 26 | 0 | Sell physical product in an iOS app | I wonder what rules there are to sell physical products in an iOS app? The payment is not going to be using apples in-app purchase. | ios | in-app | purchase | null | null | 06/13/2012 07:11:39 | off topic | Sell physical product in an iOS app
===
I wonder what rules there are to sell physical products in an iOS app? The payment is not going to be using apples in-app purchase. | 2 |
8,402,924 | 12/06/2011 16:02:37 | 1,049,109 | 11/16/2011 06:57:56 | 6 | 0 | Is there any way to synchronise the clock of my avd | I am using android virtual device for android developing and i am developing an app to update status in twitter and seeing the logcat i think the problem is that it's system clock is not synchronised can anyone please help.
Logcat
12-06 09:23:25.693: W/System.err(537): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
Complete code is in <a href="http://sayemsiam.blogspot.com/2011/12/status-update-in-twitter-using.html">here</a> | android | twitter-api | twitter4j | jtwitter | synclock | null | open | Is there any way to synchronise the clock of my avd
===
I am using android virtual device for android developing and i am developing an app to update status in twitter and seeing the logcat i think the problem is that it's system clock is not synchronised can anyone please help.
Logcat
12-06 09:23:25.693: W/System.err(537): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
Complete code is in <a href="http://sayemsiam.blogspot.com/2011/12/status-update-in-twitter-using.html">here</a> | 0 |
10,042,318 | 04/06/2012 10:33:50 | 116,882 | 06/03/2009 20:22:33 | 766 | 55 | Windows Phone button requires two presses to fire its action | I have a button inside of a stackpanel that needs to be pressed twice to execute its action. This only happens when I hide the stackpanel and show it again.
First, I press the button and the stackpanel is hidden, hiding the button. I press another button that brings the stackpanel back. I click the button, doesn't work. Click again, and it works.
This happens in the emulator and in the phone.
This is the xaml I have:
<StackPanel Grid.Row="1" Name="myPanel">
<Button Content="{Binding LocalizedResources.ButtonX, Source={StaticResource Localization}}" Name="btnX" Click="btnX_Click" />
</StackPanel>
In the code, I just control the visibility as shown below:
myPanel.Visibility = Visibility.Collapsed;
Any ideas? | windows-phone-7 | null | null | null | null | null | open | Windows Phone button requires two presses to fire its action
===
I have a button inside of a stackpanel that needs to be pressed twice to execute its action. This only happens when I hide the stackpanel and show it again.
First, I press the button and the stackpanel is hidden, hiding the button. I press another button that brings the stackpanel back. I click the button, doesn't work. Click again, and it works.
This happens in the emulator and in the phone.
This is the xaml I have:
<StackPanel Grid.Row="1" Name="myPanel">
<Button Content="{Binding LocalizedResources.ButtonX, Source={StaticResource Localization}}" Name="btnX" Click="btnX_Click" />
</StackPanel>
In the code, I just control the visibility as shown below:
myPanel.Visibility = Visibility.Collapsed;
Any ideas? | 0 |
4,831,997 | 01/28/2011 18:58:09 | 93,311 | 04/20/2009 17:14:16 | 2,150 | 120 | How to call a custom model from a view? | I do not wish to save anything to a database, so created a **model** written as this :
class Calculation
attr_accessor :name, :docket_num, :payments
def calculate
...
I call it in my **controller** like this :
class MainController < ApplicationController
def calculator
@calc = Calculation.new
end
In my **view** as this :
= form_for @calc do |f|
.field
= f.label :judgement_balance
%br/
= f.text_field :judgement_balance
...
But it appears I am doing this wrong, because it return this :
undefined method `model_name' for Calculation:Class
**1st Question :** Anyone know what I am missing?
**2nd Question :** How can one transfer the params to a second view and perform a calculation with saving anything to a database? | ruby-on-rails | ruby | model | null | null | null | open | How to call a custom model from a view?
===
I do not wish to save anything to a database, so created a **model** written as this :
class Calculation
attr_accessor :name, :docket_num, :payments
def calculate
...
I call it in my **controller** like this :
class MainController < ApplicationController
def calculator
@calc = Calculation.new
end
In my **view** as this :
= form_for @calc do |f|
.field
= f.label :judgement_balance
%br/
= f.text_field :judgement_balance
...
But it appears I am doing this wrong, because it return this :
undefined method `model_name' for Calculation:Class
**1st Question :** Anyone know what I am missing?
**2nd Question :** How can one transfer the params to a second view and perform a calculation with saving anything to a database? | 0 |
2,797,717 | 05/09/2010 13:16:47 | 336,637 | 05/09/2010 13:14:33 | 1 | 0 | Binding to a collection of DependencyObjects in Silverlight 4 | As of Silverlight 4 it is possible to data bind against a DependencyObject (instead of a Framework element in previous versions). So far so good, but how do I bind agains a collection of DependencyObjects.
The DataContext is not passed from the ObservableCollection to the collection elements, so that the DependencyProperties of the DependencyObjects are never called (neither the changed events). Neither the DependencyObject offers SetBinding or DataContext to initialize the binding manually.
Thanks for any advice here. | silverlight-4.0 | dependencyobject | data-binding | null | null | null | open | Binding to a collection of DependencyObjects in Silverlight 4
===
As of Silverlight 4 it is possible to data bind against a DependencyObject (instead of a Framework element in previous versions). So far so good, but how do I bind agains a collection of DependencyObjects.
The DataContext is not passed from the ObservableCollection to the collection elements, so that the DependencyProperties of the DependencyObjects are never called (neither the changed events). Neither the DependencyObject offers SetBinding or DataContext to initialize the binding manually.
Thanks for any advice here. | 0 |
2,310,949 | 02/22/2010 12:58:29 | 139,284 | 07/16/2009 07:58:09 | 275 | 10 | Generics + XML Serialization + Custom Objects | I'm trying out Generics and I had this (not so) great idea of creating an XMLSerializer<of T> class. The code I pieced together is below:
public class Persist<T>
{
private string _path;
public Persist(string path) {
this._path = path;
}
public void save(T objectToSave)
{
XmlSerializer s = new XmlSerializer(typeof(T));
TextWriter w = new StreamWriter(this._path);
try { s.Serialize(w, objectToSave); }
catch (InvalidDataException e) { throw e; }
w.Close(); w.Dispose();
}
public T load()
{
XmlSerializer s = new XmlSerializer(typeof(T));
TextReader r = new StreamReader(this._path);
T obj;
try { obj = (T)s.Deserialize(r); }
catch (InvalidDataException e) { throw e; }
r.Close(); r.Dispose();
return obj;
}
}
Here's the problem: It works fine on `Persist<List<string>>` or `Persist<List<int>>` but not on `Persist<List<userObject>>` or any other custom (but serializable) objects. `userObject` itself is just a class with two {get;set;} properties, which I have serialized before.
I'm not sure if the problems on my Persist<T> class (generics), XML Serialization code, or somewhere else :( Help is very much appreciated~ | generics | serialization | c# | null | null | null | open | Generics + XML Serialization + Custom Objects
===
I'm trying out Generics and I had this (not so) great idea of creating an XMLSerializer<of T> class. The code I pieced together is below:
public class Persist<T>
{
private string _path;
public Persist(string path) {
this._path = path;
}
public void save(T objectToSave)
{
XmlSerializer s = new XmlSerializer(typeof(T));
TextWriter w = new StreamWriter(this._path);
try { s.Serialize(w, objectToSave); }
catch (InvalidDataException e) { throw e; }
w.Close(); w.Dispose();
}
public T load()
{
XmlSerializer s = new XmlSerializer(typeof(T));
TextReader r = new StreamReader(this._path);
T obj;
try { obj = (T)s.Deserialize(r); }
catch (InvalidDataException e) { throw e; }
r.Close(); r.Dispose();
return obj;
}
}
Here's the problem: It works fine on `Persist<List<string>>` or `Persist<List<int>>` but not on `Persist<List<userObject>>` or any other custom (but serializable) objects. `userObject` itself is just a class with two {get;set;} properties, which I have serialized before.
I'm not sure if the problems on my Persist<T> class (generics), XML Serialization code, or somewhere else :( Help is very much appreciated~ | 0 |
9,286,521 | 02/15/2012 01:00:13 | 1,108,407 | 12/20/2011 17:56:55 | 43 | 1 | Only show items with price over average | My sql looks like this and i only want to show items with price over average
SELECT COUNT(Artikelnamn) AS 'Antal Artiklar', FLOOR(SUM(Price)) AS 'Lagervärde', FLOOR(MAX(Price)) AS 'Max', FLOOR(MIN(Pris)) AS 'Min',FLOOR(AVG(Price)) AS 'Genomsnitt'
FROM Artikel
GROUP BY Price HAVING Price > AVG(Price);
It's especially the GROUP BY things that doesent work and I really have googled.
Sorry if some words looks stange, originally written in another language ;) | sql | sql-server | sql-server-2008 | null | null | null | open | Only show items with price over average
===
My sql looks like this and i only want to show items with price over average
SELECT COUNT(Artikelnamn) AS 'Antal Artiklar', FLOOR(SUM(Price)) AS 'Lagervärde', FLOOR(MAX(Price)) AS 'Max', FLOOR(MIN(Pris)) AS 'Min',FLOOR(AVG(Price)) AS 'Genomsnitt'
FROM Artikel
GROUP BY Price HAVING Price > AVG(Price);
It's especially the GROUP BY things that doesent work and I really have googled.
Sorry if some words looks stange, originally written in another language ;) | 0 |
11,653,004 | 07/25/2012 15:17:02 | 874,862 | 08/02/2011 14:47:59 | 37 | 0 | nested resources in each loop | I have a city model with has_many relationships to events, restaurants, activities, ect.
The event, restaurant, activity ect model (belongs_to city) has a attribute with the name (boolean) hot_item.
Question: On the city page i want to show the items that are hot_deals in a loop.
Ciao..remco | ruby-on-rails | ruby-on-rails-3 | null | null | null | 07/26/2012 12:34:20 | not a real question | nested resources in each loop
===
I have a city model with has_many relationships to events, restaurants, activities, ect.
The event, restaurant, activity ect model (belongs_to city) has a attribute with the name (boolean) hot_item.
Question: On the city page i want to show the items that are hot_deals in a loop.
Ciao..remco | 1 |
4,929,880 | 02/08/2011 05:23:20 | 501,557 | 11/09/2010 07:08:36 | 10,064 | 400 | Type checker for JavaScript? | Does anyone know if there's a good tool for analyzing JavaScript code and detecting type errors? I know that JavaScript itself is weakly and dynamically typed, but it would be really nice if I could have a program that would verify that all my field accesses are sensible and that I don't try treating a number like a string, for example. I'm aware that there are valid use cases in JavaScript where adding or removing fields or converting between different types is valid and expected, but some errors are so blatant it seems like they could be caught before the script started running.
I've heard of JSLint, but my understanding is that it's mostly a style tool rather than a semantic analyzer. If I'm wrong about this, then just telling me so would be a valid answer to this question. :-)
Thanks so much! | javascript | static-analysis | type-checking | null | null | null | open | Type checker for JavaScript?
===
Does anyone know if there's a good tool for analyzing JavaScript code and detecting type errors? I know that JavaScript itself is weakly and dynamically typed, but it would be really nice if I could have a program that would verify that all my field accesses are sensible and that I don't try treating a number like a string, for example. I'm aware that there are valid use cases in JavaScript where adding or removing fields or converting between different types is valid and expected, but some errors are so blatant it seems like they could be caught before the script started running.
I've heard of JSLint, but my understanding is that it's mostly a style tool rather than a semantic analyzer. If I'm wrong about this, then just telling me so would be a valid answer to this question. :-)
Thanks so much! | 0 |
10,123,656 | 04/12/2012 12:33:28 | 679,611 | 03/28/2011 03:58:51 | 39 | 1 | XML Parsing with Jquery for IE7+ and Mozilla | I have been working on a web application where I need to parse my xml in jquery. I am building my web app to work on IE7 to IE10 and in mozilla. I wanted to iterate to my xml so I wrote below code.
<script type='text/javascript' src="jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" language="javascript">
var xml = '<root><cell id="1"> </cell><cell id="2"> </cell></root>';
//works in ie7
$(xml).filter("cell").each(function () {
alert('ie'+$(this).attr('id'));
});
//works in mozilla
$(xml).find('cell').each(function () {
alert('mozilla'+$(this).attr('id'));
});
</script>
But what i found is that i need to write different looping mechanism to fetch from xml for different browser. Which is kind of weird as I am using Jquery so it should be all browser compatible.
So is there a better way of reading from xml which will work in all browsers so that i dont have to write browser check code? | javascript | jquery | xml | internet-explorer | jquery-xml | null | open | XML Parsing with Jquery for IE7+ and Mozilla
===
I have been working on a web application where I need to parse my xml in jquery. I am building my web app to work on IE7 to IE10 and in mozilla. I wanted to iterate to my xml so I wrote below code.
<script type='text/javascript' src="jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" language="javascript">
var xml = '<root><cell id="1"> </cell><cell id="2"> </cell></root>';
//works in ie7
$(xml).filter("cell").each(function () {
alert('ie'+$(this).attr('id'));
});
//works in mozilla
$(xml).find('cell').each(function () {
alert('mozilla'+$(this).attr('id'));
});
</script>
But what i found is that i need to write different looping mechanism to fetch from xml for different browser. Which is kind of weird as I am using Jquery so it should be all browser compatible.
So is there a better way of reading from xml which will work in all browsers so that i dont have to write browser check code? | 0 |
11,122,197 | 06/20/2012 14:50:01 | 1,469,584 | 06/20/2012 14:35:01 | 1 | 0 | Why does memo.Lines use TStrings instead of TStringList? | Why does Memo.Lines use the abstract class TStrings? Why doesn't it use TStringList instead?
And should I convert it to TStringList before working with it? | delphi | tstringlist | memo | null | null | null | open | Why does memo.Lines use TStrings instead of TStringList?
===
Why does Memo.Lines use the abstract class TStrings? Why doesn't it use TStringList instead?
And should I convert it to TStringList before working with it? | 0 |
4,991,083 | 02/14/2011 10:30:08 | 616,040 | 02/14/2011 10:30:08 | 1 | 0 | I am developing a multiclient and server chat application in C# .net. | In order to recognise the clients I want to pass their port numbers to the server. How do I do that? | c# | null | null | null | null | 02/14/2011 13:18:29 | not a real question | I am developing a multiclient and server chat application in C# .net.
===
In order to recognise the clients I want to pass their port numbers to the server. How do I do that? | 1 |
1,350,041 | 08/29/2009 00:40:10 | 146,780 | 07/29/2009 01:23:43 | 51 | 1 | Algorithm for centering text based on length and font with vb .net | I'm making a user control, and I manually draw the text string, but I can't seem to keep it centered. I need it to stay centered no matter what the font, or string length.
Thanks | vb | .net | algorithm | text | null | null | open | Algorithm for centering text based on length and font with vb .net
===
I'm making a user control, and I manually draw the text string, but I can't seem to keep it centered. I need it to stay centered no matter what the font, or string length.
Thanks | 0 |
7,166,113 | 08/23/2011 18:57:31 | 908,328 | 08/23/2011 18:53:14 | 1 | 0 | Bonjour services sniffer code | Is there a library or open sourced Obj C code that will let me sniff for all advertised Bonjour services on a network? Best if it works on Mac OS X or iOS.
Thx all. | objective-c | bonjour | zeroconf | null | null | null | open | Bonjour services sniffer code
===
Is there a library or open sourced Obj C code that will let me sniff for all advertised Bonjour services on a network? Best if it works on Mac OS X or iOS.
Thx all. | 0 |
2,366,442 | 03/02/2010 20:19:17 | 252,711 | 01/17/2010 17:53:26 | 1 | 0 | Can a home widget have a Context? | In an activity it's (usually) easy to get the Context.
What if I am working with a home widget class?
These are classes that extends AppWidgetProvider, which don't contain a Context!
Thank you. | android | context | home | widget | null | null | open | Can a home widget have a Context?
===
In an activity it's (usually) easy to get the Context.
What if I am working with a home widget class?
These are classes that extends AppWidgetProvider, which don't contain a Context!
Thank you. | 0 |
8,930,037 | 01/19/2012 16:56:09 | 1,024,132 | 11/01/2011 16:46:28 | 612 | 34 | Calling Objective-C method by clicking text inside UIWebView | I query a SQLite db and the query returns some links: I can display them in a `UITextView` or in a `UIWebView`.
What I need to know is: is there a way to bind an action to a link inside a `UIWebView` (or even `UITextView`)? **I don't want to open a webpage, I just want to execute a method of Objective-C** as the link was a button. Is this possible? | iphone | objective-c | methods | uiwebview | uitextview | null | open | Calling Objective-C method by clicking text inside UIWebView
===
I query a SQLite db and the query returns some links: I can display them in a `UITextView` or in a `UIWebView`.
What I need to know is: is there a way to bind an action to a link inside a `UIWebView` (or even `UITextView`)? **I don't want to open a webpage, I just want to execute a method of Objective-C** as the link was a button. Is this possible? | 0 |
2,012,412 | 01/06/2010 11:04:08 | 157,027 | 08/15/2009 20:56:47 | 260 | 0 | Java GUI Toolbar | I am developing a Java Desktop Application. In that I want some toolbars at the top of the JFrame (as in usual GUI appllications).
I want to allow user to add/remove toolbars dynamically by clicking on some buttons. How can I implement this (through any Layouts or some other way) so that when a user add/removes a toolbar, the rest of the space below the toolbar is adjusted accordingly. | java | gui | swing | awt | null | 12/06/2011 14:26:40 | not a real question | Java GUI Toolbar
===
I am developing a Java Desktop Application. In that I want some toolbars at the top of the JFrame (as in usual GUI appllications).
I want to allow user to add/remove toolbars dynamically by clicking on some buttons. How can I implement this (through any Layouts or some other way) so that when a user add/removes a toolbar, the rest of the space below the toolbar is adjusted accordingly. | 1 |
7,166,536 | 08/23/2011 19:35:50 | 517,893 | 11/23/2010 18:50:41 | 55 | 0 | A guide for working with development virtual machine | I use Ubuntu as main system. Although I can use it for development, I consider to dedicate a specific Virtualbox machine for developer's needs. It can be useful, because then I will not clutter host machine with servers, configs and other specific things and also can practice in remote development. What I am searching for is a guide for setting host and guest systems in a way, optimal for development (especially interesting would be the guide of how to setup IDE to work not locally, but on guest). Now I am learning web development with Python(Django), Apache and Postgresql, but guides on using virtualization with any other development tools are appreciated as well. | ide | virtual-machine | virtualbox | remote-working | null | 08/30/2011 13:06:08 | not constructive | A guide for working with development virtual machine
===
I use Ubuntu as main system. Although I can use it for development, I consider to dedicate a specific Virtualbox machine for developer's needs. It can be useful, because then I will not clutter host machine with servers, configs and other specific things and also can practice in remote development. What I am searching for is a guide for setting host and guest systems in a way, optimal for development (especially interesting would be the guide of how to setup IDE to work not locally, but on guest). Now I am learning web development with Python(Django), Apache and Postgresql, but guides on using virtualization with any other development tools are appreciated as well. | 4 |
6,261,221 | 06/07/2011 06:12:46 | 310,291 | 03/02/2010 15:22:39 | 2,990 | 20 | Where is the source code of opensource titanium developer hiding ? | Titanium pretends to be opensource but it isn't obvious where it can be downloaded.
| javascript | iphone | c | opensource | null | 06/07/2011 06:35:30 | not constructive | Where is the source code of opensource titanium developer hiding ?
===
Titanium pretends to be opensource but it isn't obvious where it can be downloaded.
| 4 |
6,954,577 | 08/05/2011 09:59:47 | 154,579 | 08/11/2009 19:05:46 | 39 | 0 | using list<> from different class? | I have a problem wich is somewhat difficult to explain:
I have a dll file from witch i have the source(not created by myself) code from it.
I want to create a windowsform app.
"List<Plugwisemessage>"is filled/created in plugwisecontrol.cs is part of plugwiseLib.dll.
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{// Event for receiving data
string txt = port.ReadExisting();
List<PlugwiseMessage> msg = reader.Read(Regex.Split(txt, "\r\n"));
//DataReceived(sender, new System.EventArgs(), msg);
for (int i = 0; i < msg.Count; i++) // Loop through List with for
{
Console.WriteLine(msg[i].Message);
Console.WriteLine(msg[i].Owner);
Console.WriteLine(msg[i].Type);}
if (DataReceived != null)
DataReceived(sender, new System.EventArgs(), msg);
I created a new windowsformApplication added the PlugwiseLib.dll
By a example of the creator i got the form and the dll to work so this ok.
But now i want to display a part of the List<Plugwisemessage> in an Textfield or later using a animation (On/Off).
I am a starter with programming, and i have read something about public/private/void things but i don't get everything clear yet.(has this something to do with it?)
So the main question is:
How can i display the information from
PlugwiseLib.Dll\plugwiseControl.cs\List<PlugwiseMessage> to
WindowsFormsApllication1\form1.cs\textbox1
thank you inadvanced for your time. | c# | null | null | null | null | 08/13/2011 10:47:13 | too localized | using list<> from different class?
===
I have a problem wich is somewhat difficult to explain:
I have a dll file from witch i have the source(not created by myself) code from it.
I want to create a windowsform app.
"List<Plugwisemessage>"is filled/created in plugwisecontrol.cs is part of plugwiseLib.dll.
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{// Event for receiving data
string txt = port.ReadExisting();
List<PlugwiseMessage> msg = reader.Read(Regex.Split(txt, "\r\n"));
//DataReceived(sender, new System.EventArgs(), msg);
for (int i = 0; i < msg.Count; i++) // Loop through List with for
{
Console.WriteLine(msg[i].Message);
Console.WriteLine(msg[i].Owner);
Console.WriteLine(msg[i].Type);}
if (DataReceived != null)
DataReceived(sender, new System.EventArgs(), msg);
I created a new windowsformApplication added the PlugwiseLib.dll
By a example of the creator i got the form and the dll to work so this ok.
But now i want to display a part of the List<Plugwisemessage> in an Textfield or later using a animation (On/Off).
I am a starter with programming, and i have read something about public/private/void things but i don't get everything clear yet.(has this something to do with it?)
So the main question is:
How can i display the information from
PlugwiseLib.Dll\plugwiseControl.cs\List<PlugwiseMessage> to
WindowsFormsApllication1\form1.cs\textbox1
thank you inadvanced for your time. | 3 |
10,363,800 | 04/28/2012 13:12:14 | 1,339,752 | 04/17/2012 20:40:51 | 1 | 0 | permutation of integer arrays | i wanna java code for permutation of int arrays.suppose i give an input of 1 2 3
and the program would return all the possible combinations of these elements.i have written a java code which takes string array as an input and return string array.But when i convert a string into an integer array,i am facing a problem.The problem is that suppose i give an input of 10 20 2,it goes int the string as 10 20 2 as it is.But on converting it into an int array it is getting converted as 1 0 2 0 2.So plz post some java code which does not need string conversion into an integer array or plz give me suggestion so that i would get 10 20 2 in the integer array in spite of 1 0 2 0.I hav used the following code for string to integer array conversion.
for (int j= 0; j < array[in].length(); j++)
{
intArray[j] = Character.digit(array[in].charAt(j), 10);
}
Plz reply as soon as possible.
| java | null | null | null | null | 04/29/2012 22:42:56 | not a real question | permutation of integer arrays
===
i wanna java code for permutation of int arrays.suppose i give an input of 1 2 3
and the program would return all the possible combinations of these elements.i have written a java code which takes string array as an input and return string array.But when i convert a string into an integer array,i am facing a problem.The problem is that suppose i give an input of 10 20 2,it goes int the string as 10 20 2 as it is.But on converting it into an int array it is getting converted as 1 0 2 0 2.So plz post some java code which does not need string conversion into an integer array or plz give me suggestion so that i would get 10 20 2 in the integer array in spite of 1 0 2 0.I hav used the following code for string to integer array conversion.
for (int j= 0; j < array[in].length(); j++)
{
intArray[j] = Character.digit(array[in].charAt(j), 10);
}
Plz reply as soon as possible.
| 1 |
4,921,477 | 02/07/2011 12:49:00 | 325,519 | 04/25/2010 19:13:48 | 375 | 5 | Dynamic vs static memory allocation of buffers for network I/O and C++ | I'm not sure if topic is right, but I'll try to explain my problem below. What I'm looking for is some kind of "academic answer", because I suppose that my both solutions give similar results at runtime.
I have a C++ program on Linux, which perform lot of network I/O operations and I wonder if it's better to built-in buffer into client's class or allocate it dynamically. First solution using built-in buffers:
template <size_t buffer_size> class Buffer
{
// ...
char buffer [buffer_size];
}
class TcpClient
{
// ...
Buffer<1024> input_buffer;
Buffer<1024> output_buffer;
}
Second using dynamically allocated buffers:
class Buffer
{
Buffer (size_t buffer_size) :
buffer (malloc (buffer_size))
{
// ...
}
// ...
char* buffer;
}
class TcpClient
{
// ...
Buffer input_buffer (1024);
Buffer output_buffer (1024);
}
Now, comparing both solutions I see that first requires less memory allocation operations then second one, next thing - thanks to templates compiler knows class size at compile time. First solution should give better reference locality (?) and compiler can also align class size to whatever it want. Also we have direct access to buffers, because we do not need to perform additional pointer dereference operation.
I started thinking how TcpClient objects from first solution behave in processors cache. Each time we access such object in code it's loaded into processors cache and it's buffers are copied too, even if we do not need them. It can make cache inefficient, because we store there a lot data what increase memory lookup faults probability, right?
Isn't it a waste of processor's time to copy buffers to cache all the time?
What are other effects of both solutions from processor and operating system point of view?
Is it better to keep class size small or build int it as much as we can? | c++ | memory-allocation | null | null | null | null | open | Dynamic vs static memory allocation of buffers for network I/O and C++
===
I'm not sure if topic is right, but I'll try to explain my problem below. What I'm looking for is some kind of "academic answer", because I suppose that my both solutions give similar results at runtime.
I have a C++ program on Linux, which perform lot of network I/O operations and I wonder if it's better to built-in buffer into client's class or allocate it dynamically. First solution using built-in buffers:
template <size_t buffer_size> class Buffer
{
// ...
char buffer [buffer_size];
}
class TcpClient
{
// ...
Buffer<1024> input_buffer;
Buffer<1024> output_buffer;
}
Second using dynamically allocated buffers:
class Buffer
{
Buffer (size_t buffer_size) :
buffer (malloc (buffer_size))
{
// ...
}
// ...
char* buffer;
}
class TcpClient
{
// ...
Buffer input_buffer (1024);
Buffer output_buffer (1024);
}
Now, comparing both solutions I see that first requires less memory allocation operations then second one, next thing - thanks to templates compiler knows class size at compile time. First solution should give better reference locality (?) and compiler can also align class size to whatever it want. Also we have direct access to buffers, because we do not need to perform additional pointer dereference operation.
I started thinking how TcpClient objects from first solution behave in processors cache. Each time we access such object in code it's loaded into processors cache and it's buffers are copied too, even if we do not need them. It can make cache inefficient, because we store there a lot data what increase memory lookup faults probability, right?
Isn't it a waste of processor's time to copy buffers to cache all the time?
What are other effects of both solutions from processor and operating system point of view?
Is it better to keep class size small or build int it as much as we can? | 0 |
1,517,138 | 10/04/2009 19:05:31 | 184,022 | 10/04/2009 19:05:31 | 1 | 0 | Trying to include a library, but keep getting 'undefined reference to' messages | I am attempting to use the libtommath library. I'm using the NetBeans IDE for my project on Ubuntu linux. I have downloaded and built the library, I have done a 'make install' to put the resulting .a file into /usr/lib/ and the .h files into /usr/include
It appears to be finding the files appropriately (since I no longer get those errors, which I did before installing into the /usr directories).
However, when I create a simple main making a call to mp_init (which is in the library), I get the following error when I attempt to make my project:
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
gcc -c -g -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.c
mkdir -p dist/Debug/GNU-Linux-x86
gcc -o dist/Debug/GNU-Linux-x86/cproj1 build/Debug/GNU-Linux-x86/main.o
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/[[myusername]]/NetBeansProjects/CProj1/main.c:18: undefined reference to `mp_init'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/cproj1] Error 1
So, it looks like the linker can't find the function within the library, however it IS there, so I just don't know what could be causing this. Any help would be appreciated.
I get the same error if I type the gcc command directly and skip the makefile, I also made sure the static library got compiled with gcc as well. | build | compiler-errors | null | null | null | null | open | Trying to include a library, but keep getting 'undefined reference to' messages
===
I am attempting to use the libtommath library. I'm using the NetBeans IDE for my project on Ubuntu linux. I have downloaded and built the library, I have done a 'make install' to put the resulting .a file into /usr/lib/ and the .h files into /usr/include
It appears to be finding the files appropriately (since I no longer get those errors, which I did before installing into the /usr directories).
However, when I create a simple main making a call to mp_init (which is in the library), I get the following error when I attempt to make my project:
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
gcc -c -g -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.c
mkdir -p dist/Debug/GNU-Linux-x86
gcc -o dist/Debug/GNU-Linux-x86/cproj1 build/Debug/GNU-Linux-x86/main.o
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/[[myusername]]/NetBeansProjects/CProj1/main.c:18: undefined reference to `mp_init'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/cproj1] Error 1
So, it looks like the linker can't find the function within the library, however it IS there, so I just don't know what could be causing this. Any help would be appreciated.
I get the same error if I type the gcc command directly and skip the makefile, I also made sure the static library got compiled with gcc as well. | 0 |
5,031,529 | 02/17/2011 16:14:01 | 385,559 | 07/07/2010 13:18:18 | 560 | 19 | Compile and run a file.c using Tiny C Compiler on Windows | Could I get a step by step on how to compile my file.c using Tiny C Compiler and Windows prompt?
Some questions I already have:
1. Where do I stick all TCC files from the download?
2. Do I have to compile stdio.h to use the printf function? (I'd like to do a 'Hello World').
This is what my file.c looks like:
// #include <stdio.h> // for printf
int main(void){
printf("Hello Eric. You've compiled and run the program! \n");
}
Thanks, | c | windows | compiler | tcc | null | null | open | Compile and run a file.c using Tiny C Compiler on Windows
===
Could I get a step by step on how to compile my file.c using Tiny C Compiler and Windows prompt?
Some questions I already have:
1. Where do I stick all TCC files from the download?
2. Do I have to compile stdio.h to use the printf function? (I'd like to do a 'Hello World').
This is what my file.c looks like:
// #include <stdio.h> // for printf
int main(void){
printf("Hello Eric. You've compiled and run the program! \n");
}
Thanks, | 0 |
9,654,296 | 03/11/2012 10:48:41 | 135,852 | 07/09/2009 19:03:13 | 750 | 23 | Any Patterns/Samples for coordinating / cooperating applications | Scenario is two distinct apps that "communicate" with each other and perform actions such as
* start app2 from app1 if app2 is not running
* bring app2 to Top
* Execute a specific "command" in app2 from app1, say, show details on a specific item
* other such actions
any existing code samples/patterns with partial implementation of above would be fantastic
| c# | .net | c#-4.0 | null | null | 03/12/2012 20:34:37 | not constructive | Any Patterns/Samples for coordinating / cooperating applications
===
Scenario is two distinct apps that "communicate" with each other and perform actions such as
* start app2 from app1 if app2 is not running
* bring app2 to Top
* Execute a specific "command" in app2 from app1, say, show details on a specific item
* other such actions
any existing code samples/patterns with partial implementation of above would be fantastic
| 4 |
9,981,261 | 04/02/2012 17:53:21 | 1,264,912 | 03/12/2012 19:02:25 | 1 | 0 | how can we say that golomb rice codes are lossless image compression codes? | wikipedia says "Golomb coding is a lossless data compression method using a family of data compression codes" in their link. but how are golomn code are lossless image compression codes?? | java | image-processing | null | null | null | 04/02/2012 21:31:06 | off topic | how can we say that golomb rice codes are lossless image compression codes?
===
wikipedia says "Golomb coding is a lossless data compression method using a family of data compression codes" in their link. but how are golomn code are lossless image compression codes?? | 2 |
597,077 | 02/27/2009 23:27:07 | 7,839 | 09/15/2008 14:31:57 | 1,028 | 25 | Is learning VIM worth the effort? | I spend a lot of hours at the keyboard and it kind of bothers me when I have to use the mouse for some of the most common things. It kind of breaks my concentration. I've always considered to learn VIM but the amount of time needed to master it always made me to step back.
I'd like to hear from people who has learned it and if it's one of those things you cannot live without.
Thanks. | vim | editor | productivity | null | null | 01/22/2012 16:19:14 | not constructive | Is learning VIM worth the effort?
===
I spend a lot of hours at the keyboard and it kind of bothers me when I have to use the mouse for some of the most common things. It kind of breaks my concentration. I've always considered to learn VIM but the amount of time needed to master it always made me to step back.
I'd like to hear from people who has learned it and if it's one of those things you cannot live without.
Thanks. | 4 |
11,659,818 | 07/25/2012 22:48:26 | 1,553,012 | 07/25/2012 22:33:55 | 1 | 0 | Resources for poker program project | Does anybody know any online resources for a programmer/student interested in developing his own interactive poker program? I was wondering if there is any open source code out there or instructive articles/books. I don't know if stack overflow is the right place to be asking this question but I will try.
Thanks,
gpogue | c# | java | computer-science | poker | null | 07/25/2012 23:21:13 | not a real question | Resources for poker program project
===
Does anybody know any online resources for a programmer/student interested in developing his own interactive poker program? I was wondering if there is any open source code out there or instructive articles/books. I don't know if stack overflow is the right place to be asking this question but I will try.
Thanks,
gpogue | 1 |
6,542,303 | 06/30/2011 23:53:04 | 607,655 | 02/08/2011 05:53:11 | 181 | 5 | How to access web form programmatically? | `http://countrysize.com/` has two pulldown menus where country names can be selected?
How do I programmatically get the output of any two arbitrary countries? What there be a unique URL for a given pair of country A and B?
| html | forms | null | null | null | null | open | How to access web form programmatically?
===
`http://countrysize.com/` has two pulldown menus where country names can be selected?
How do I programmatically get the output of any two arbitrary countries? What there be a unique URL for a given pair of country A and B?
| 0 |
8,823,766 | 01/11/2012 17:25:20 | 723,746 | 04/25/2011 12:56:24 | 1 | 2 | one log in for my PHP/Mysql site and wordpress | I already have a website(*codeigniter*) with user sign up and log in and have members.
I want to have ***wordpress*** in */blog* folder and use some features i need.
but i don't what my members to log in or sign up again to use wordpress.
any ideas?
| php | wordpress | codeigniter | null | null | 01/12/2012 19:35:23 | off topic | one log in for my PHP/Mysql site and wordpress
===
I already have a website(*codeigniter*) with user sign up and log in and have members.
I want to have ***wordpress*** in */blog* folder and use some features i need.
but i don't what my members to log in or sign up again to use wordpress.
any ideas?
| 2 |
5,848,550 | 05/01/2011 13:09:16 | 193,921 | 10/21/2009 16:05:30 | 288 | 2 | Doctrine Why this query return 0 rows? | I have the following DQL query:
$q = Doctrine_Query::create()
->select('id')
->from('Comment')
->where("active='?' AND object_id='?' AND group_name = '?'", array(1, 1, 'unit'));
Which produce the sql:
SELECT c.id AS c__id, c.group_name AS c__group_name, c.name AS c__name, c.email AS c__email FROM comment c WHERE (c.active = '?' AND c.object_id = '?' AND c.group_name = '?')
bindings: 1, 1, unit
In database table:
id user_id object_id group_name name active
1 0 1 unit test 1
When I execute de query it returns 0 rows. Why?
If I go in phpmyadmin and I run
SELECT * FROM comment WHERE active=1 AND object_id=1 AND group_name='unit'
the result contains the record I look for.
In phpmyadmin the query generated by Doctrine identify the table name as 'c'. This is very strange, since I used in my application other DQL querys like this one and works.
Thanks. | php | mysql | zend-framework | select | doctrine | null | open | Doctrine Why this query return 0 rows?
===
I have the following DQL query:
$q = Doctrine_Query::create()
->select('id')
->from('Comment')
->where("active='?' AND object_id='?' AND group_name = '?'", array(1, 1, 'unit'));
Which produce the sql:
SELECT c.id AS c__id, c.group_name AS c__group_name, c.name AS c__name, c.email AS c__email FROM comment c WHERE (c.active = '?' AND c.object_id = '?' AND c.group_name = '?')
bindings: 1, 1, unit
In database table:
id user_id object_id group_name name active
1 0 1 unit test 1
When I execute de query it returns 0 rows. Why?
If I go in phpmyadmin and I run
SELECT * FROM comment WHERE active=1 AND object_id=1 AND group_name='unit'
the result contains the record I look for.
In phpmyadmin the query generated by Doctrine identify the table name as 'c'. This is very strange, since I used in my application other DQL querys like this one and works.
Thanks. | 0 |
11,691,845 | 07/27/2012 16:25:18 | 1,447,992 | 06/05/2012 04:22:32 | 125 | 8 | Refreshing yahoo mail? | Yahoo mail isn't thunder bird, It doesn't refresh itself so you can see if you have new mail. Sometimes I don't reply for 10-20 minutes just because I didn't refresh the yahoo page.
So I'm thinking of a way to refresh my yahoo mail every two minutes. Could i maybe create a file containing yahoo mail as an iframe and refresh it every 2 minutes? How would you go about doing this? And how can you refresh an iframe every 2 minutes? | php | javascript | iframe | yahoo | null | 07/29/2012 06:59:37 | off topic | Refreshing yahoo mail?
===
Yahoo mail isn't thunder bird, It doesn't refresh itself so you can see if you have new mail. Sometimes I don't reply for 10-20 minutes just because I didn't refresh the yahoo page.
So I'm thinking of a way to refresh my yahoo mail every two minutes. Could i maybe create a file containing yahoo mail as an iframe and refresh it every 2 minutes? How would you go about doing this? And how can you refresh an iframe every 2 minutes? | 2 |
8,596,196 | 12/21/2011 20:53:40 | 1,100,190 | 12/15/2011 15:27:15 | 8 | 0 | What is the best compression method (7-zip) for SQL Server backup file? | Given an arbitrary *.bak file (up to 50GB) with a SQL server database backup created using a standard BACKUP DATABASE command, in my program (.NET) I need to compress it to the *.zip file the best way possible (balancing speed and size).
I had a bad experience with SharpZipLib and Xceed often chokes on large files. I plan just to use 7-zip directly (assuming it is installed). What is the best (7-zip) compression method to use for this type of data?
| sql | sql-server | compression | backup | 7zip | 12/21/2011 21:10:05 | off topic | What is the best compression method (7-zip) for SQL Server backup file?
===
Given an arbitrary *.bak file (up to 50GB) with a SQL server database backup created using a standard BACKUP DATABASE command, in my program (.NET) I need to compress it to the *.zip file the best way possible (balancing speed and size).
I had a bad experience with SharpZipLib and Xceed often chokes on large files. I plan just to use 7-zip directly (assuming it is installed). What is the best (7-zip) compression method to use for this type of data?
| 2 |
670,641 | 03/22/2009 07:07:55 | 17,560 | 09/18/2008 11:39:52 | 1,133 | 46 | Dephi - Threading frameworks | I am looking for a Threading framework to use in my delphi application.
Currently I am evaluating ‘[OmniThreadLibrary][1]’ - so far it looks good and does every I need.
Is any other ‘Threading framework’ for delphi ?
(I am using D2006 & D2009)
[1]: http://otl.17slon.com/index.htm | delphi | threading-framework | null | null | null | 02/07/2012 14:55:02 | not constructive | Dephi - Threading frameworks
===
I am looking for a Threading framework to use in my delphi application.
Currently I am evaluating ‘[OmniThreadLibrary][1]’ - so far it looks good and does every I need.
Is any other ‘Threading framework’ for delphi ?
(I am using D2006 & D2009)
[1]: http://otl.17slon.com/index.htm | 4 |
7,013,751 | 08/10/2011 15:48:00 | 848,968 | 07/17/2011 18:58:17 | 37 | 8 | Is this TASM Program to Add N Numbers Efficeint | The Assembly Program Given here [http://c-madeeasy.blogspot.com/2011/08/tasm-program-to-find-sum-of-n-numbers.html][1] uses a Standard approach for adding N Numbers, Is this Method Efficient.What can be do to improve its efficiency?
[1]: http://c-madeeasy.blogspot.com/2011/08/tasm-program-to-find-sum-of-n-numbers.html | assembly | efficiency | numbers | add | tasm | 08/29/2011 08:28:49 | not a real question | Is this TASM Program to Add N Numbers Efficeint
===
The Assembly Program Given here [http://c-madeeasy.blogspot.com/2011/08/tasm-program-to-find-sum-of-n-numbers.html][1] uses a Standard approach for adding N Numbers, Is this Method Efficient.What can be do to improve its efficiency?
[1]: http://c-madeeasy.blogspot.com/2011/08/tasm-program-to-find-sum-of-n-numbers.html | 1 |
5,344,450 | 03/17/2011 19:53:28 | 591,130 | 01/26/2011 18:50:00 | 24 | 1 | Facebook Like button - prevent XFBML version from resizing height | I'm trying to use the XFBML version of the Facebook Like button. On a page with zero likes, the main problem is the order of events when the page loads:
- HTML loads
- Like button loads
- Button expands height, pushing content below it down
- Button sees it has no likes
- Button reduces height, moving content below back up
This happens regardless of how the [Javascript SDK][1] is loaded (standard or asynchronous).
Is there a way to prevent this distracting automatic resizing from happening?
Here's a [test page][2] showing the behavior.
[1]: http://developers.facebook.com/docs/reference/javascript/
[2]: http://bit.ly/egaWXR | javascript | facebook | height | null | null | null | open | Facebook Like button - prevent XFBML version from resizing height
===
I'm trying to use the XFBML version of the Facebook Like button. On a page with zero likes, the main problem is the order of events when the page loads:
- HTML loads
- Like button loads
- Button expands height, pushing content below it down
- Button sees it has no likes
- Button reduces height, moving content below back up
This happens regardless of how the [Javascript SDK][1] is loaded (standard or asynchronous).
Is there a way to prevent this distracting automatic resizing from happening?
Here's a [test page][2] showing the behavior.
[1]: http://developers.facebook.com/docs/reference/javascript/
[2]: http://bit.ly/egaWXR | 0 |
7,539,972 | 09/24/2011 15:31:34 | 962,743 | 09/24/2011 15:20:48 | 1 | 0 | Connect FB Login to My domain DB | The problem you're running into here is that you cannot get someone's email address from Facebook, as it is purposely hidden to protect privacy. If your membership scripts provide only the email/password log-in method, then what you need to do is modify these scripts to create the authentication cookie when given a properly authenticated Facebook ID.
Ive read that there is no way to get the email from the users fb account
"Essentially you'll have two login functions... one for a Facebook login, and one for a regular login. Either function should properly created the local authentication cookie. "
So im wondering is there another way to go about this matter because my db auth is controlled by php not ssl so i would like to keep my site secure and the user whats the best way to do this do you have any examples of a modified script
| facebook | email | connect | null | null | 09/25/2011 09:52:35 | not a real question | Connect FB Login to My domain DB
===
The problem you're running into here is that you cannot get someone's email address from Facebook, as it is purposely hidden to protect privacy. If your membership scripts provide only the email/password log-in method, then what you need to do is modify these scripts to create the authentication cookie when given a properly authenticated Facebook ID.
Ive read that there is no way to get the email from the users fb account
"Essentially you'll have two login functions... one for a Facebook login, and one for a regular login. Either function should properly created the local authentication cookie. "
So im wondering is there another way to go about this matter because my db auth is controlled by php not ssl so i would like to keep my site secure and the user whats the best way to do this do you have any examples of a modified script
| 1 |
8,195,125 | 11/19/2011 15:46:33 | 836,679 | 07/09/2011 12:30:45 | 44 | 0 | Resources injection doesn't work when running jms examples in eclipse. | I want to run the jms tutorial files in eclipse. I have configured glassfish properly and added the jms resources. It works ok if I run it in netbeans.
I created an "application client project" in eclipse.
Here is where the resources get injected:
@Resource(mappedName = "jms/ConnectionFactory")
private static ConnectionFactory connectionFactory;
@Resource(mappedName = "jms/Queue")
private static Queue queue;
@Resource(mappedName = "jms/Topic")
private static Topic topic;
Then, when it gets here:
connection = connectionFactory.createConnection();
I get a NullPointerException. For some reason it doesn't get the resources from the server so they are null.
It works if I build the project in eclipse and then run it from a command line using appclient:
appclient Producer topic 4
It says here http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jst.j2ee.doc.user%2Ftopics%2Fcjappcliproj.html that:
> An application client module is used to contain a full-function client
> Java™ application (non Web-based) that connects to and uses the Java
> EE resources defined in your server. When you place the client code in
> an application client module instead of a simple JAR file, the
> application client benefits from the server's resources (it does not
> need to re-specify the class path to Java EE and server JAR files) as
> well as from easier JNDI lookup (the client container fills in the
> initial context and other parameters).
So it seems that I am on the right track, but maybe I am missing some eclipse configuration.
Thanks | eclipse | java-ee | glassfish | jms | injection | null | open | Resources injection doesn't work when running jms examples in eclipse.
===
I want to run the jms tutorial files in eclipse. I have configured glassfish properly and added the jms resources. It works ok if I run it in netbeans.
I created an "application client project" in eclipse.
Here is where the resources get injected:
@Resource(mappedName = "jms/ConnectionFactory")
private static ConnectionFactory connectionFactory;
@Resource(mappedName = "jms/Queue")
private static Queue queue;
@Resource(mappedName = "jms/Topic")
private static Topic topic;
Then, when it gets here:
connection = connectionFactory.createConnection();
I get a NullPointerException. For some reason it doesn't get the resources from the server so they are null.
It works if I build the project in eclipse and then run it from a command line using appclient:
appclient Producer topic 4
It says here http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jst.j2ee.doc.user%2Ftopics%2Fcjappcliproj.html that:
> An application client module is used to contain a full-function client
> Java™ application (non Web-based) that connects to and uses the Java
> EE resources defined in your server. When you place the client code in
> an application client module instead of a simple JAR file, the
> application client benefits from the server's resources (it does not
> need to re-specify the class path to Java EE and server JAR files) as
> well as from easier JNDI lookup (the client container fills in the
> initial context and other parameters).
So it seems that I am on the right track, but maybe I am missing some eclipse configuration.
Thanks | 0 |
7,377,085 | 09/11/2011 08:14:06 | 568,825 | 01/09/2011 14:36:57 | 99 | 0 | Mix value from two different rows | Hi I have a table in my database for product discount which looks something like this:
id product quantity NewPrice
On my website in php at the moment:
for each row:<br>
**Price per unit when buying $quanity or more: $NewPrice**<br>
But what I would like is:
**Price per unit when buying $quanity1-$quanity2: $NewPrice1<br>
Price per unit when buying $quanity2-$quanity3: $NewPrice2<br>
Price per unit when buying $quanity3 or more: $NewPrice3<br>**
So basically I would like to take the quanity-value from two different rows to make up the text for the price from the first row.
If that makes sense? | php | mysql | null | null | null | 09/11/2011 08:41:26 | too localized | Mix value from two different rows
===
Hi I have a table in my database for product discount which looks something like this:
id product quantity NewPrice
On my website in php at the moment:
for each row:<br>
**Price per unit when buying $quanity or more: $NewPrice**<br>
But what I would like is:
**Price per unit when buying $quanity1-$quanity2: $NewPrice1<br>
Price per unit when buying $quanity2-$quanity3: $NewPrice2<br>
Price per unit when buying $quanity3 or more: $NewPrice3<br>**
So basically I would like to take the quanity-value from two different rows to make up the text for the price from the first row.
If that makes sense? | 3 |
11,710,220 | 07/29/2012 14:58:13 | 1,561,098 | 07/29/2012 14:41:53 | 1 | 0 | Facebook thinks this site may be unsafe | Why my page link to my website are giving this msg :
"**Facebook thinks this site may be unsafe. If you're not familiar with it, please provide feedback by marking it as spam (you'll be brought back to Facebook).**"
i was exporting my website to the facebook page :(
where can i unlock this ? | facebook | facebook-graph-api | spam | unsafe | null | 07/29/2012 19:03:09 | off topic | Facebook thinks this site may be unsafe
===
Why my page link to my website are giving this msg :
"**Facebook thinks this site may be unsafe. If you're not familiar with it, please provide feedback by marking it as spam (you'll be brought back to Facebook).**"
i was exporting my website to the facebook page :(
where can i unlock this ? | 2 |
7,091,799 | 08/17/2011 11:07:06 | 541,976 | 12/14/2010 13:00:43 | 119 | 0 | what does this mean: Requested Range Not Satisfiable | i get this 416 error and dont know how to fix it
http://stackoverflow.com/questions/6584291/http-error-416-requested-range-not-satisfiable
didnt help much
please help? | http | null | null | null | null | 08/17/2011 11:19:40 | not a real question | what does this mean: Requested Range Not Satisfiable
===
i get this 416 error and dont know how to fix it
http://stackoverflow.com/questions/6584291/http-error-416-requested-range-not-satisfiable
didnt help much
please help? | 1 |
10,694,995 | 05/22/2012 02:20:31 | 1,179,459 | 01/31/2012 03:43:25 | 29 | 0 | phpdocumentor web interface output Zend error | I just installed the PhpDocumentor via pear and it seems to be working fine, however i am confused how do i generate the documentation to the html out put,
because when i run the
phpdoc -o HTML:frames:earthli -f sample1.php -t docs
this results in a error saying
PHP Warning: require_once(Zend/Console/Getopt/Exception.php): failed to open st
ream: No such file or directory in /usr/lib/php/phpDocumentor/src/Zend/Console/G
etopt.php on line 783
PHP Fatal error: require_once(): Failed opening required 'Zend/Console/Getopt/E
xception.php' (include_path='.:/usr/lib/php') in /usr/lib/php/phpDocumentor/src/
Zend/Console/Getopt.php on line 783
when i run the
root@ [~]# phpdoc run -d /home/somedir -t /home/somedir/doc
it outputs the XML file and css and js.. etc however i am not sure how i can use them as they are not HTML but XML file without a XSD.
any idea ?
| phpdoc | phpdocumentor | null | null | null | null | open | phpdocumentor web interface output Zend error
===
I just installed the PhpDocumentor via pear and it seems to be working fine, however i am confused how do i generate the documentation to the html out put,
because when i run the
phpdoc -o HTML:frames:earthli -f sample1.php -t docs
this results in a error saying
PHP Warning: require_once(Zend/Console/Getopt/Exception.php): failed to open st
ream: No such file or directory in /usr/lib/php/phpDocumentor/src/Zend/Console/G
etopt.php on line 783
PHP Fatal error: require_once(): Failed opening required 'Zend/Console/Getopt/E
xception.php' (include_path='.:/usr/lib/php') in /usr/lib/php/phpDocumentor/src/
Zend/Console/Getopt.php on line 783
when i run the
root@ [~]# phpdoc run -d /home/somedir -t /home/somedir/doc
it outputs the XML file and css and js.. etc however i am not sure how i can use them as they are not HTML but XML file without a XSD.
any idea ?
| 0 |
8,153,525 | 11/16/2011 14:46:54 | 182,111 | 09/30/2009 20:56:35 | 339 | 13 | Looking for algorithm to help determine shortest path from one terminal screen to another | I am using a terminal client to interact with a mainframe computer. The entire interface is based on the concept of screens. An example workflow might look like:
- Login Screen: enter login credentials, press enter
- Menu Screen: enter the number of the menu item you want (lets say "6" for memos), press enter
- Memo Screen: enter account number, press enter
- Add Memo Screen: enter memo details, etc, press enter to save, F3 to go back
I have written a python application to automate the processing of records through this terminal interface. One of the difficulties I am having is that there are a lot of different screens and my application right now is pretty dumb about how to get from one screen to another. It can go from the login screen, to adding memos. But, if it finds itself on the memo screen and needs to de-activate an account, it has to logout and login again because it only knows how to get to the deactivation screen from the login screen, not from the add memos screen.
So, I would like to create a "map" in my application that links each screen to the screens that are "next" to it. Then, I need an algorithm that could tell how to get from any screen A to any screen B in the shortest manner possible.
I already have some screen objects setup and have "related" them to the screens next to them. So, I am looking for some kind of algorithm that I can implement or python library that I can use that will do the work of calculating the route from one screen to another.
| python | graph-algorithm | null | null | null | null | open | Looking for algorithm to help determine shortest path from one terminal screen to another
===
I am using a terminal client to interact with a mainframe computer. The entire interface is based on the concept of screens. An example workflow might look like:
- Login Screen: enter login credentials, press enter
- Menu Screen: enter the number of the menu item you want (lets say "6" for memos), press enter
- Memo Screen: enter account number, press enter
- Add Memo Screen: enter memo details, etc, press enter to save, F3 to go back
I have written a python application to automate the processing of records through this terminal interface. One of the difficulties I am having is that there are a lot of different screens and my application right now is pretty dumb about how to get from one screen to another. It can go from the login screen, to adding memos. But, if it finds itself on the memo screen and needs to de-activate an account, it has to logout and login again because it only knows how to get to the deactivation screen from the login screen, not from the add memos screen.
So, I would like to create a "map" in my application that links each screen to the screens that are "next" to it. Then, I need an algorithm that could tell how to get from any screen A to any screen B in the shortest manner possible.
I already have some screen objects setup and have "related" them to the screens next to them. So, I am looking for some kind of algorithm that I can implement or python library that I can use that will do the work of calculating the route from one screen to another.
| 0 |
2,185,220 | 02/02/2010 15:33:20 | 57,883 | 01/22/2009 12:36:38 | 1,017 | 71 | In MSTests is it possible to catch any exception? | I am trying to avoid a brittle test. I'd like to assert that a method throws an exception when invalid data is passed in, and I don't care which one.
Take String.IsNullOrEmpty for instance, if the string is empty you don't want to throw a nullreference exception right? if it's null you I suppose you could throw an argumentException. I don't think having a seperate guard clause for null vs empty is a good idea, and regardless I'd like to be able to just assert that an exception is thrown from my unit.
using `[ExpectedException(typeof(Exception))]` gives an error saying the exception type must inherit from exception. My solution is a try/catch block with an Assert.Fail if no exception is thrown. Is there a better/cleaner way? | unit-testing | mstest | null | null | null | null | open | In MSTests is it possible to catch any exception?
===
I am trying to avoid a brittle test. I'd like to assert that a method throws an exception when invalid data is passed in, and I don't care which one.
Take String.IsNullOrEmpty for instance, if the string is empty you don't want to throw a nullreference exception right? if it's null you I suppose you could throw an argumentException. I don't think having a seperate guard clause for null vs empty is a good idea, and regardless I'd like to be able to just assert that an exception is thrown from my unit.
using `[ExpectedException(typeof(Exception))]` gives an error saying the exception type must inherit from exception. My solution is a try/catch block with an Assert.Fail if no exception is thrown. Is there a better/cleaner way? | 0 |
6,113,304 | 05/24/2011 15:59:41 | 644,987 | 03/04/2011 15:29:59 | 14 | 0 | text and image as one scrollable entity | I need an undefined amount of text and one or more pictures to be scrollable as one entity. I'm quite surprised that this doesn't seem to be provided by default, I thought I've seen that several times before... I tried to google, but all I find doesn't fit. The images won't be wider than the screen, but in between lines of text.
I need something that let's me do something like:
image <br/>
textA <br/>
textA goes on <br/>
______ screen ends here, content goes on<br/>
textA goes on <br/>
textA goes on <br/>
image<br/>
image<br/>
textB <br/>
textB goes on <br/>
image <br/>
textC
The content for the text would come out of a plist, but I THINK I can predict it will be REALLY static, so I could just set the Text in IB and create a view for every content -.-.
I've read about Web View, but as far as I got it, you'd need internet connection to make that work, and the app should work without any internet connection at all.
Any suggestions or experiences concerning that?
Thanks a lot! | iphone | objective-c | text | uiimageview | scrollable | null | open | text and image as one scrollable entity
===
I need an undefined amount of text and one or more pictures to be scrollable as one entity. I'm quite surprised that this doesn't seem to be provided by default, I thought I've seen that several times before... I tried to google, but all I find doesn't fit. The images won't be wider than the screen, but in between lines of text.
I need something that let's me do something like:
image <br/>
textA <br/>
textA goes on <br/>
______ screen ends here, content goes on<br/>
textA goes on <br/>
textA goes on <br/>
image<br/>
image<br/>
textB <br/>
textB goes on <br/>
image <br/>
textC
The content for the text would come out of a plist, but I THINK I can predict it will be REALLY static, so I could just set the Text in IB and create a view for every content -.-.
I've read about Web View, but as far as I got it, you'd need internet connection to make that work, and the app should work without any internet connection at all.
Any suggestions or experiences concerning that?
Thanks a lot! | 0 |
11,400,175 | 07/09/2012 17:35:53 | 9,382 | 09/15/2008 18:36:29 | 12,964 | 229 | Mechanics of partitioning | Imagine the following hypothetical database structure. Basically it's a top down structure (Country has Orders, Order has OrderLines, OrderLine has ShipLines, etc...).
![enter image description here][1]
I want to partition my SQL Server 2008 database by CountryID. As you can see, CountryID is only in the first 2 tables (e.g. amCountries and amOrders). Given that (as far as I understand) that partitioning is done at the table level, do I need to add CountryID to the remaining tables to be able to partition them? Or is there some type of cascade available in SQL Server that will allow me to skip adding CountryID to everything?
[1]: http://i.stack.imgur.com/Gfcmr.png | sql-server | sql-server-2008 | partitioning | database-partitioning | null | 07/09/2012 17:56:21 | off topic | Mechanics of partitioning
===
Imagine the following hypothetical database structure. Basically it's a top down structure (Country has Orders, Order has OrderLines, OrderLine has ShipLines, etc...).
![enter image description here][1]
I want to partition my SQL Server 2008 database by CountryID. As you can see, CountryID is only in the first 2 tables (e.g. amCountries and amOrders). Given that (as far as I understand) that partitioning is done at the table level, do I need to add CountryID to the remaining tables to be able to partition them? Or is there some type of cascade available in SQL Server that will allow me to skip adding CountryID to everything?
[1]: http://i.stack.imgur.com/Gfcmr.png | 2 |
8,419,624 | 12/07/2011 17:21:03 | 1,035,368 | 11/08/2011 10:01:12 | 6 | 1 | Firefox Driver in Selenium 2 work to slow when is set the proxy settings | I have problems with the firefox driver when I set the proxy settings. The settings is properly settled, but is working to slow and the firefox driver can't continue the program. My purpose is to open google then type some search criteria, to submit this criteria and to open one of the result pages that is show. Everything is good when I don't use the proxy. Here is my code for proxy:
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", 1);
profile.setPreference("network.proxy.http","some Proxy");
profile.setPreference("network.proxy.http_port", port);
driver = new FirefoxDriver(profile); | proxy | selenium2 | null | null | null | null | open | Firefox Driver in Selenium 2 work to slow when is set the proxy settings
===
I have problems with the firefox driver when I set the proxy settings. The settings is properly settled, but is working to slow and the firefox driver can't continue the program. My purpose is to open google then type some search criteria, to submit this criteria and to open one of the result pages that is show. Everything is good when I don't use the proxy. Here is my code for proxy:
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", 1);
profile.setPreference("network.proxy.http","some Proxy");
profile.setPreference("network.proxy.http_port", port);
driver = new FirefoxDriver(profile); | 0 |
6,700,197 | 07/14/2011 21:34:58 | 454,097 | 09/21/2010 15:03:49 | 64 | 3 | 'iexplore.exe' processes number doesn't match number of IE opened tabs | In Windows 7 i open 10 tabs in IE 9 (didn't check it in other versions of Windows or IE) and then open tasks manager. Count number of "iexplore.exe" processes and it's 6. Open 5 more tabs and now it's 7. Can someone please explain me why number of tabs doesn't match number of processes in this case? | windows | internet-explorer | windows-7 | process | null | 07/15/2011 19:45:21 | off topic | 'iexplore.exe' processes number doesn't match number of IE opened tabs
===
In Windows 7 i open 10 tabs in IE 9 (didn't check it in other versions of Windows or IE) and then open tasks manager. Count number of "iexplore.exe" processes and it's 6. Open 5 more tabs and now it's 7. Can someone please explain me why number of tabs doesn't match number of processes in this case? | 2 |
1,115,048 | 07/12/2009 00:53:33 | 48,705 | 12/23/2008 17:57:58 | 363 | 10 | Is there a tool to gather Win32 application usage statistics? | Is there any tool that can do this? Just like a website and for the same basic reasons? | usage-statistics | delphi | winapi | null | null | 07/13/2009 15:14:23 | not a real question | Is there a tool to gather Win32 application usage statistics?
===
Is there any tool that can do this? Just like a website and for the same basic reasons? | 1 |
4,608,718 | 01/05/2011 20:12:03 | 564,517 | 01/05/2011 20:12:03 | 1 | 0 | What are they best at - the C and C++ | A friend of mine decided to learn some lower level language (to increaze his abilities) so he is thinking C. Or maybe C++?!
He does not know either to just learn C or go full way with C++.
He asked me what are they used for and couldn't tell him (its been a while since I last used either C or C++).
So my question, trying to help my friend, is **What are they best at, C and C++?**.
When you need C++ and when is C enough?
**P.S. I am not trying to start a war or argument. I don't want syntax explanations like C does not do templates or does not have classes to better think in OOP etc. I just want to know what are the strongest points of each as applicability, functional solutions**
| c++ | c | programming-languages | null | null | 01/05/2011 20:18:11 | not constructive | What are they best at - the C and C++
===
A friend of mine decided to learn some lower level language (to increaze his abilities) so he is thinking C. Or maybe C++?!
He does not know either to just learn C or go full way with C++.
He asked me what are they used for and couldn't tell him (its been a while since I last used either C or C++).
So my question, trying to help my friend, is **What are they best at, C and C++?**.
When you need C++ and when is C enough?
**P.S. I am not trying to start a war or argument. I don't want syntax explanations like C does not do templates or does not have classes to better think in OOP etc. I just want to know what are the strongest points of each as applicability, functional solutions**
| 4 |
11,709,679 | 07/29/2012 13:38:19 | 1,406,441 | 05/20/2012 15:52:50 | 5 | 1 | c++ destructing manual | I am trying to create code that 'talented with perf'.
For doing that ,I skiped some variables initializes when needed.
For example:
bool Func(bool BooleanParameter) {
if (BooleanParameter)
goto _true;
else
goto _false;
_true:
string str; //Some code after that one that does with this variable
return false;
_false:
return true; //Exception because str doesn't initialized
}
But there is exception because there a way to not initialize variables and that variables destruct at the end.
Don't forget the 'talented with perf'. | c++ | constructor | null | null | null | 07/29/2012 14:20:05 | not a real question | c++ destructing manual
===
I am trying to create code that 'talented with perf'.
For doing that ,I skiped some variables initializes when needed.
For example:
bool Func(bool BooleanParameter) {
if (BooleanParameter)
goto _true;
else
goto _false;
_true:
string str; //Some code after that one that does with this variable
return false;
_false:
return true; //Exception because str doesn't initialized
}
But there is exception because there a way to not initialize variables and that variables destruct at the end.
Don't forget the 'talented with perf'. | 1 |
5,776,471 | 04/25/2011 08:06:56 | 508,127 | 11/15/2010 10:28:18 | 905 | 3 | Best way of using connection in .net | i often open connection and close connection after use. i dont know is it best practice or should i open connection through out apps life and close when apps close. please discuss. thanks. | .net | null | null | null | null | 04/25/2011 08:10:04 | not a real question | Best way of using connection in .net
===
i often open connection and close connection after use. i dont know is it best practice or should i open connection through out apps life and close when apps close. please discuss. thanks. | 1 |
3,979,526 | 10/20/2010 15:27:16 | 332,332 | 05/04/2010 12:15:59 | 63 | 2 | Qt4 Program Crashing Unless SDK Installed | I've written a Open Source program that I've released as GPL built using the Qt4 LGPL SDK. This program has the ability to search an optional Sqlite3 database for data.
Here is what is making me lose my mind. I compile the program on the development machine. When I try to run it, I can errors about missing DLLs. I copy those dlls into the same directory as the executable and it now works fine ( mingwm10.dll, libgcc_s_dw2-1.dll, QtCore4.dll, QtSql4.dll, QtGui4.dll ), including the database search.
Now, if I copy that folder with the executable and the DLLs to a new machine that has not had the SDK installed on it, it runs fine until I try to search. As soon as I hit the search button, I can the following error:
Title: Microsoft Visual C++ Runtime Library
Runtime Error!
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I then download and install the SDK, doing nothing else, I can now run the program and search the sqlite3 file just fine!
What magic am I missing?
Thanks in advance.
P.S. Both machines are freshly installed Windows XP systems.
| windows | qt | sdk | qt4 | gpl | null | open | Qt4 Program Crashing Unless SDK Installed
===
I've written a Open Source program that I've released as GPL built using the Qt4 LGPL SDK. This program has the ability to search an optional Sqlite3 database for data.
Here is what is making me lose my mind. I compile the program on the development machine. When I try to run it, I can errors about missing DLLs. I copy those dlls into the same directory as the executable and it now works fine ( mingwm10.dll, libgcc_s_dw2-1.dll, QtCore4.dll, QtSql4.dll, QtGui4.dll ), including the database search.
Now, if I copy that folder with the executable and the DLLs to a new machine that has not had the SDK installed on it, it runs fine until I try to search. As soon as I hit the search button, I can the following error:
Title: Microsoft Visual C++ Runtime Library
Runtime Error!
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I then download and install the SDK, doing nothing else, I can now run the program and search the sqlite3 file just fine!
What magic am I missing?
Thanks in advance.
P.S. Both machines are freshly installed Windows XP systems.
| 0 |
10,254,505 | 04/20/2012 22:48:06 | 1,296,946 | 03/28/2012 01:31:03 | 1 | 3 | ViewResult fails to return values once a new parameter (not id) is used | I have a bit of a weird issue with a record display. If a user enters a bar-code numeric (int) value into a URL, I'm supposed to show the details of the record linked to that bar-code. At one time, GUIDs (CodeId GUID PK) were used for the bar-codes, but now we are adding a new Int field (SerialId IDENTITY Int) to keep track of the actual bar-code value; we're not allowed to change the CodeId field on the table (which called Code), so this leads to my odd issue. I've looked around, and this http://stackoverflow.com/questions/2146004/querystring-id-parameter-not-being-used is the closest that I can find to addressing what's happening with me.
My Routing is perfectly normal
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
Model is normal
public DbSet<Code> Codes { get; set; }
public partial class Code
{
public System.Guid CodeId { get; set; }
public int SerialId { get; set; }
public string Title { get; set; }
public string BarCodeDescr { get; set; }
public System.DateTime CreateDate { get; set; }
public System.DateTime LastActivityDate { get; set; }
}
My controller worked just fine when things were a GUID, and the Id mapped to CodeId (the table's PK) etc.
public ViewResult BarCode(Guid id)
{
Code code = db.Codes.Find(id);
return View(code);
}
Now I'm trying to do something more like this:
public ViewResult BarCode(int serialid)
{
Code code = db.Codes.Find(serialid);
return View(code);
}
or this...
public ActionResult QRCode(int serialid)
{
ViewData["SerialId"] = serialid;
return View(db.Codes.Where(x => x.SerialId == serialid).ToList());
}
...only all my attempts lead to the same error:
The parameters dictionary contains a null entry for parameter 'serialid'
of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult
BarCode(Int32)' in 'MyProject.Controllers.HomeController'. An optional parameter
must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
What am I doing wrong? It's not ideal to have my view return a record based on searching for a specific SerialId instead of the CodeId, but it should be do-able, right? | asp.net-mvc-3 | query-string | null | null | null | null | open | ViewResult fails to return values once a new parameter (not id) is used
===
I have a bit of a weird issue with a record display. If a user enters a bar-code numeric (int) value into a URL, I'm supposed to show the details of the record linked to that bar-code. At one time, GUIDs (CodeId GUID PK) were used for the bar-codes, but now we are adding a new Int field (SerialId IDENTITY Int) to keep track of the actual bar-code value; we're not allowed to change the CodeId field on the table (which called Code), so this leads to my odd issue. I've looked around, and this http://stackoverflow.com/questions/2146004/querystring-id-parameter-not-being-used is the closest that I can find to addressing what's happening with me.
My Routing is perfectly normal
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
Model is normal
public DbSet<Code> Codes { get; set; }
public partial class Code
{
public System.Guid CodeId { get; set; }
public int SerialId { get; set; }
public string Title { get; set; }
public string BarCodeDescr { get; set; }
public System.DateTime CreateDate { get; set; }
public System.DateTime LastActivityDate { get; set; }
}
My controller worked just fine when things were a GUID, and the Id mapped to CodeId (the table's PK) etc.
public ViewResult BarCode(Guid id)
{
Code code = db.Codes.Find(id);
return View(code);
}
Now I'm trying to do something more like this:
public ViewResult BarCode(int serialid)
{
Code code = db.Codes.Find(serialid);
return View(code);
}
or this...
public ActionResult QRCode(int serialid)
{
ViewData["SerialId"] = serialid;
return View(db.Codes.Where(x => x.SerialId == serialid).ToList());
}
...only all my attempts lead to the same error:
The parameters dictionary contains a null entry for parameter 'serialid'
of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult
BarCode(Int32)' in 'MyProject.Controllers.HomeController'. An optional parameter
must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
What am I doing wrong? It's not ideal to have my view return a record based on searching for a specific SerialId instead of the CodeId, but it should be do-able, right? | 0 |
9,516,281 | 03/01/2012 12:29:25 | 361,633 | 06/08/2010 17:13:52 | 31 | 3 | Windows Forms support in Visual Studio 11 | Would be Windows Forms supported in Visual Studio 11? Can i develop applications(desktop) using Windows Forms for Windows 8 or i'm forced to use WPF/Silverlight or HTML 5 + Javascript??? | windows | winforms | null | null | null | 03/01/2012 13:21:42 | too localized | Windows Forms support in Visual Studio 11
===
Would be Windows Forms supported in Visual Studio 11? Can i develop applications(desktop) using Windows Forms for Windows 8 or i'm forced to use WPF/Silverlight or HTML 5 + Javascript??? | 3 |
1,752,188 | 11/17/2009 22:06:19 | 213,306 | 11/17/2009 22:06:19 | 1 | 0 | Can Scrum work with mediocre developers? | Anyone ever tried to assimilate Scrum to a team where most developers are just mediocre?
I mean developers who aren't the most tech savvy, has bad time-management skills, but most of all - lack the sense of personal responsibility and commitment.
Do you think it *can* work? Or would you try a different methodology? | scrum | methodology | agile | null | null | 03/29/2011 15:11:17 | off topic | Can Scrum work with mediocre developers?
===
Anyone ever tried to assimilate Scrum to a team where most developers are just mediocre?
I mean developers who aren't the most tech savvy, has bad time-management skills, but most of all - lack the sense of personal responsibility and commitment.
Do you think it *can* work? Or would you try a different methodology? | 2 |
6,608,629 | 07/07/2011 09:43:55 | 822,964 | 06/30/2011 11:42:38 | 6 | 0 | how to create a email content using google direction response? | i can get the directions from one place to another in my local gmap
i need to mail that direction data to any email id specified in a text box.
i found that gdirection.getDistence()[html], and gdirection.getDescriptionHtml() are embedded with html tags
is there any way to do my task?
are the above methods useful or what is the correct way to do this?
please help me on this
thanks in advance | php | javascript | google-maps | null | null | null | open | how to create a email content using google direction response?
===
i can get the directions from one place to another in my local gmap
i need to mail that direction data to any email id specified in a text box.
i found that gdirection.getDistence()[html], and gdirection.getDescriptionHtml() are embedded with html tags
is there any way to do my task?
are the above methods useful or what is the correct way to do this?
please help me on this
thanks in advance | 0 |
7,529,656 | 09/23/2011 13:25:36 | 446,514 | 09/13/2010 15:51:53 | 354 | 1 | Use a file as a buffer for a producer consumer system of two programs | I have two programs one of which writes some entries into a file and the other one reads all the entries from the file an processes them.
Currently, the files are executed sequentially. That means, the first programs produces the file completely and exits before the second program is run. Now I want, without much modifications that the second program can be run simultaneously in a producer-consumer fashion. I know I should use interprocess communication, but at this point I want to make minimal changes the programs to get the running.
Specifically, I want that the second program processes the entries from the second file in real time as they are generated by the first file. | c++ | file | ipc | null | null | null | open | Use a file as a buffer for a producer consumer system of two programs
===
I have two programs one of which writes some entries into a file and the other one reads all the entries from the file an processes them.
Currently, the files are executed sequentially. That means, the first programs produces the file completely and exits before the second program is run. Now I want, without much modifications that the second program can be run simultaneously in a producer-consumer fashion. I know I should use interprocess communication, but at this point I want to make minimal changes the programs to get the running.
Specifically, I want that the second program processes the entries from the second file in real time as they are generated by the first file. | 0 |
10,581,173 | 05/14/2012 10:03:14 | 1,341,693 | 04/18/2012 14:49:28 | 1 | 0 | Why does use of stdbool.h cause warning when combined with -Wtraditional-conversion | This is an example:
#include <stdbool.h>
void foo(bool b){};
void bar(bool b) {foo(b);}
int main() {
bar(false);
}
I compile with:
gcc -Wtraditional-conversion test.c
I get these warnings:
test.c: In function 'bar':
test.c:4: warning: passing argument 1 of 'foo' with different width due to prototype
test.c: In function 'main':
test.c:7: warning: passing argument 1 of 'bar' with different width due to prototype
Why do these warnings occur? As far as I can see the arguments are all the same type, so should be the same width. What is -Wtraditional-conversion doing to cause these warnings in this very simple piece of code?
I started to get these errors when I switched from using my own typedef of bool to the stdbool.h def.
My original def was:
typedef enum {false, true} bool;
| c | gcc | gcc-warning | null | null | null | open | Why does use of stdbool.h cause warning when combined with -Wtraditional-conversion
===
This is an example:
#include <stdbool.h>
void foo(bool b){};
void bar(bool b) {foo(b);}
int main() {
bar(false);
}
I compile with:
gcc -Wtraditional-conversion test.c
I get these warnings:
test.c: In function 'bar':
test.c:4: warning: passing argument 1 of 'foo' with different width due to prototype
test.c: In function 'main':
test.c:7: warning: passing argument 1 of 'bar' with different width due to prototype
Why do these warnings occur? As far as I can see the arguments are all the same type, so should be the same width. What is -Wtraditional-conversion doing to cause these warnings in this very simple piece of code?
I started to get these errors when I switched from using my own typedef of bool to the stdbool.h def.
My original def was:
typedef enum {false, true} bool;
| 0 |
2,278,211 | 02/17/2010 03:58:50 | 118,644 | 06/06/2009 20:40:11 | 843 | 9 | Is there a Java solution to svnserve like svnkit is to subversion in Java? | Is there a Java solution to svnserve like svnkit is to subversion in Java? | java | svn | null | null | null | null | open | Is there a Java solution to svnserve like svnkit is to subversion in Java?
===
Is there a Java solution to svnserve like svnkit is to subversion in Java? | 0 |
858,987 | 05/13/2009 16:31:53 | 102,427 | 05/06/2009 19:17:41 | 1 | 1 | Trying to get generic when generic is not available. | I am trying to develop some general purpose custom ValidationAttributes. The fact that one cannot create a generic subclass of an attribute is making me nuts.
Here is my code for the IsValid override in a ValidationAttribute to verify that the value of a property is unique:
public override bool IsValid(object value)
{
SomeDataContext context = SomeDataContext.GetNewDataContext();
Type tableType = typeof(Table<>).MakeGenericType(new Type[] { _EntityType });
var table = Activator.CreateInstance(tableType);
//ITable table = context.GetTable(_EntityType);
var codeProp = (from member in context.Mapping.GetMetaType(_EntityType).DataMembers
where member.Name == _PropertyName
select member.Member).Single();
ParameterExpression param = Expression.Parameter(_EntityType, "x");
MemberExpression memberExp = Expression.Property(param, (PropertyInfo)codeProp);
Expression body = Expression.Equal(memberExp, Expression.Constant(value, typeof(char)));
//var predicate = Expression.Lambda<Func<TEntityType, bool>>(body, param);
Type lambdaType = typeof(Func<,>).MakeGenericType(_EntityType, typeof(bool));
var predicate = Expression.Lambda(lambdaType, body, param);
object code = table.FirstOrDefault(predicate);
if (code != null)
{
return false;
}
return true;
}
This line:
object code = table.FirstOrDefault(predicate);
errors out:
'object' does not contain a definition for 'FirstOrDefault' and no extension ......etc.
How do I define, cast or otherwise get the compiler to recognize "table" as something that exposes a .FirstOrDefault method?
Thanks
| linq | generics | lambda | c# | null | null | open | Trying to get generic when generic is not available.
===
I am trying to develop some general purpose custom ValidationAttributes. The fact that one cannot create a generic subclass of an attribute is making me nuts.
Here is my code for the IsValid override in a ValidationAttribute to verify that the value of a property is unique:
public override bool IsValid(object value)
{
SomeDataContext context = SomeDataContext.GetNewDataContext();
Type tableType = typeof(Table<>).MakeGenericType(new Type[] { _EntityType });
var table = Activator.CreateInstance(tableType);
//ITable table = context.GetTable(_EntityType);
var codeProp = (from member in context.Mapping.GetMetaType(_EntityType).DataMembers
where member.Name == _PropertyName
select member.Member).Single();
ParameterExpression param = Expression.Parameter(_EntityType, "x");
MemberExpression memberExp = Expression.Property(param, (PropertyInfo)codeProp);
Expression body = Expression.Equal(memberExp, Expression.Constant(value, typeof(char)));
//var predicate = Expression.Lambda<Func<TEntityType, bool>>(body, param);
Type lambdaType = typeof(Func<,>).MakeGenericType(_EntityType, typeof(bool));
var predicate = Expression.Lambda(lambdaType, body, param);
object code = table.FirstOrDefault(predicate);
if (code != null)
{
return false;
}
return true;
}
This line:
object code = table.FirstOrDefault(predicate);
errors out:
'object' does not contain a definition for 'FirstOrDefault' and no extension ......etc.
How do I define, cast or otherwise get the compiler to recognize "table" as something that exposes a .FirstOrDefault method?
Thanks
| 0 |
7,731,392 | 10/11/2011 19:26:33 | 526,582 | 12/01/2010 13:14:48 | 194 | 10 | What var type you use on growing buffers | I need to read some bytes from a socket stream.
No i do a expanding buffer like this:
long curbufsize = 1024*24;
long expand = 1024*24;
void *buf = xmalloc(curbufsize);
void *buf_ptr_start = buf;
char mem[1024*24];
while (rc = my_read_from_stream(handle, mem, sizeof(men)) {
len = (int)buf-((int)buf_ptr_start+rc);
if(curbufsize < len) {
curbufsize+=expand;
xrealloc(buf_ptr_start, curbufsize);
}
memcpy(buf, mem, rc);
}
where should i use size_t and long/int? Should the buffersize be a size_t?
Should i better write for the new len calculation:
len = (size_t)buf-((size_t)buf_ptr_start+rc);
Any other optimization?
Thanks | c | malloc | null | null | null | 10/12/2011 01:14:47 | too localized | What var type you use on growing buffers
===
I need to read some bytes from a socket stream.
No i do a expanding buffer like this:
long curbufsize = 1024*24;
long expand = 1024*24;
void *buf = xmalloc(curbufsize);
void *buf_ptr_start = buf;
char mem[1024*24];
while (rc = my_read_from_stream(handle, mem, sizeof(men)) {
len = (int)buf-((int)buf_ptr_start+rc);
if(curbufsize < len) {
curbufsize+=expand;
xrealloc(buf_ptr_start, curbufsize);
}
memcpy(buf, mem, rc);
}
where should i use size_t and long/int? Should the buffersize be a size_t?
Should i better write for the new len calculation:
len = (size_t)buf-((size_t)buf_ptr_start+rc);
Any other optimization?
Thanks | 3 |
11,222,930 | 06/27/2012 09:13:07 | 1,484,622 | 06/27/2012 05:31:04 | 8 | 0 | x.lastChild.nodeValue | <html>
<head>
<script type="text/javascript" src="jQuery.js">
<script type="text/javascript">
x=document.getElementByTagName("p");
document.write(x.lastChild.nodeValue);
</script>
</head>
<body>
<p id="intro">Hello World 1!</p>
<p id="intro">Hello World 2!</p>
<p id="intro">Hello World 3!</p>
</body>
</html>
Why doesn't the above code work. I want to show [Hello World 3!] by using the statement documetn.write(x.lastChild.nodeValue());
Thanks in advance... | last-child | null | null | null | null | null | open | x.lastChild.nodeValue
===
<html>
<head>
<script type="text/javascript" src="jQuery.js">
<script type="text/javascript">
x=document.getElementByTagName("p");
document.write(x.lastChild.nodeValue);
</script>
</head>
<body>
<p id="intro">Hello World 1!</p>
<p id="intro">Hello World 2!</p>
<p id="intro">Hello World 3!</p>
</body>
</html>
Why doesn't the above code work. I want to show [Hello World 3!] by using the statement documetn.write(x.lastChild.nodeValue());
Thanks in advance... | 0 |
2,222,180 | 02/08/2010 14:26:08 | 145,782 | 07/27/2009 14:22:16 | 32 | 2 | Excel Macros... | I need to write an excel macro so that in the range of(a:a) if there any value as Closed then the entire row should be hidden. How to do so... | excel | null | null | null | null | 07/18/2012 02:27:54 | not a real question | Excel Macros...
===
I need to write an excel macro so that in the range of(a:a) if there any value as Closed then the entire row should be hidden. How to do so... | 1 |
7,034,516 | 08/12/2011 00:35:50 | 788,652 | 06/08/2011 06:16:15 | 16 | 1 | Nano Editor on Remote Server broken after OS X Lion Upgrade on Local | I am having a problem with my remote servers. I typically use the nano editor to modify files but suddenly after installing OS X lion on my local pc the editor seems broken. After some time suddenly the cursor seems randomly jumping around (it stays at the same position), text is written over other text. That makes it impossibile to do any text editing.
I have the same issue on two Macs.
I am using several aliases in /etc/bashrc. Could that be the issue? | linux | osx | terminal | osx-snow-leopard | osx-lion | 08/12/2011 13:08:00 | off topic | Nano Editor on Remote Server broken after OS X Lion Upgrade on Local
===
I am having a problem with my remote servers. I typically use the nano editor to modify files but suddenly after installing OS X lion on my local pc the editor seems broken. After some time suddenly the cursor seems randomly jumping around (it stays at the same position), text is written over other text. That makes it impossibile to do any text editing.
I have the same issue on two Macs.
I am using several aliases in /etc/bashrc. Could that be the issue? | 2 |
9,765,554 | 03/19/2012 05:44:56 | 194,328 | 10/22/2009 05:28:20 | 1,982 | 54 | Is it possible to call SSRS 2008 R2 report in Visual Studio 2010? | I designed a report using Business Development Studio 2008 and my reporting server is SQL Server 2008 R2. The .rdl report is ready but is it possible to show this report on a Web Form of Visual Studio 2010? | visual-studio-2010 | ssrs-2008 | null | null | null | null | open | Is it possible to call SSRS 2008 R2 report in Visual Studio 2010?
===
I designed a report using Business Development Studio 2008 and my reporting server is SQL Server 2008 R2. The .rdl report is ready but is it possible to show this report on a Web Form of Visual Studio 2010? | 0 |
4,017,806 | 10/25/2010 18:51:04 | 353,064 | 05/28/2010 15:58:44 | 110 | 0 | Using CSS with background image/login | Currently I'm trying to edit a login screen for a web based application. As of now, I have the login prompt (user & password) at a particular place on page so that it corresponds with the background image. Right now this image is set to 1024x768.
What I was wondering, is there a way to have the background automatically scale depending on users own resolution while have the login appear at the correct location? I'm not sure if this is possible but thought someone might have some advice. | background-image | css | null | null | null | null | open | Using CSS with background image/login
===
Currently I'm trying to edit a login screen for a web based application. As of now, I have the login prompt (user & password) at a particular place on page so that it corresponds with the background image. Right now this image is set to 1024x768.
What I was wondering, is there a way to have the background automatically scale depending on users own resolution while have the login appear at the correct location? I'm not sure if this is possible but thought someone might have some advice. | 0 |
3,030,003 | 06/12/2010 20:35:35 | 353,682 | 03/22/2010 04:53:16 | 26 | 2 | How To Send thousands of javaMails simultaneously ? | greetings all
i am building a web app(smth like a forums) that will need to send thousands of emails simultaneously i think that it would be such a big load on the app to handle sending the emails, so i want to use another service or framework to handle sending the emails in asynchronous way so that there will be no load on the app, maybe JMS , i don't know, please suggest me a good solution. | javamail | null | null | null | null | null | open | How To Send thousands of javaMails simultaneously ?
===
greetings all
i am building a web app(smth like a forums) that will need to send thousands of emails simultaneously i think that it would be such a big load on the app to handle sending the emails, so i want to use another service or framework to handle sending the emails in asynchronous way so that there will be no load on the app, maybe JMS , i don't know, please suggest me a good solution. | 0 |
7,407,811 | 09/13/2011 20:08:48 | 239,879 | 12/29/2009 00:03:06 | 751 | 11 | How do I properly lay out Mongoose in an Express project? | I created my `Schema`'s in my `models/mymodel.js` file. I also have my models in there as well as my methods.
How do I export them into my `routes`? | node.js | express | mongoose | null | null | null | open | How do I properly lay out Mongoose in an Express project?
===
I created my `Schema`'s in my `models/mymodel.js` file. I also have my models in there as well as my methods.
How do I export them into my `routes`? | 0 |
10,623,898 | 05/16/2012 17:48:48 | 1,399,271 | 05/16/2012 17:39:30 | 1 | 0 | The loop is executed twice before reading scanf, how do I fix it? | I have been trying to fix this for a while. It works just fine except for some reason the first time the loop is executed it doesnt store the variables, it runs case 1 again without even asking for the input, it just produces the answer I wanted…except it ran the loop twice. Any idea how to fix this?
do
{
printf("What would you like to do?\n1.Row Operation\t2.Row Multiply\t3.Row Switch\t4.Exit\n");
scanf("%d", &a);
switch(a)
{
case 1:
printf("Enter Operation: (ex:r1-2r3)\n");
scanf("%*c%d%c%f%*c%d", &row_2, &sign, &mult, &row_1);
if(row_1 > m || row_2 > m)
{
printf("Row(s) DNE\n");
break;
}
row_op(sign, mult, row_1 - 1, row_2 - 1, modmatrix);
printm(modmatrix); /*Defined in header file matrix_fct.h*/
break;
case 2:
...
}
} while (a != 4);
| c | loops | input | switch-statement | null | 05/18/2012 14:57:51 | too localized | The loop is executed twice before reading scanf, how do I fix it?
===
I have been trying to fix this for a while. It works just fine except for some reason the first time the loop is executed it doesnt store the variables, it runs case 1 again without even asking for the input, it just produces the answer I wanted…except it ran the loop twice. Any idea how to fix this?
do
{
printf("What would you like to do?\n1.Row Operation\t2.Row Multiply\t3.Row Switch\t4.Exit\n");
scanf("%d", &a);
switch(a)
{
case 1:
printf("Enter Operation: (ex:r1-2r3)\n");
scanf("%*c%d%c%f%*c%d", &row_2, &sign, &mult, &row_1);
if(row_1 > m || row_2 > m)
{
printf("Row(s) DNE\n");
break;
}
row_op(sign, mult, row_1 - 1, row_2 - 1, modmatrix);
printm(modmatrix); /*Defined in header file matrix_fct.h*/
break;
case 2:
...
}
} while (a != 4);
| 3 |
7,383,237 | 09/12/2011 04:11:35 | 682,765 | 03/29/2011 19:41:45 | 57 | 0 | Android - Mangnetometer | In android, we have the GeomagneticField class to estimate magnetic field at a given point on Earth and we also have Sensor.TYPE_MAGNETIC_FIELD to measure the magnetic field.
I am not very clear as to what is the difference between these two APIs. Which is to be used in what situations?
| android | android-sensors | magnetometer | null | null | null | open | Android - Mangnetometer
===
In android, we have the GeomagneticField class to estimate magnetic field at a given point on Earth and we also have Sensor.TYPE_MAGNETIC_FIELD to measure the magnetic field.
I am not very clear as to what is the difference between these two APIs. Which is to be used in what situations?
| 0 |
5,449,135 | 03/27/2011 12:14:36 | 76,813 | 03/11/2009 18:04:26 | 205 | 18 | How can a Cocoa application add itself as a global login item? | I tried `LSSharedFileListCreate(NULL, kLSSharedFileListGlobalLoginItems, NULL);`.
It just returned NULL when I built and ran the application. Is there something else that I need to do? Some kind of authorization? | cocoa | osx | login | null | null | null | open | How can a Cocoa application add itself as a global login item?
===
I tried `LSSharedFileListCreate(NULL, kLSSharedFileListGlobalLoginItems, NULL);`.
It just returned NULL when I built and ran the application. Is there something else that I need to do? Some kind of authorization? | 0 |
3,194,872 | 07/07/2010 13:03:19 | 339,067 | 05/12/2010 07:50:57 | 23 | 5 | Fetch cookie set by header | I login to a website and it returns a cookie via the header.
The cookies name is fb_cookie. I try to read it with the below PHP code but it returns nothing. How can I fetch a cookie set via the header?
echo $_COOKIE["fb_cookie"];
The response is this from the header (read by the Poster plugin in Firefox).
fb_cookie=1554e662b9914b5d640d655f-627185705%7C6LneHfe-wWAworIG2hTHSzxuqkw.; path=/; expires=Thu, 07-Jul-2011 12:57:05 GMT _lambda_session=BAh7BzoMdXNlcl9pZGkBkToPc2Vzc2lvbl9pZCIlOGY2Y2U2ZDhlMDcyNTdjMDM4ZjYyNjQ4ZmU5OGU1ZTU%3D--3e60eb15a406a9320f7ab83fb7e0866198f4b6c7; path=/; HttpOnly
Please help! | php | cookies | null | null | null | null | open | Fetch cookie set by header
===
I login to a website and it returns a cookie via the header.
The cookies name is fb_cookie. I try to read it with the below PHP code but it returns nothing. How can I fetch a cookie set via the header?
echo $_COOKIE["fb_cookie"];
The response is this from the header (read by the Poster plugin in Firefox).
fb_cookie=1554e662b9914b5d640d655f-627185705%7C6LneHfe-wWAworIG2hTHSzxuqkw.; path=/; expires=Thu, 07-Jul-2011 12:57:05 GMT _lambda_session=BAh7BzoMdXNlcl9pZGkBkToPc2Vzc2lvbl9pZCIlOGY2Y2U2ZDhlMDcyNTdjMDM4ZjYyNjQ4ZmU5OGU1ZTU%3D--3e60eb15a406a9320f7ab83fb7e0866198f4b6c7; path=/; HttpOnly
Please help! | 0 |
10,158,926 | 04/15/2012 01:47:26 | 1,294,166 | 03/26/2012 22:31:30 | 18 | 0 | button sound when pressed | I cant seem to find were i am going wrong what i want is to press the image button and to go to my second activity and also on clicking the button it makes a sound. any help would be great
package my.solo;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class SoloActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final MediaPlayer mpButtonClick = MediaPlayer.create(this,R.raw.button_click);
TextView textView = (TextView)findViewById(R.id.text_view);
textView.setMovementMethod(new ScrollingMovementMethod());
Button next = (Button) findViewById(R.id.imageButton1);
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent(SoloActivity.this, model_page.class);
startActivity(intent);
mpButtonClick.start();
}
}
);
}
}
xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/pt5"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/text_view"
android:layout_width="415dp"
android:layout_height="209dp"
android:layout_marginLeft="300dp"
android:layout_marginTop="50dp"
android:maxLines="300"
android:scrollbars="vertical"
android:singleLine="false"
android:text="@string/disclamer"
android:textColor="@android:color/secondary_text_dark_nodisable" >
</TextView>
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="98dp"
android:src="@drawable/stbtn2" android:background="@null"/>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="35dp"
android:text="@string/P69"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="serif" />
</RelativeLayout>
</LinearLayout>
i have put the second activity in the MF so thats ok
http://imageshack.us/g/638/bugjd.png/ | android | null | null | null | null | 04/16/2012 12:26:17 | not a real question | button sound when pressed
===
I cant seem to find were i am going wrong what i want is to press the image button and to go to my second activity and also on clicking the button it makes a sound. any help would be great
package my.solo;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class SoloActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final MediaPlayer mpButtonClick = MediaPlayer.create(this,R.raw.button_click);
TextView textView = (TextView)findViewById(R.id.text_view);
textView.setMovementMethod(new ScrollingMovementMethod());
Button next = (Button) findViewById(R.id.imageButton1);
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent(SoloActivity.this, model_page.class);
startActivity(intent);
mpButtonClick.start();
}
}
);
}
}
xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/pt5"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/text_view"
android:layout_width="415dp"
android:layout_height="209dp"
android:layout_marginLeft="300dp"
android:layout_marginTop="50dp"
android:maxLines="300"
android:scrollbars="vertical"
android:singleLine="false"
android:text="@string/disclamer"
android:textColor="@android:color/secondary_text_dark_nodisable" >
</TextView>
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="98dp"
android:src="@drawable/stbtn2" android:background="@null"/>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="35dp"
android:text="@string/P69"
android:textSize="25dp"
android:textStyle="bold"
android:typeface="serif" />
</RelativeLayout>
</LinearLayout>
i have put the second activity in the MF so thats ok
http://imageshack.us/g/638/bugjd.png/ | 1 |
8,398,169 | 12/06/2011 10:10:41 | 1,083,179 | 12/06/2011 09:13:37 | 1 | 0 | htaccess mod rewrite stop file execution | Ihave problem with htacces , here is my code<br/>
RewriteEngine on <br/>
RewriteBase /foldername <br/>
RewriteRule ^(administration) - [L] <br/>
RewriteCond %{REQUEST_FILENAME} !-f <br/>
RewriteCond %{REQUEST_FILENAME} !-d<br/>
RewriteRule ^(search)/$ csearch.php?pg=$1 [L] <br/>
RewriteRule ^(.*)/(.*)/$ page1.php?par1=$1&par2=$2 [L] <br/>
RewriteRule ^(.*)/$ page2.php?par1=$1 [L]<br/>
RewriteRule ^(.*)\.html$ page3.php?par1=$1 <br/>
ErrorDocument 404 /index.php<br/>
Problem:<br/>
url> www.mydomain/foldername/search/<br/>
is redirected to csearch.php, it is ok<br/>
but it seems after execution of file csearch.php<br/>
next rule is executed <br/>
RewriteRule ^(.*)/(.*)/$ page1.php?par1=$1&par2=$2 [L] <br/>
How do I prevent execution of next rule after <br/>
RewriteRule ^(search)/$ csearch.php?pg=$1 [L]<br/>
.. and I wont that folder administration will be excluded<br/>
from rules.... it works for me, but Iam not sure if<br/>
the rules are correct.<br/>
Many thanks for your help.<br/>
| php | .htaccess | null | null | null | 12/06/2011 17:13:35 | off topic | htaccess mod rewrite stop file execution
===
Ihave problem with htacces , here is my code<br/>
RewriteEngine on <br/>
RewriteBase /foldername <br/>
RewriteRule ^(administration) - [L] <br/>
RewriteCond %{REQUEST_FILENAME} !-f <br/>
RewriteCond %{REQUEST_FILENAME} !-d<br/>
RewriteRule ^(search)/$ csearch.php?pg=$1 [L] <br/>
RewriteRule ^(.*)/(.*)/$ page1.php?par1=$1&par2=$2 [L] <br/>
RewriteRule ^(.*)/$ page2.php?par1=$1 [L]<br/>
RewriteRule ^(.*)\.html$ page3.php?par1=$1 <br/>
ErrorDocument 404 /index.php<br/>
Problem:<br/>
url> www.mydomain/foldername/search/<br/>
is redirected to csearch.php, it is ok<br/>
but it seems after execution of file csearch.php<br/>
next rule is executed <br/>
RewriteRule ^(.*)/(.*)/$ page1.php?par1=$1&par2=$2 [L] <br/>
How do I prevent execution of next rule after <br/>
RewriteRule ^(search)/$ csearch.php?pg=$1 [L]<br/>
.. and I wont that folder administration will be excluded<br/>
from rules.... it works for me, but Iam not sure if<br/>
the rules are correct.<br/>
Many thanks for your help.<br/>
| 2 |
5,976,021 | 05/12/2011 09:35:17 | 605,108 | 02/06/2011 07:59:11 | 755 | 95 | Writing something(using touch) on the screen and saving it in blackberry | I am building an application in blackberry in which I have to allow user write something (by touch) on the screen (for example save signature of the user ) and have show it some where else or in some other page.
Please tell me whether it is feasible or not in blackberry.
If yes then please give some link or code to perform this.
Thanks in advance. | blackberry | blackberry-eclipse-plugin | null | null | null | null | open | Writing something(using touch) on the screen and saving it in blackberry
===
I am building an application in blackberry in which I have to allow user write something (by touch) on the screen (for example save signature of the user ) and have show it some where else or in some other page.
Please tell me whether it is feasible or not in blackberry.
If yes then please give some link or code to perform this.
Thanks in advance. | 0 |
7,789,577 | 10/17/2011 05:05:27 | 998,537 | 10/17/2011 05:01:19 | 1 | 0 | developing an ebook reader with an antivirus-like license type | I am trying to build a site that will have e-books. Users will download books paying money. But in order to prevent piracy, I want a system that will restrict users to use the book for n (n=1 or more )number of pcs . This is something like the antivirus software licensing i.e. 5 user-license of any antivirus software..
How can I do that ? Anyone around please?
Thanks in advance
| ebook | null | null | null | null | 10/17/2011 05:27:59 | off topic | developing an ebook reader with an antivirus-like license type
===
I am trying to build a site that will have e-books. Users will download books paying money. But in order to prevent piracy, I want a system that will restrict users to use the book for n (n=1 or more )number of pcs . This is something like the antivirus software licensing i.e. 5 user-license of any antivirus software..
How can I do that ? Anyone around please?
Thanks in advance
| 2 |
10,800,669 | 05/29/2012 13:57:20 | 1,414,547 | 05/24/2012 08:51:43 | 1 | 0 | How to bind DataGrid with an ObservableCollection list and other personalized columns | I use MVVM Light Toolkit.
I have a WPF DataGrid bound to ObservableCollection<MyObject>.In my DataGrid I need another column as a result for a certain calculation.So I have to bind it with a property not figured in my ObservableCollection.
So,my problem is that i have nothing shown in my column after binding my DataGrid.
I used LoadingRow event but my problem didn't be solved.
Thanks for help. | wpfdatagrid | null | null | null | null | null | open | How to bind DataGrid with an ObservableCollection list and other personalized columns
===
I use MVVM Light Toolkit.
I have a WPF DataGrid bound to ObservableCollection<MyObject>.In my DataGrid I need another column as a result for a certain calculation.So I have to bind it with a property not figured in my ObservableCollection.
So,my problem is that i have nothing shown in my column after binding my DataGrid.
I used LoadingRow event but my problem didn't be solved.
Thanks for help. | 0 |
19,642 | 08/21/2008 11:42:41 | 1,075 | 08/12/2008 10:13:30 | 520 | 45 | Suggested gaming platform to learn - Direct X (C++), Open GL or XNA | My nephew is an aspiring game developer. I have taught him a bit of C/C++, and suggested he learn that for a start.
Once he has come to grips with that, which game/graphics API's do people suggest he learn?
I would think DirectX would be current industry standard, but with more games looking to go X-platform then maybe Open-GL would be a good starting point?
I have briefly looked at XNA, maybe that would be a nice easy step to take before jumping to a more complex framework?
| gamedevelopment | directx | xna | opengl | null | 07/03/2012 13:28:10 | not constructive | Suggested gaming platform to learn - Direct X (C++), Open GL or XNA
===
My nephew is an aspiring game developer. I have taught him a bit of C/C++, and suggested he learn that for a start.
Once he has come to grips with that, which game/graphics API's do people suggest he learn?
I would think DirectX would be current industry standard, but with more games looking to go X-platform then maybe Open-GL would be a good starting point?
I have briefly looked at XNA, maybe that would be a nice easy step to take before jumping to a more complex framework?
| 4 |
11,008,727 | 06/13/2012 05:30:06 | 1,019,892 | 10/29/2011 15:21:51 | 1 | 0 | Nanotab inside Nanotab | I have the following code:
<div id="cells99">
<div id="cell99">
<a href="#c1">{link}</a>
<a style="font-size:70%" href="#c2">{link}</a>
<a href="#c3">{link}</a>
<a href="#c4">{link}</a>
<a href="#c5">{link}</a>
<a href="#c6">{link}</a><br />
</div>
<div id="cell299">
<div id="c1">
{links}
</div>
<div id="c2">
<table>
<tr>
<td>
<b><a href="#c7">{link}</a><br />
<a href="#c8">{link}</a><br />
<a href="#c9">{link}</a></b>
</td>
</tr>
</table>
</div>
<div id="c3">
{links}
</div>
<div id="c4">
{links}
</div>
<div id="c5">
{links}
</div>
<div id="c6">
{links}
</div>
<div id="c7">
{links}
</div>
<div id="c8">
{links}
</div>
<div id="c9">
{links}
</div>
</div>
<script type="text/javascript">
nanotabs({c:"cell99",e:"click",d:-1,f:function(){ return false; }});
nanotabs({c:"cell99",e:"click",s:"active"});
</script>
And c7, c8, c9 is a nanotab inside a nanotab and it doesn't seem to work. It just links like another <a href> like: "http://hamburgers.kfc/index.php#c9".
- - -
Wait..What: "Your post does not have much context to explain the code sections; please explain your scenario more clearly." | javascript | html | null | null | null | 06/13/2012 13:58:53 | not a real question | Nanotab inside Nanotab
===
I have the following code:
<div id="cells99">
<div id="cell99">
<a href="#c1">{link}</a>
<a style="font-size:70%" href="#c2">{link}</a>
<a href="#c3">{link}</a>
<a href="#c4">{link}</a>
<a href="#c5">{link}</a>
<a href="#c6">{link}</a><br />
</div>
<div id="cell299">
<div id="c1">
{links}
</div>
<div id="c2">
<table>
<tr>
<td>
<b><a href="#c7">{link}</a><br />
<a href="#c8">{link}</a><br />
<a href="#c9">{link}</a></b>
</td>
</tr>
</table>
</div>
<div id="c3">
{links}
</div>
<div id="c4">
{links}
</div>
<div id="c5">
{links}
</div>
<div id="c6">
{links}
</div>
<div id="c7">
{links}
</div>
<div id="c8">
{links}
</div>
<div id="c9">
{links}
</div>
</div>
<script type="text/javascript">
nanotabs({c:"cell99",e:"click",d:-1,f:function(){ return false; }});
nanotabs({c:"cell99",e:"click",s:"active"});
</script>
And c7, c8, c9 is a nanotab inside a nanotab and it doesn't seem to work. It just links like another <a href> like: "http://hamburgers.kfc/index.php#c9".
- - -
Wait..What: "Your post does not have much context to explain the code sections; please explain your scenario more clearly." | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.