instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I just figured out that I can actually store objects in the $_SESSION and I find it quite cool because when I jump to another page I still have my object. Now before I start using this approach I would like to find out if it is really such a good idea or if there are potential pitfalls involved. I know that if I had a...
Storing objects in the `$_SESSION` is a common practice in PHP development, but it does come with both benefits and potential pitfalls. Here are some considerations to help you decide if it's the right approach for your application: ### Benefits of Storing Objects in Session: 1. **State Preservation**: Storing object...
20,786
[ { "from": "human", "value": "I just figured out that I can actually store objects in the $_SESSION and I find it quite cool because when I jump to another page I still have my object. Now before I start using this approach I would like to find out if it is really such a good idea or if there are potential p...
David Flanagan's excellent book on JavaScript has an example that shows how to perform XPath queries in IE. On page 518 of fifth edition, you can see the following code snippet taken from example 21-10: // In IE, the context must be an Element not a document, // so if the context is a document, use the documentElement ...
In Internet Explorer, the behavior of `XMLHttpRequest` and the way it handles XML documents can indeed be a bit confusing, especially in terms of how it references the resulting document structure. When you perform an `XMLHttpRequest` to retrieve an XML document, IE can return the document itself or the document's roo...
26,685
[ { "from": "human", "value": "David Flanagan's excellent book on JavaScript has an example that shows how to perform XPath queries in IE. On page 518 of fifth edition, you can see the following code snippet taken from example 21-10:\n// In IE, the context must be an Element not a document,\n// so if the cont...
A very well known major drawback of using CGI is poor webserver performance. But how secure are CGI (mainly C/C++) based applications? Are there any major security holes in CGI architecture built on C/C++? I would like to know some real life implementations of CGI based web apps/web sites. One that I know of is javara...
CGI (Common Gateway Interface) is a standard protocol that allows web servers to interact with external programs, typically scripts or binaries, to generate dynamic web content. While CGI can be implemented in various programming languages, C and C++ are among the most common for performance-critical applications. Howe...
22,924
[ { "from": "human", "value": "A very well known major drawback of using CGI is poor webserver performance. But how secure are CGI (mainly C/C++) based applications? Are there any major security holes in CGI architecture built on C/C++? \nI would like to know some real life implementations of CGI based web ap...
I have a very simple TCP server written in C. It runs indefinitely, waiting for connections. On Windows, I use select to check for activity on the socket, and if there isn't any, I have the following code to allow me to quit by hitting 'q' on the keyboard: if( kbhit() ) { char c = getch(); if( c == 'q' ) break; }...
You're right that handling non-blocking keyboard input in Unix can be tricky, but there's a more straightforward way to achieve this without needing a separate thread. You can modify the terminal settings temporarily to allow for non-blocking input. Below is an example of how you can do this using `termios` to set the ...
21,828
[ { "from": "human", "value": "I have a very simple TCP server written in C. It runs indefinitely, waiting for connections. On Windows, I use select to check for activity on the socket, and if there isn't any, I have the following code to allow me to quit by hitting 'q' on the keyboard:\nif( kbhit() ) {\n c...
I'm using C# & .NEt 3.5. What is the difference between the OptionA and OptionB ? class MyClass { private object m_Locker = new object(); private Dicionary<string, object> m_Hash = new Dictionary<string, object>(); public void OptionA() { lock(m_Locker){ // Do something with the dic...
The key difference between `OptionA` and `OptionB` in your code relates to the object that is being used as a lock, which has significant implications for thread safety. ### Option A ```csharp public void OptionA() { lock(m_Locker){ // Do something with the dictionary } } ``` In `OptionA`, a separate l...
24,522
[ { "from": "human", "value": "I'm using C# & .NEt 3.5. What is the difference between the OptionA and OptionB ?\nclass MyClass\n{\n private object m_Locker = new object();\n private Dicionary<string, object> m_Hash = new Dictionary<string, object>();\n\n public void OptionA()\n {\n lock(m...
I have seen people say that it is bad form to use catch with no arguments, especially if that catch doesn't do anything: StreamReader reader=new StreamReader("myfile.txt"); try { int i = 5 / 0; } catch // No args, so it will catch any exception {} reader.Close(); However, this is considered good form: StreamReade...
You've raised an interesting point about the differences between using `catch` blocks and `finally` blocks, particularly with regard to resource management and cleanup in the context of exception handling. ### Key Differences 1. **Behavior with Exceptions**: - A `catch` block is designed to handle exceptions. When...
19,917
[ { "from": "human", "value": "I have seen people say that it is bad form to use catch with no arguments, especially if that catch doesn't do anything:\nStreamReader reader=new StreamReader(\"myfile.txt\");\ntry\n{\n int i = 5 / 0;\n}\ncatch // No args, so it will catch any exception\n{}\nreader.Close();\...
I tried to follow PHP.net curl site and even this link: http://curl.phptrack.com/forum/viewtopic.php?t=52 and try to install the CURL in my window laptop. It doesn't work.. CURL is not installed. I wonder do I need to run it on windows server... Anyone has good sites guiding me how to install CURL? thanks.
Installing cURL for PHP on a Windows environment can be a bit tricky, but I can guide you through the process step by step. Below are the instructions to help you install cURL for PHP on your Windows laptop: ### Step 1: Verify PHP Installation Make sure PHP is installed on your machine. Open a command prompt and type:...
19,380
[ { "from": "human", "value": "I tried to follow PHP.net curl site and even this link: http://curl.phptrack.com/forum/viewtopic.php?t=52\nand try to install the CURL in my window laptop. It doesn't work.. CURL is not installed. \nI wonder do I need to run it on windows server...\nAnyone has good sites guidi...
I am looking for some architectual design patterns for enterprise application development. I am aware of the all of the GoF patterns, and MVC, and such things, but I am looking for patterns that emerge at a larger scope. In particular I have a somewhat larger enterprise desktop and website application, they share certa...
In enterprise application development, especially when dealing with both desktop and web applications that share functionality, it’s essential to use architectural patterns that can provide modularity, reusability, and maintainability. Below are some architectural patterns and best practices you may find useful for str...
21,653
[ { "from": "human", "value": "I am looking for some architectual design patterns for enterprise application development. I am aware of the all of the GoF patterns, and MVC, and such things, but I am looking for patterns that emerge at a larger scope. In particular I have a somewhat larger enterprise desktop ...
I know there are libraries out there for working with ZIP files. And, you can alternatively use the functionality built into Windows for working ZIP files. But, I'm wondering if anyone has worked out how to use the tools built into the System.IO.Compression namespace within .NET for reading/writing ZIP files? Or, is it...
Yes, you can use the `System.IO.Compression` namespace in .NET to work with ZIP files. This namespace provides a straightforward way to read from and write to ZIP archives. Here’s a simple guide on how to use it for both reading and writing ZIP files. ### Writing ZIP Files To create a ZIP file and add files to it, yo...
23,368
[ { "from": "human", "value": "I know there are libraries out there for working with ZIP files. And, you can alternatively use the functionality built into Windows for working ZIP files.\nBut, I'm wondering if anyone has worked out how to use the tools built into the System.IO.Compression namespace within .NE...
I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but at the end, I get a "Trying to use an SPWeb object that has been closed or disposed and is no longer valid." error message. From what I see, SPContext.Current.Web is Disposed by someone, but I have no idea where. I just wonder: With Visual St...
Debugging disposed objects can indeed be challenging, especially in a complex environment like SharePoint or when you don't have access to the source code. However, there are several strategies you can employ to track down where an object is being disposed. Here are some suggestions: ### 1. **Use Debugging Tools:** ...
25,763
[ { "from": "human", "value": "I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but at the end, I get a \"Trying to use an SPWeb object that has been closed or disposed and is no longer valid.\" error message.\nFrom what I see, SPContext.Current.Web is Disposed by someone, but I have ...
Did you ever had a bug in your code, you could not resolve? I hope I'm not the only one out there, who made this experience ... There exist some classes of bugs, that are very hard to track down: timing-related bugs (that occur during inter-process-communication for example) memory-related bugs (most of you know appro...
It's completely normal to encounter stubborn bugs that resist all attempts at resolution, and many developers share your experience. Here are some strategies that can help you tackle these challenging situations: 1. **Take a Break**: Sometimes the best thing you can do is step away for a bit. A fresh perspective can m...
17,100
[ { "from": "human", "value": "Did you ever had a bug in your code, you could not resolve? I hope I'm not the only one out there, who made this experience ...\nThere exist some classes of bugs, that are very hard to track down:\n\ntiming-related bugs (that occur during inter-process-communication for example)...
I'm trying to take a POCO object and update it with Linq2SQL using an XML mapping file... This what what I have: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Business.Objects { public class AchievementType { public int Id { get; set; } public s...
Based on your description and the provided code, it looks like you're attempting to update an entity using LINQ to SQL, but the changes are not being reflected in the database. There are a few common reasons for this behavior, particularly when updating an entity in LINQ to SQL. Let's go through the potential issues an...
23,958
[ { "from": "human", "value": "I'm trying to take a POCO object and update it with Linq2SQL using an XML mapping file... This what what I have:\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Business.Objects\n{\n public class AchievementType\n {\n ...
I have a custom class that implements that IComparable. This class is stored in a Generic List. I now need to compare to lists to see which objects are in list A but not in list B. I thought the most simple way of doing this would be to iterate through list B and do A.contains(). I do not know how to get it to use ...
You're correct that the `Contains` method for a `List<T>` uses the default equality comparison, which checks for reference equality unless you override `Equals()` in your custom class. Since your class implements `IComparable`, that is primarily for sorting and does not influence the `Contains` method directly. To so...
24,701
[ { "from": "human", "value": "I have a custom class that implements that IComparable. This class is stored in a Generic List. I now need to compare to lists to see which objects are in list A but not in list B. \nI thought the most simple way of doing this would be to iterate through list B and do A.conta...
Has anyone used Pear: Spreadsheet_Excel_Writer? The Formatting Tutorial lists a script similar to what I'm working with: (trimmed down) <?php require_once 'Spreadsheet/Excel/Writer.php'; $workbook = new Spreadsheet_Excel_Writer(); $worksheet =& $workbook->addWorksheet(); $worksheet->write(0, 0, "Quarterly Profits for ...
It looks like you are using the `Spreadsheet_Excel_Writer` package, which was a PHP library designed to create Excel files in the older `.xls` format. Your understanding of the method `$workbook->send('test.xls');` is correct; this line sends the appropriate HTTP headers to prompt a download of the generated Excel fi...
25,719
[ { "from": "human", "value": "Has anyone used Pear: Spreadsheet_Excel_Writer?\nThe Formatting Tutorial lists a script similar to what I'm working with: (trimmed down)\n<?php\nrequire_once 'Spreadsheet/Excel/Writer.php';\n$workbook = new Spreadsheet_Excel_Writer();\n\n$worksheet =& $workbook->addWorksheet();\...
How do I setup a Python environment on windows computer so I can start writing and running Python scripts, is there an install bundle? Also which database should i use? I should of mentioned that I am using this for web based applications. Does it require apache? or does it use another http server? What is the standa...
Setting up a Python environment on a Windows computer for web-based applications is a straightforward process. Here’s a step-by-step guide, along with recommendations for databases and web servers. ### Step 1: Install Python 1. **Download Python**: Go to the official Python website [python.org](https://www.python.org...
21,073
[ { "from": "human", "value": "How do I setup a Python environment on windows computer so I can start writing and running Python scripts, is there an install bundle? Also which database should i use?\n\nI should of mentioned that I am using this for web based applications. Does it require apache? or does it ...
I am writing a little application, which is writing jpeg images at a constant rate on a SD card. I choose an EXT3 filesystem, but the same behaviour was observed with an EXT2 filesystem. My writing loop looks like this : get_image() fwrite() fsync() Or like this : get_image() fopen() fwrite() fsync() fclose() I also...
When dealing with intermittent stalls during file writing to an SD card, especially when you're using `fsync` to ensure data integrity, there are a few potential factors that could contribute to this behavior. Here are some possibilities and suggestions to improve your writing performance: ### Potential Causes of Stal...
23,689
[ { "from": "human", "value": "I am writing a little application, which is writing jpeg images at a constant rate on a SD card.\nI choose an EXT3 filesystem, but the same behaviour was observed with an EXT2 filesystem.\nMy writing loop looks like this :\nget_image()\nfwrite()\nfsync()\n\nOr like this :\nget_i...
I'm using Lawrence Philips Double-Metaphone algorithm with great success, but I have found the odd "unexpected result" for some combinations. Does anyone else have additions or changes to the algorithm for other parts of it they wouldn't mind sharing, or just the combinations that they've found that do not work as expe...
The Double Metaphone algorithm is a powerful phonetic encoding method, but it is not perfect and can sometimes produce unexpected results due to the complexity of English phonetics and the various influences of different languages. Here are a few observations and potential adjustments you might consider, as well as som...
23,351
[ { "from": "human", "value": "I'm using Lawrence Philips Double-Metaphone algorithm with great success, but I have found the odd \"unexpected result\" for some combinations.\nDoes anyone else have additions or changes to the algorithm for other parts of it they wouldn't mind sharing, or just the combinations...
Using jQuery, how would you show() every div.foo on a page in a random order, with a new one appearing every X milliseconds? Clarification: I want to start with all these elements hidden and end with all of them showing, so it wouldn't make sense to show() the same element twice. I originally thought I'd make an array ...
To achieve the desired behavior of showing each `div.foo` in a random order with a new one appearing every X milliseconds, you can follow these steps using jQuery. You can indeed start with an array of the jQuery objects representing each `div.foo`, shuffle the array, and then use `setInterval` to show them one by one....
24,722
[ { "from": "human", "value": "Using jQuery, how would you show() every div.foo on a page in a random order, with a new one appearing every X milliseconds?\nClarification: I want to start with all these elements hidden and end with all of them showing, so it wouldn't make sense to show() the same element twic...
PHP 4.4 and PHP 5.2.3 under Apache 2.2.4 on ubuntu. I am running Moodle 1.5.3 and have recently had a problem when updating a course. The $_POST variable is empty but only if a lot of text was entered into the textarea on the form. If only a short text is entered it works fine. I have increased the post_max_size from 8...
It sounds like you're dealing with a frustrating issue with PHP and your Moodle installation. Here are a few suggestions and potential causes to consider: 1. **Check max_input_vars**: Since you're having issues specifically with larger amounts of data, it's worth checking the `max_input_vars` directive in your PHP con...
23,037
[ { "from": "human", "value": "PHP 4.4 and PHP 5.2.3 under Apache 2.2.4 on ubuntu.\nI am running Moodle 1.5.3 and have recently had a problem when updating a course. The $_POST variable is empty but only if a lot of text was entered into the textarea on the form. If only a short text is entered it works fine....
I believe the architecture type (x86 vs x64) is abstracted away for you when making .Net programs, but are there any other considerations that can cause problems?
Yes, while .NET abstracts many details of the underlying architecture (like x86 vs. x64) through its Common Language Runtime (CLR), there are still several considerations that can lead to problems, especially when developing applications. Here are some key points to be aware of: 1. **Platform Target**: When you build ...
21,961
[ { "from": "human", "value": "I believe the architecture type (x86 vs x64) is abstracted away for you when making .Net programs, but are there any other considerations that can cause problems?\n" }, { "from": "gpt", "value": "Yes, while .NET abstracts many details of the underlying architecture (...
In our data access layer at work we have this standard implementation where the class is accessed through a singleton public property which looks something like this: public static CustomerController Instance { get { lock(singletonLock) { ...
The singleton pattern, as illustrated in your example, has several advantages over simply creating a new instance of the class every time it is needed. Here are some reasons why using a singleton can be beneficial: 1. **Controlled Access**: The singleton pattern ensures that there is only one instance of a class throu...
25,996
[ { "from": "human", "value": "In our data access layer at work we have this standard implementation where the class is accessed through a singleton public property which looks something like this:\npublic static CustomerController Instance\n {\n get \n {\n lock(sin...
I have an XML file loaded into a DOM document, I wish to iterate through all 'foo' tags, getting values from every tag below it. I know I can get values via $element = $dom->getElementsByTagName('foo')->item(0); foreach($element->childNodes as $node){ $data[$node->nodeName] = $node->nodeValue; } However, what I'...
To iterate over all `<foo>` elements in your XML document and access specific child nodes by name, you can use the `getElementsByTagName` method to first get all `<foo>` elements and then iterate through them. For each `<foo>` element, you can access its child nodes by name using the `getElementsByTagName` method again...
23,670
[ { "from": "human", "value": "I have an XML file loaded into a DOM document, \nI wish to iterate through all 'foo' tags, getting values from every tag below it. I know I can get values via \n$element = $dom->getElementsByTagName('foo')->item(0);\nforeach($element->childNodes as $node){\n $data[$node->node...
How do I create subdomain like http://user.mywebsite.example? Do I have to access .htaccess somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-server side language? To those who answered: Well, then, should I ask my hosting if they provide some sort of DNS acces...
Creating a subdomain like `http://user.mywebsite.example` typically involves two main steps: configuring DNS settings and setting up your web server to handle the requests for that subdomain. ### Step 1: DNS Configuration 1. **Access Your DNS Settings**: You need to log in to your domain registrar or DNS hosting prov...
20,463
[ { "from": "human", "value": "How do I create subdomain like http://user.mywebsite.example? Do I have to access .htaccess somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-server side language?\nTo those who answered: Well, then, should I ask my host...
We have an MSI installer for a .Net WinForms app for Windows XP that installs and runs only as an admin. Users have to log in to the app when it runs. Customers want it to install and run under a user account under Vista, and to use their Windows account. A preliminary look through the code shows lots of problems; the ...
Transitioning a WinForms application to run under user accounts on Windows Vista (and later) while adhering to User Account Control (UAC) rules can be challenging, especially given the requirements you've outlined. Here are some key considerations and resources that can help you refactor your application effectively. ...
22,743
[ { "from": "human", "value": "We have an MSI installer for a .Net WinForms app for Windows XP that installs and runs only as an admin. Users have to log in to the app when it runs. Customers want it to install and run under a user account under Vista, and to use their Windows account.\nA preliminary look thr...
Take the following generics example import java.util.List; import java.util.ArrayList; public class GenericsTest { private List<Animal> myList; public static void main(String args[]) { new GenericsTest(new ArrayList<Animal>()).add(new Dog()); } public GenericsTest(List<Animal> list) { ...
Yes, you can achieve the desired functionality by using generics with type parameters to specify the type of `Animal` that your `GenericsTest` class will handle. This way, you can create `GenericsTest` instances that are specific to each subclass of `Animal`, such as `Dog` or `Cat`, and restrict additions accordingly. ...
24,293
[ { "from": "human", "value": "Take the following generics example\nimport java.util.List;\nimport java.util.ArrayList;\n\npublic class GenericsTest {\n private List<Animal> myList;\n\n public static void main(String args[]) {\n new GenericsTest(new ArrayList<Animal>()).add(new Dog());\n }\n\n...
I have a table, call it TBL. It has two columns,call them A and B. Now in the query I require one column as A and other column should be a comma seprated list of all B's which are against A in TBL. e.g. TBL is like this 1 Alpha 2 Beta 1 Gamma 1 Delta Result of query should be 1 Alpha,Gamma,Delta 2 Beta Th...
Microsoft Access does not support stored procedures in the same way that SQL Server or other relational database management systems do. However, you can achieve the desired result using a combination of SQL queries and built-in functions within Access. To create a comma-separated list of values from a single column gr...
23,950
[ { "from": "human", "value": "I have a table, call it TBL. It has two columns,call them A and B. Now in the query I require one column as A and other column should be a comma seprated list of all B's which are against A in TBL. \ne.g. TBL is like this\n1 Alpha\n2 Beta\n1 Gamma\n1 Delta\nResult of que...
Is it possible to specify a relative path reference in connectionstring, attachDbFileName property in a web.config? For example, In my database is located in the App_data folder, I can easily specify the AttachDBFilename as|DataDirectory|\mydb.mdf and the |Datadirectory| will automatically resolve to the correct path. ...
In a web application, the connection string can indeed specify a relative path for the database, but the use of `|DataDirectory|` is specific to the application's root directory. If you want to point to a database file located outside of the default `App_Data` folder, you might need to use a relative path with respect ...
23,758
[ { "from": "human", "value": "Is it possible to specify a relative path reference in connectionstring, attachDbFileName property in a web.config?\nFor example, In my database is located in the App_data folder, I can easily specify the AttachDBFilename as|DataDirectory|\\mydb.mdf and the |Datadirectory| will ...
I have a flat-file schema that has a header and detail records. It looks something like this: HDR**2401*XX0062484*22750***20081006000000*000******* LIN**001*788-0538-001*4891-788538010*20000*EA**0000*** I need to append two blank lines at the end of the message. Right now, if I have multiple records I get the followin...
You can achieve your goal of appending two blank lines at the end of each message using various methods depending on the technology stack or language you're working with. Here are a few simpler approaches without needing to build a custom pipeline component: ### 1. Using a Simple Script (e.g., Python) If you're comfo...
22,198
[ { "from": "human", "value": "I have a flat-file schema that has a header and detail records. It looks something like this:\nHDR**2401*XX0062484*22750***20081006000000*000*******\nLIN**001*788-0538-001*4891-788538010*20000*EA**0000***\n\nI need to append two blank lines at the end of the message. Right now, ...
So, what is the best way to prevent an XSRF attack for a GAE application? Imagine the following: Anyone can see a user's public object, and the db.Model id is used in the request to figure out which object to show. Malicious user now has the id. Malicious user creates their own object and checks out the delete form....
To prevent Cross-Site Request Forgery (XSRF or CSRF) attacks in your Google App Engine (GAE) application, you'll want to implement measures that ensure the authenticity of requests made on behalf of a user. Here are some strategies to help you secure delete requests and prevent the scenario you described: 1. **Use Ant...
22,026
[ { "from": "human", "value": "So, what is the best way to prevent an XSRF attack for a GAE application? Imagine the following:\n\nAnyone can see a user's public object, and the db.Model id is used in the request to figure out which object to show. Malicious user now has the id.\nMalicious user creates thei...
Here is an example of polymorphism from http://www.cplusplus.com/doc/tutorial/polymorphism.html (edited for readability): // abstract base class #include <iostream> using namespace std; class Polygon { protected: int width; int height; public: void set_values(int a, int b) { width = a; ...
The behavior of polymorphism in C++ relies on the concept of dynamic dispatch, which is implemented through a mechanism known as a "vtable" (virtual table). When you declare a method as `virtual` in a base class, C++ sets up a vtable for the class that holds pointers to the virtual functions that the class implements. ...
19,598
[ { "from": "human", "value": "Here is an example of polymorphism from http://www.cplusplus.com/doc/tutorial/polymorphism.html (edited for readability):\n// abstract base class\n#include <iostream>\nusing namespace std;\n\nclass Polygon {\n protected:\n int width;\n int height;\n public:\n...
I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables. On a typical PC, I would find many copies of the same .DLL's. My understanding is that MSVCRT is the C runtime library, somewhat analogous to glibc/libc.so under *nix. Why do Windows prog...
You are correct in your understanding that MSVCRT (Microsoft Visual C Runtime) is the Microsoft implementation of the C runtime library, similar to glibc on Unix-like systems. The decision for Windows programs to bundle their C runtime libraries rather than relying solely on a shared system-wide version arises from sev...
25,544
[ { "from": "human", "value": "I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables. On a typical PC, I would find many copies of the same .DLL's. My understanding is that MSVCRT is the C runtime library, somewhat analogous to glib...
Templates are a pretty healthy business in established programming languages, but are there any good ones that can be processed in JavaScript? By "template" I mean a document that accepts a data object as input, inserts the data into some kind of serialized markup language, and outputs the markup. Well-known examples a...
As of my last update, there are several templating engines and solutions in JavaScript that cater to your requirements for being declarative, easy for HTML authors to write, and having cross-language support. Here are some notable options: 1. **Mustache**: - As you mentioned, Mustache is a logic-less templating eng...
20,638
[ { "from": "human", "value": "Templates are a pretty healthy business in established programming languages, but are there any good ones that can be processed in JavaScript?\nBy \"template\" I mean a document that accepts a data object as input, inserts the data into some kind of serialized markup language, a...
This Question is almost the same as the previously asked How can I get the IP Address of a local computer? -Question. However I need to find the IP address(es) of a Linux Machine. So: How do I - programmatically in C++ - detect the IP addresses of the linux server my application is running on. The servers will have at ...
To programmatically find the public IP address of a Linux machine using C++, you can take advantage of the `getifaddrs` function, which is a part of the standard POSIX library. This function will allow you to retrieve information about the network interfaces on the system, including their IP addresses. Here's a simple...
20,565
[ { "from": "human", "value": "This Question is almost the same as the previously asked How can I get the IP Address of a local computer? -Question. However I need to find the IP address(es) of a Linux Machine.\nSo: How do I - programmatically in C++ - detect the IP addresses of the linux server my applicatio...
I am writing my own Joomla component (MVC), its based heavily on the newsflash module, because I want to display the latest 5 content items in a sliding tabbed interface, all the hard work is done, but I am having real difficult getting content out of the for loop. Here is the code I have so far default.php <ul id="han...
To identify the first item in your loop and apply different values and classes conditionally, you can modify your `default.php` file to include a check for the index `$i`. Here’s how you can do it without causing a page timeout: ### Updated `default.php` You should check if `$i` is 0 to determine if you're on the fir...
24,249
[ { "from": "human", "value": "I am writing my own Joomla component (MVC), its based heavily on the newsflash module, because I want to display the latest 5 content items in a sliding tabbed interface, all the hard work is done, but I am having real difficult getting content out of the for loop.\nHere is the ...
I have report on my asp page and every time I change a filter and click view report, I get this error: Microsoft JScript runtime error: 'this._postBackSettings.async' is null or not an object I tried change the EnablePartialRendering="true" to EnablePartialRendering="false" but then people can't login on the site
The error you are encountering, `Microsoft JScript runtime error: 'this._postBackSettings.async' is null or not an object`, typically indicates an issue with the ASP.NET Ajax features, specifically with how partial postbacks are being handled. Here are several steps you can take to troubleshoot and resolve this issue: ...
21,978
[ { "from": "human", "value": "I have report on my asp page and every time I change a filter and click view report, I get this error:\nMicrosoft JScript runtime error: 'this._postBackSettings.async' is null or not an object\nI tried change the EnablePartialRendering=\"true\" to EnablePartialRendering=\"false\...
Exactly what the title says. I'm using MSVC++ 2008 express, and my class constructor is never executed when compiled in release mode. It DOES work in debug mode. I am doing something like: ClassTest test; test.DoIt(); Breakpoints on DoIt(); trigger, but breakpoints on ClassTest::ClassTest(); do not.
It seems like you're facing a problem where the constructor of your class is not being called in release mode but works fine in debug mode. There are several potential reasons for this issue in MSVC++ 2008. Here are some common culprits and steps you can take to diagnose and fix the problem: 1. **Optimization Issues**...
25,794
[ { "from": "human", "value": "Exactly what the title says. I'm using MSVC++ 2008 express, and my class constructor is never executed when compiled in release mode. It DOES work in debug mode. \nI am doing something like:\nClassTest test;\ntest.DoIt();\n\nBreakpoints on DoIt(); trigger, but breakpoints on Cla...
I have a multi-user application that keeps a centralized logfile for activity. Right now, that logging is going into text files to the tune of about 10MB-50MB / day. The text files are rotated daily by the logger, and we keep the past 4 or 5 days worth. Older than that is of no interest to us. They're read rarely: e...
Switching your application logging from text files to an SQL database can certainly improve the manageability and usability of your log data, especially considering the pain points you've described. Here are some benefits and drawbacks of using a database for logging, along with some implementation considerations: ###...
21,409
[ { "from": "human", "value": "I have a multi-user application that keeps a centralized logfile for activity. Right now, that logging is going into text files to the tune of about 10MB-50MB / day. The text files are rotated daily by the logger, and we keep the past 4 or 5 days worth. Older than that is of ...
We've recently completed phase 1 of a ASP.Net website in English and French. We went with using resource files to store language specific strings, but because the site used ASP.Net AJAX and javascript heavily we rigged up a solution to pass the right files through the ASP.Net pipeline where we could catch "tokens" and ...
Yes, many developers have encountered similar challenges when implementing internationalization (i18n) and localization (l10n) in web applications, especially those that use AJAX heavily. Here are some common approaches, lessons learned, and strategies for dealing with issues like internationalized date formats: ### A...
21,340
[ { "from": "human", "value": "We've recently completed phase 1 of a ASP.Net website in English and French. We went with using resource files to store language specific strings, but because the site used ASP.Net AJAX and javascript heavily we rigged up a solution to pass the right files through the ASP.Net pi...
As far as tools go, I am aware of Haxe, MTASC, and swfmill. Can you offer any success or horror stories related to any of them? Are there any others that I should be investigating? With respect to learning, the Adobe Developer Connection seems to contain decent reference materials, but the tutorials all assume that t...
Certainly! Let’s break down your questions into segments for clarity. ### Tools and Success/Horror Stories: 1. **Haxe**: - **Success Story**: Haxe is renowned for its ability to compile code to multiple platforms, making it a popular choice for game development. Developers have successfully used Haxe to create ga...
16,967
[ { "from": "human", "value": "As far as tools go, I am aware of Haxe, MTASC, and swfmill. Can you offer any success or horror stories related to any of them? Are there any others that I should be investigating?\nWith respect to learning, the Adobe Developer Connection seems to contain decent reference mate...
I have a tree of active record objects, something like: class Part < ActiveRecord::Base has_many :sub_parts, :class_name => "Part" def complicated_calculation if sub_parts.size > 0 return self.sub_parts.inject(0){ |sum, current| sum + current.complicated_calculation } else sleep(1) return...
Caching calculated values in a database can indeed become cumbersome, especially if you need to handle dependencies and invalidations. Here are a few cleaner approaches you can consider: ### 1. Use a Separate Cache Table Instead of adding a column to your existing `parts` table, you could create a separate cache tabl...
18,466
[ { "from": "human", "value": "I have a tree of active record objects, something like:\nclass Part < ActiveRecord::Base\n has_many :sub_parts, :class_name => \"Part\"\n\n def complicated_calculation\n if sub_parts.size > 0\n return self.sub_parts.inject(0){ |sum, current| sum + current.complicated_c...
On our live/production database I'm trying to add a trigger to a table, but have been unsuccessful. I have tried a few times, but it has taken more than 30 minutes for the create trigger statement to complete and I've cancelled it. The table is one that gets read/written to often by a couple different processes. I ...
Creating a trigger on a heavily used table, especially one with a large number of rows, can indeed lead to performance issues during the creation process, particularly if there are ongoing transactions. Here are some considerations and potential solutions for your situation: ### 1. Locking and Blocking: When you attem...
24,446
[ { "from": "human", "value": "On our live/production database I'm trying to add a trigger to a table, but have been unsuccessful. I have tried a few times, but it has taken more than 30 minutes for the create trigger statement to complete and I've cancelled it. \nThe table is one that gets read/written to ...
I am working on interactive SVG/AJAX interfaces where elements are created and repositioned on-the-fly by users. I'd like to support the ability for users to export their current view to a PNG image and/or an SVG document. I'd really like the SVG document to be as simple as possible (without a lot of nested transforms)...
To achieve the goal of allowing users to export their SVG graphics to PNG or SVG format without complicated installations or the need for users to rely on screenshots, you can consider the following approaches and libraries: ### 1. **Client-Side Libraries** #### a. **html2canvas** - **Usage**: For exporting as PNG, y...
23,324
[ { "from": "human", "value": "I am working on interactive SVG/AJAX interfaces where elements are created and repositioned on-the-fly by users. I'd like to support the ability for users to export their current view to a PNG image and/or an SVG document. I'd really like the SVG document to be as simple as poss...
I want to run a psychological study for which participants have to look at large images. The experiment is done on the web and therefore in a browser window. Is it possible to tell the browser to go into fullscreen, for example on button press? I know there is the possibility to open a fixed-size popup window. Do you t...
Running a psychological study that involves participants viewing large images in a web browser does come with some technical challenges, particularly when it comes to fullscreen functionality and handling popup blockers. Let's address your questions step by step: ### 1. Fullscreen Mode While you can't force a browser...
22,323
[ { "from": "human", "value": "I want to run a psychological study for which participants have to look at large images.\nThe experiment is done on the web and therefore in a browser window. Is it possible to tell the browser to go into fullscreen, for example on button press?\nI know there is the possibility ...
Currently I am developing a site with about seven partial classes, a few icons, three pages and an App_Themes folder. I was interested to know, is there an industry standard directory structure for anything larger than a small project? For example, I want to keep the classes in separate folders, the images in separate ...
Creating an organized and maintainable directory structure is crucial for larger projects, as it helps with code readability, collaboration, and overall management of resources. Here’s a suggested directory structure for your ASP.NET project, along with reasons for the organization: ``` /(root) /App_Data ...
18,624
[ { "from": "human", "value": "Currently I am developing a site with about seven partial classes, a few icons, three pages and an App_Themes folder. I was interested to know, is there an industry standard directory structure for anything larger than a small project?\nFor example, I want to keep the classes in...
The struts2 validation framework allows you to define your validation for an action or at the domain object level. My question is, is there an advantage or disadvantage using one over the other? What do you recommend? My own findings: You may use the same domain objects in several actions and may have to re-define vali...
The Struts2 validation framework indeed provides flexibility in defining validation rules either at the action level or at the domain object level. Each approach has its own advantages and disadvantages, and the choice between them can depend on your specific use case, design preferences, and the structure of your appl...
20,544
[ { "from": "human", "value": "The struts2 validation framework allows you to define your validation for an action or at the domain object level.\nMy question is, is there an advantage or disadvantage using one over the other? What do you recommend?\nMy own findings: You may use the same domain objects in sev...
So my group is trying to set up a shared-server environment for various and sundry web services. I think we've settled on setting disable_functions and disable_classes site wide in php.ini and php_admin_value to force open_basedir in each app's httpd.conf for php scripts, and passenger's user switching for ruby scrip...
Setting up a shared-server environment with different web services while ensuring security can be quite a challenge. You seem to have a solid plan for PHP and Ruby with `disable_functions`, `disable_classes`, `open_basedir`, and Passenger user switching, but Python does need some additional considerations. Here are a f...
23,862
[ { "from": "human", "value": "So my group is trying to set up a shared-server environment for various and sundry web services. I think we've settled on setting disable_functions and disable_classes site wide in php.ini and php_admin_value to force open_basedir in each app's httpd.conf\n for php scripts, and...
I am creating a DB wrapper and am in the need of adding SQL paramters to my stament however I do not know the parameter names or type, how can this be done? I have seen many other libraries do this... I just want the order of values to be mapped to the stored procedure...I thought the following code would work: public ...
In order to map parameters correctly to a stored procedure when you don't know their names, you typically have to rely on the position of the parameters rather than their names. Your current approach does not add parameters correctly to the command; you are currently trying to insert parameters at specific positions in...
24,181
[ { "from": "human", "value": "I am creating a DB wrapper and am in the need of adding SQL paramters to my stament however I do not know the parameter names or type, how can this be done? I have seen many other libraries do this...\nI just want the order of values to be mapped to the stored procedure...I thou...
Our company is looking into allowing third party sites to use our online checkout system. A client has stated that they would like to be able to use a lightbox style popup to display the checkout. And they would like this to be available on every page of the site, therefore mostly unsecure pages. Our checkout system an...
Using an iframe to display a checkout system on a third-party site is a common approach, but it raises important security and usability considerations. ### Security Considerations 1. **Secure Iframe**: If you use a secure HTTPS connection for your iframe, the content served within it will be secure from interception ...
23,236
[ { "from": "human", "value": "Our company is looking into allowing third party sites to use our online checkout system.\nA client has stated that they would like to be able to use a lightbox style popup to display the checkout. And they would like this to be available on every page of the site, therefore mos...
I know the mantra is that the database is always the long pole in the tent anytime a page is being generated server-side. But there's also a good bit of file i/o going on on a web server. Scripted code is replete with include/require statements. Moreover, its typically a practice to store templated html outside the app...
File I/O indeed plays a significant role in web development, especially when it comes to serving dynamic web pages. While database access is often highlighted as the "long pole in the tent," file I/O can also introduce latency and bottlenecks, particularly in scenarios involving numerous file reads or writes. ### Role...
21,529
[ { "from": "human", "value": "I know the mantra is that the database is always the long pole in the tent anytime a page is being generated server-side.\nBut there's also a good bit of file i/o going on on a web server. Scripted code is replete with include/require statements. Moreover, its typically a practi...
Am I correct to say the difference between a signed and unsigned integer is: Unsigned can hold a larger positive value and no negative value. Unsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is positive or negative. Signed integers can hold...
Yes, you are correct in your description of the differences between signed and unsigned integers. Let's summarize and clarify the points you've made and add a few more details: 1. **Range of Values**: - **Unsigned integers**: Can represent larger positive values since all bits are used for the magnitude. For exampl...
25,081
[ { "from": "human", "value": "Am I correct to say the difference between a signed and unsigned integer is:\n\nUnsigned can hold a larger positive value and no negative value.\nUnsigned uses the leading bit as a part of the value, while the signed version uses the left-most-bit to identify if the number is po...
Has anyone managed to get subsonic or a variant working on Windows Mobile? We cant get it to work as it has a dependency on System.Configuration. Any suggestions on an alternate ORMs that would work on a windows mobile device?
Getting SubSonic to work on Windows Mobile can indeed be challenging due to its dependencies, including `System.Configuration`, which is not available on the Windows Mobile platform. Given these constraints, you might want to consider alternative ORMs or data access methods that are more compatible with Windows Mobile ...
27,148
[ { "from": "human", "value": "Has anyone managed to get subsonic or a variant working on Windows Mobile? We cant get it to work as it has a dependency on System.Configuration.\nAny suggestions on an alternate ORMs that would work on a windows mobile device?\n" }, { "from": "gpt", "value": "Gettin...
I am wondering how the JBoss ExceptionSorter classes are able to check for database errors. The application (the EJB or persistence framework) is holding the reference to the database Connection, so SQLExceptions are caught by the application. How is JBoss able to see the contents of the exception? Does JBoss wrap the ...
JBoss (now known as WildFly) and other Java EE servers use a mechanism that often involves wrapping the database connection and intercepting exceptions to provide better error handling and connection management, especially in the context of EJBs and JTA transactions. ### How JBoss handles database exceptions 1. **Con...
26,194
[ { "from": "human", "value": "I am wondering how the JBoss ExceptionSorter classes are able to check for database errors.\nThe application (the EJB or persistence framework) is holding the reference to the database Connection, so SQLExceptions are caught by the application. How is JBoss able to see the conte...
How do I query an Oracle database to display the names of all tables in it?
To query an Oracle database and display the names of all tables, you can use the `USER_TABLES`, `ALL_TABLES`, or `DBA_TABLES` views, depending on your privileges and what you want to see: 1. **USER_TABLES**: This view shows the tables owned by the current user. 2. **ALL_TABLES**: This view shows all tables that the us...
27,249
[ { "from": "human", "value": "How do I query an Oracle database to display the names of all tables in it?\n" }, { "from": "gpt", "value": "To query an Oracle database and display the names of all tables, you can use the `USER_TABLES`, `ALL_TABLES`, or `DBA_TABLES` views, depending on your privile...
We use ASP.NET / C#. We work locally, test locally, check in our code and binaries through SVN. On our server, we checkout the latest 'build' from SVN directly into our IIS web directory. Is this a good practice, or is there something else we should be doing for rollouts?
Your current approach of checking out the latest build from SVN directly into your IIS web directory has some merits but also has several potential drawbacks. Here are some considerations and best practices you might want to adopt for a more robust deployment process: ### Pros of Your Current Approach: 1. **Simplicity...
24,842
[ { "from": "human", "value": "We use ASP.NET / C#.\nWe work locally, test locally, check in our code and binaries through SVN.\nOn our server, we checkout the latest 'build' from SVN directly into our IIS web directory.\nIs this a good practice, or is there something else we should be doing for rollouts?\n" ...
The following works in Firefox, but breaks in IE7 & 8: $("#my-first-div, #my-second-div").hide(); so I have to do this: $("#my-first-div").hide(); $("#my-second-div").hide(); Is this normal? EDIT: ok, my actual real-life code is this: $("#charges-gsm,#charges-gsm-faq,#charges-gsm-prices").html(html); and my error i...
It appears that you're running into compatibility issues with jQuery in Internet Explorer 7 and 8. Here's some information that might help clarify the issue and offer solutions. ### Understanding the Problem: 1. **jQuery Version**: You're using jQuery 1.2.6, which is an older version. This version may not fully suppo...
20,097
[ { "from": "human", "value": "The following works in Firefox, but breaks in IE7 & 8:\n$(\"#my-first-div, #my-second-div\").hide();\n\nso I have to do this:\n$(\"#my-first-div\").hide();\n$(\"#my-second-div\").hide();\n\nIs this normal?\nEDIT: ok, my actual real-life code is this:\n$(\"#charges-gsm,#charges-...
I would like to create an iPhone app that can open the google maps app and place a pin on the map. I have the exact location of the pin, specified by its longitude and latitude. I also have a name for the pin e.g. 'location 1' that should be displayed along with the pin. I know that UIApplication:openURL can be used fo...
Yes, you can open the Google Maps app from your iPhone app and place a pin at a specific location using a custom URL scheme. The format for the URL scheme to open Google Maps with a specific location is as follows: ``` comgooglemaps://?q=latitude,longitude(label) ``` Here's how you can structure the URL using your la...
24,665
[ { "from": "human", "value": "I would like to create an iPhone app that can open the google maps app and place a pin on the map.\nI have the exact location of the pin, specified by its longitude and latitude.\nI also have a name for the pin e.g. 'location 1' that should be displayed along with the pin.\nI kn...
Is there a way to programmatically find the location of the current user's Outlook .pst file(s) through an API call or registry entry?
Yes, you can programmatically find the location of the current user's Outlook .pst files through the Windows Registry. Outlook stores its configuration settings, including the locations of .pst files, in the Windows Registry. Here's how you can do it: ### 1. Check the Windows Registry The locations of the .pst file...
21,350
[ { "from": "human", "value": "Is there a way to programmatically find the location of the current user's Outlook .pst file(s) through an API call or registry entry?\n" }, { "from": "gpt", "value": "Yes, you can programmatically find the location of the current user's Outlook .pst files through th...
On a JSTL/JSP page, I have a java.util.Date object from my application. I need to find the day after the day specified by that object. I can use <jsp:scriptlet> to drop into Java and use java.util.Calendar to do the necessary calculations, but this feels clumsy and inelegant to me. Is there some way to use JSP or JSTL ...
You can achieve this in JSP using JSTL tags by leveraging the `fmt:formatDate` and `fn:toDate` functions provided by the JSTL library, particularly the `fn` (functions) tag library. However, JSTL itself does not have a built-in way to manipulate dates directly. That said, you can use a combination of JSTL and EL (Expre...
13,434
[ { "from": "human", "value": "On a JSTL/JSP page, I have a java.util.Date object from my application. I need to find the day after the day specified by that object. I can use <jsp:scriptlet> to drop into Java and use java.util.Calendar to do the necessary calculations, but this feels clumsy and inelegant to ...
Is it possible to run both debuggers within the same PHP installation simultaneously. They both use different ports so communication with the client IDEs/other apps wouldn't be an issue. I ask only because using the Zend Debugger with ZendStudio has proven to be much easier (fewer steps to start/stop debugging from the...
Yes, it is possible to run both Zend Debugger and Xdebug simultaneously in the same PHP installation. As you mentioned, both debuggers can be configured to use different ports, which allows them to coexist without conflict. Here’s a general approach to set this up: ### Step 1: Install Both Debuggers Ensure that both ...
23,750
[ { "from": "human", "value": "Is it possible to run both debuggers within the same PHP installation simultaneously. They both use different ports so communication with the client IDEs/other apps wouldn't be an issue.\nI ask only because using the Zend Debugger with ZendStudio has proven to be much easier (fe...
Is there any way to launch a program with a shortcut, that sets the process-priority of that program? iTunes is dragging my system to it's knees, but when I set the process-priority to "low", somehow, like magic, Windows gets back to it's normal responsive self :)
Yes, you can create a shortcut to launch a program with a specific process priority by using a script or a third-party tool. Below are a couple of methods you can use to accomplish this. ### Method 1: Using a Batch File You can create a batch file that launches iTunes and then sets its priority to "Low". Here are the...
22,010
[ { "from": "human", "value": "Is there any way to launch a program with a shortcut, that sets the process-priority of that program?\niTunes is dragging my system to it's knees, but when I set the process-priority to \"low\", somehow, like magic, Windows gets back to it's normal responsive self :)\n" }, {...
When editing HTML in emacs, is there a way to automatically pretty-format a blob of markup, changing something like this: <table> <tr> <td>blah</td></tr></table> ...into this: <table> <tr> <td> blah </td> </tr> </table>
Yes, you can pretty-format HTML in Emacs using various methods. Here are some popular ways to accomplish this: ### 1. Using `web-mode` If you have `web-mode` installed, you can enable it for your HTML files and it provides functionality for pretty-printing. To install `web-mode`, you can add it to your Emacs configur...
18,476
[ { "from": "human", "value": "When editing HTML in emacs, is there a way to automatically pretty-format a blob of markup, changing something like this:\n <table>\n <tr>\n<td>blah</td></tr></table>\n\n...into this:\n<table>\n <tr>\n <td>\n blah\n </td>\n </tr>\n</table>\n\n" }, { "from": "gpt", ...
Are there any usable implementations of Smalltalk for the .NET runtime?
Yes, there are a few implementations of Smalltalk that can run on the .NET runtime. One of the most notable is **S# (Smalltalk for .NET)**. S# is designed to integrate with the .NET ecosystem, allowing you to write Smalltalk code that can interoperate with .NET libraries and applications. Another option is **Pharo**, ...
29,414
[ { "from": "human", "value": "Are there any usable implementations of Smalltalk for the .NET runtime?\n" }, { "from": "gpt", "value": "Yes, there are a few implementations of Smalltalk that can run on the .NET runtime. One of the most notable is **S# (Smalltalk for .NET)**. S# is designed to inte...
This question is related to another question which I asked yesterday! List all links in web site I think renaming all the .html files to .asp and changing the links is not good for SEP purposes. Some one told me that isapi plug-in can be used to redirect(301) all .html files to .asp files. Can any one explain this fo...
Sure! If you want to change your website's file extensions from `.html` to `.asp` without losing search engine rankings, implementing a 301 redirect is a great solution. A 301 redirect tells search engines and browsers that a page has permanently moved to a new location. This helps preserve your site's SEO value. Here...
22,872
[ { "from": "human", "value": "This question is related to another question which I asked yesterday! \nList all links in web site\nI think renaming all the .html files to .asp and changing the links is not good for SEP purposes. Some one told me that isapi plug-in can be used to redirect(301) all .html files ...
I've never been so good at design because there are so many different possibilities and they all have pros and cons and I'm never sure which to go with. Anyway, here's my problem, I have a need for many different loosly related classes to have validation. However, some of these classes will need extra information to do...
You're facing a common design challenge in software engineering: how to manage related behavior (in this case, validation) across different classes that may have different requirements or methods of validation. Both of your proposed solutions have their merits, but you are rightly concerned about the flexibility and us...
21,317
[ { "from": "human", "value": "I've never been so good at design because there are so many different possibilities and they all have pros and cons and I'm never sure which to go with. Anyway, here's my problem, I have a need for many different loosly related classes to have validation. However, some of these ...
I have been working with relational databases for sometime, but it only recently occurred to me that there must be other types of databases that are non-relational. What are some examples of non-relational databases, and where/how are they used in the real world? Why would you choose to use a non-relational database o...
Certainly! Non-relational databases, often referred to as NoSQL databases, come in various types, and they are increasingly popular for specific applications. Here are some examples of non-relational databases, their use cases, and reasons to choose them over traditional relational databases. ### Examples of Non-Relat...
19,383
[ { "from": "human", "value": "I have been working with relational databases for sometime, but it only recently occurred to me that there must be other types of databases that are non-relational.\nWhat are some examples of non-relational databases, and where/how are they used in the real world? Why would you...
I've been fooling around with the Google App Engine for a few days and I have a little hobby application that I want to write and deploy. However I'd like to set it up so that users are not directly accessing the app via appspot.com. Is hosting it through Google Apps and then pointing it at my own domain the only way t...
Using Google App Engine (GAE) with a custom domain is a common approach to avoid users accessing your app via the `appspot.com` domain. Here are a couple of ways to achieve this, along with considerations for each option: ### Option 1: Custom Domain with Google App Engine 1. **Custom Domain Setup**: You can map your a...
25,287
[ { "from": "human", "value": "I've been fooling around with the Google App Engine for a few days and I have a little hobby application that I want to write and deploy.\nHowever I'd like to set it up so that users are not directly accessing the app via appspot.com.\nIs hosting it through Google Apps and then ...
How do you organize DB layer, business logic and cross-platform API of your information management system, if uploading and processing 500000 data records in one session is a normal operation (C# .NET 3.5 + MS SQL 2005)? I’m specifically interested in production-proven paging patterns that behave well with the concurre...
When dealing with large data sets in a concurrent environment, such as uploading and processing 500,000 records while ensuring paging works effectively in SQL Server 2005, there are several design considerations to keep in mind. Given the potential issues with simple pagination due to concurrent modifications, here are...
19,826
[ { "from": "human", "value": "How do you organize DB layer, business logic and cross-platform API of your information management system, if uploading and processing 500000 data records in one session is a normal operation (C# .NET 3.5 + MS SQL 2005)?\nI’m specifically interested in production-proven paging p...
UPDATE: This is one of my most-visited questions, and yet I still haven't really found a satisfactory solution for my project. One idea I read in an answer to another question is to create a tool which can build solutions 'on the fly' for projects that you pick from a list. I have yet to try that though. How do you st...
Structuring a large application, especially one with numerous dependencies, can be challenging. Based on my experience, here are some strategies you might consider for managing complexity, dependencies, and overall project organization in a WinForms application: ### 1. Modular Architecture **Multiple Smaller Projects/...
20,310
[ { "from": "human", "value": "UPDATE:\nThis is one of my most-visited questions, and yet I still haven't really found a satisfactory solution for my project. One idea I read in an answer to another question is to create a tool which can build solutions 'on the fly' for projects that you pick from a list. I h...
I would like to construct a query that displays all the results in a table, but is offset by 5 from the start of the table. As far as I can tell, MySQL's LIMIT requires a limit as well as an offset. Is there any way to do this?
Yes, in MySQL, you can use the `LIMIT` clause to achieve pagination or to skip a specific number of results. The `LIMIT` clause can take two arguments: the first is the offset (the number of rows to skip), and the second is the maximum number of rows to return. If you want to display all results starting from the 6th ...
26,899
[ { "from": "human", "value": "I would like to construct a query that displays all the results in a table, but is offset by 5 from the start of the table. As far as I can tell, MySQL's LIMIT requires a limit as well as an offset. Is there any way to do this?\n" }, { "from": "gpt", "value": "Yes, i...
Is one more preferred, or performs better over the other?
It seems like your question is missing some context. Could you please clarify what specific items, methods, or options you are comparing? This will help me provide a more accurate and relevant response.
29,440
[ { "from": "human", "value": "Is one more preferred, or performs better over the other?\n" }, { "from": "gpt", "value": "It seems like your question is missing some context. Could you please clarify what specific items, methods, or options you are comparing? This will help me provide a more accur...
I am using ServerXMLHTTP to perform an HTTP POST. The response returned is a redirect (specifically 303 See Other). ServerXMLHTTP is automatically following this redirect but this is causing an authentication failure as is not propagating the Authorization header of the original request. Is there a way I can prevent th...
When using `ServerXMLHTTP` in VBScript or a similar environment, it typically follows redirects automatically. However, if this leads to issues with authentication (such as losing the `Authorization` header), you might want to handle the redirects manually. Unfortunately, `ServerXMLHTTP` does not provide a built-in me...
24,922
[ { "from": "human", "value": "I am using ServerXMLHTTP to perform an HTTP POST. The response returned is a redirect (specifically 303 See Other). ServerXMLHTTP is automatically following this redirect but this is causing an authentication failure as is not propagating the Authorization header of the original...
I'm using the following syntax to loop through a list collection: For Each PropertyActor As JCPropertyActor In MyProperty.PropertyActors i = IndexOf(PropertyActor) Next How do I get the index of the current object within the loop? I'm using IndexOf(PropertyActor) but this seems inefficient as it searches the coll...
You are correct that using `IndexOf(PropertyActor)` can be inefficient because it searches the collection to find the index each time. Instead, you can use a simple counter variable to keep track of the index as you loop through the collection. Here’s how you can do it: ```vb Dim index As Integer = 0 For Each Property...
28,579
[ { "from": "human", "value": "I'm using the following syntax to loop through a list collection:\nFor Each PropertyActor As JCPropertyActor In MyProperty.PropertyActors\n\n i = IndexOf(PropertyActor)\nNext\n\nHow do I get the index of the current object within the loop? I'm using IndexOf(PropertyActor) but...
When I dynamically create a Datagrid and add in a new buttoncolumn how do I access the buttoncolumn_click event? Thanks.
When you dynamically create a DataGrid and add a ButtonColumn (or any other type of column), you need to handle the button clicks in a specific way since the button's click event isn't directly accessible like it is for controls defined in the markup. Here’s a step-by-step approach to add a ButtonColumn and handle its...
21,904
[ { "from": "human", "value": "When I dynamically create a Datagrid and add in a new buttoncolumn how do I access the buttoncolumn_click event? \nThanks.\n" }, { "from": "gpt", "value": "When you dynamically create a DataGrid and add a ButtonColumn (or any other type of column), you need to handl...
Note: I found this "Creating a Word Doc in C#.NET", but that is not what I want. Do you know how to create a .odt to create file from C# .NET? Is there a .NET component or wrapper for an OpenOffice.org library to do this?
To create `.odt` files (Open Document Text) in C#, you can use a few different libraries. While there's no official .NET wrapper for OpenOffice.org itself, there are several libraries available that can create and manipulate ODT files directly from C#. Here are a few options: ### 1. **NPOI** NPOI is a .NET library tha...
23,623
[ { "from": "human", "value": "Note: I found this \"Creating a Word Doc in C#.NET\", but that is not what I want.\nDo you know how to create a .odt to create file from C# .NET?\nIs there a .NET component or wrapper for an OpenOffice.org library to do this?\n" }, { "from": "gpt", "value": "To creat...
Do you primarily think of reasons TO implement it, or reasons NOT TO implement it? What are the advantages of each?
When considering whether to implement a particular solution, system, or process, it's important to weigh both the reasons to implement it and the reasons not to implement it. Here are some advantages of each perspective: ### Reasons TO Implement It 1. **Increased Efficiency**: Implementing new systems or processes ca...
24,051
[ { "from": "human", "value": "Do you primarily think of reasons TO implement it, or reasons NOT TO implement it? What are the advantages of each?\n" }, { "from": "gpt", "value": "When considering whether to implement a particular solution, system, or process, it's important to weigh both the reas...
When developing an app that will listen on a TCP/IP port, how should one go about selecting a default port? Assume that this app will be installed on many computers, and that avoiding port conflicts is desired.
When developing an app that listens on a TCP/IP port, selecting a default port is an important decision that can significantly impact the usability and deployment of your application. Here are some guidelines to consider for selecting a default port: 1. **Avoid Well-Known Ports (0-1023)**: These ports are assigned by ...
14,778
[ { "from": "human", "value": "When developing an app that will listen on a TCP/IP port, how should one go about selecting a default port? Assume that this app will be installed on many computers, and that avoiding port conflicts is desired.\n" }, { "from": "gpt", "value": "When developing an app...
Does anybody know of a Windows FTP client with SOCKS support? I need it to build a deployment script... I tried Filezilla but its command-line support seems quite poor, I need something completely non-interactive.
If you're looking for a Windows FTP client that supports SOCKS and has good command-line capabilities for non-interactive deployments, here are a few options to consider: 1. **WinSCP**: - WinSCP is a popular SFTP and FTP client for Windows that supports command-line operations. It also has support for SOCKS proxies...
25,516
[ { "from": "human", "value": "Does anybody know of a Windows FTP client with SOCKS support? \nI need it to build a deployment script... I tried Filezilla but its command-line support seems quite poor, I need something completely non-interactive.\n" }, { "from": "gpt", "value": "If you're looking...
What are those bad habits you've developed since you've started coding in Cocoa? I think making a list of bad habits and actively adding to it and, more importantly, breaking those habits is a good technique to produce your code quality. So start now, get your bad habits off your chest. Maybe other people share your ba...
It's great that you're taking a proactive approach to improving code quality by reflecting on bad habits. Here’s a list of common bad habits that developers, including those working with Cocoa (or Swift and Objective-C in general), might develop over time: 1. **Ignoring Documentation**: Skipping writing documentation ...
24,716
[ { "from": "human", "value": "What are those bad habits you've developed since you've started coding in Cocoa?\nI think making a list of bad habits and actively adding to it and, more importantly, breaking those habits is a good technique to produce your code quality. So start now, get your bad habits off yo...
I have 3 versions of the same assembly in the GAC (Global Assembly Cache), but i physically need a specific version, when going into the framework folder i.e. c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\ the assembly located in the folder is the latest version. Can i physically retrieve the first version that was ad...
In the Global Assembly Cache (GAC), multiple versions of the same assembly can coexist. However, if you want to retrieve a specific version of an assembly that you believe is stored in the GAC, you can do so using a few methods. ### Steps to Retrieve a Specific Version of an Assembly from the GAC 1. **Check Installed...
25,327
[ { "from": "human", "value": "I have 3 versions of the same assembly in the GAC (Global Assembly Cache), but i physically need a specific version, when going into the framework folder i.e.\nc:\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322\\ \nthe assembly located in the folder is the latest version. \nCan i ...
What is the PHP preg_replace in C#? I have an array of string that I would like to replace by an other array of string. Here is an example in PHP. How can I do something like that in C# without using .Replace("old","new"). $patterns[0] = '/=C0/'; $patterns[1] = '/=E9/'; $patterns[2] = '/=C9/'; $replacements[0] = 'à';...
In C#, you can achieve similar functionality to PHP's `preg_replace` using the `Regex.Replace` method from the `System.Text.RegularExpressions` namespace. You can create a loop to iterate through your patterns and replacements, or you can use a single method call with a custom `MatchEvaluator`. Here's how you could imp...
22,227
[ { "from": "human", "value": "What is the PHP preg_replace in C#?\nI have an array of string that I would like to replace by an other array of string. Here is an example in PHP. How can I do something like that in C# without using .Replace(\"old\",\"new\").\n$patterns[0] = '/=C0/';\n$patterns[1] = '/=E9/';\n...
How do you get an instance of the actionscript class Class from an instance of that class? In Python, this would be x.__class__; in Java, x.getClass();. I'm aware that certain terrible hacks exist to do this, but I'm looking for a built-in language facility, or at least a library routine built on something reliable.
In ActionScript, you can use the `Object` class's `constructor` property to get the class of an instance. This is similar to how you would retrieve a class reference in Python or Java. Here's how you can do it: ```actionscript var myInstance:MyClass = new MyClass(); var classReference:Class = myInstance.constructor a...
28,688
[ { "from": "human", "value": "How do you get an instance of the actionscript class Class from an instance of that class?\nIn Python, this would be x.__class__; in Java, x.getClass();.\nI'm aware that certain terrible hacks exist to do this, but I'm looking for a built-in language facility, or at least a libr...
I have created a base class A and a class B is a derived class inherited from class A. Both classes are marked as Serialized. When I try to return an object of type B through a web method i am getting following error: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was u...
The error you are encountering typically occurs when you are trying to serialize a derived class (`B`) through a web service method but the service does not know about the derived type. This is a common issue in .NET Web Services (ASMX) when using inheritance. To resolve this issue, you need to inform the serializer a...
26,976
[ { "from": "human", "value": "I have created a base class A and a class B is a derived class inherited from class A. Both classes are marked as Serialized. When I try to return an object of type B through a web method i am getting following error:\nSystem.Web.Services.Protocols.SoapException: System.Web.Serv...
Is there an animation format supported in Qt (using v4.4) that will support a full alpha channel? GIF only has one-bit transparency, and I don't think Qt supports APNG. Update: MNG seems to be supported, but that's even less popular than APNG! Maybe SVG is my best bet.
In Qt 4.4, if you are looking for an animation format that supports a full alpha channel, here are a few options to consider: 1. **MNG (Multiple-image Network Graphics)**: As you mentioned, MNG supports full alpha channels and can be a viable option, though its popularity is limited compared to more common formats. 2...
27,401
[ { "from": "human", "value": "Is there an animation format supported in Qt (using v4.4) that will support a full alpha channel? GIF only has one-bit transparency, and I don't think Qt supports APNG.\nUpdate: MNG seems to be supported, but that's even less popular than APNG! Maybe SVG is my best bet.\n" }...
I have code like this: template <typename T, typename U> struct MyStruct { T aType; U anotherType; }; class IWantToBeFriendsWithMyStruct { friend struct MyStruct; //what is the correct syntax here ? }; What is the correct syntax to give friendship to the template ?
To grant friendship to a class template in C++, you need to specify the template parameters as part of the friendship declaration. In your case, you need to declare the friendship for the `MyStruct` template with its template parameters. Here's how you can do it correctly: ```cpp template <typename T, typename U> stru...
28,819
[ { "from": "human", "value": "I have code like this:\ntemplate <typename T, typename U> struct MyStruct {\n T aType;\n U anotherType;\n};\n\nclass IWantToBeFriendsWithMyStruct\n{\n friend struct MyStruct; //what is the correct syntax here ?\n};\n\nWhat is the correct syntax to give friendship to the...
I am working with some input that is in the possible forms $1,200 20 cents/ inch $10 Is there a way to parse these to numbers in VB? Also printing these numbers? EDIT: Regular expressions would be great. EDIT: VB 6 in particular
In VB6, you can use regular expressions to parse and convert the specified string formats into numeric values. To accomplish this, you'll want to add the Microsoft VBScript Regular Expressions reference to your project. You can do this by going to `Project` -> `References` and checking the `Microsoft VBScript Regular E...
24,990
[ { "from": "human", "value": "I am working with some input that is in the possible forms\n$1,200\n20 cents/ inch\n$10\n\nIs there a way to parse these to numbers in VB? Also printing these numbers?\nEDIT: Regular expressions would be great.\nEDIT: VB 6 in particular\n" }, { "from": "gpt", "value...
$("#dvMyDIV").bind("resize", function(){ alert("Resized"); }); or $("#dvMyDIV").resize(function(){ alert("Resized"); }); The questions Why is this not working at FireFox, Chrome and Safari? Can this be considered a jQuery bug since the resize is not handled for other browsers? Could the only workaround be ca...
The issue you're encountering is related to how the resize event works in browsers. Let's break down the specifics: ### Why is this not working in Firefox, Chrome, and Safari? 1. **Resize Event Target**: The `resize` event is only triggered on the `window` object, not on individual DOM elements like `<div>`. Therefor...
22,784
[ { "from": "human", "value": "$(\"#dvMyDIV\").bind(\"resize\", function(){\n alert(\"Resized\");\n});\n\nor\n$(\"#dvMyDIV\").resize(function(){\n alert(\"Resized\");\n});\n\nThe questions\n\nWhy is this not working at FireFox, Chrome and Safari?\nCan this be considered a jQuery bug since the resize is ...
I need to be able to launch a process and read the output into a variable. Then based on the return of the command I can choose to show the full output or just a selected subset. So to be clear, I want to launch a text based process (psexec actually) and read the output from that command (stdout, stderr, etc) into a v...
You can achieve this in Python using the `subprocess` module, which allows you to spawn processes, connect to their input/output/error pipes, and obtain their return codes. Here's a step-by-step guide on how to launch a process (like `psexec`), read the output into a variable, and then handle the output based on the re...
24,929
[ { "from": "human", "value": "I need to be able to launch a process and read the output into a variable. Then based on the return of the command I can choose to show the full output or just a selected subset.\nSo to be clear, I want to launch a text based process (psexec actually) and read the output from t...
I'm using Windows Xp and i'm looking for a software where I can see the screen of a remote desktop and be able to show a second mouse (or pointer of any sort) that I can mouse to just show something. I want to work with a peer over the net, pretty much like the XP programming method. I find it useful, but it's pretty h...
For your requirements, there are several software options that can help you share your screen with a peer and allow you to point out specific items on the remote desktop without taking control. Here are a few suggestions that might work for Windows XP: 1. **TeamViewer**: TeamViewer is a popular remote desktop software...
24,376
[ { "from": "human", "value": "I'm using Windows Xp and i'm looking for a software where I can see the screen of a remote desktop and be able to show a second mouse (or pointer of any sort) that I can mouse to just show something.\nI want to work with a peer over the net, pretty much like the XP programming m...
I need that my Apache require authentication only to external access but free in my local network. I have mod_user in my Apache.
To configure your Apache server to require authentication only for external access (i.e., requests from outside your local network) while allowing free access within your local network, you can utilize `Require` directives in your Apache configuration along with the `mod_auth_basic` module. Assuming that you have alre...
21,797
[ { "from": "human", "value": "I need that my Apache require authentication only to external access but free in my local network. I have mod_user in my Apache.\n" }, { "from": "gpt", "value": "To configure your Apache server to require authentication only for external access (i.e., requests from o...
Does anyone know the API call I can use to change the keyboard layout on a windows machine to Dvorak? Doing it through the UI is easy but I'd like to have a script that I can run on new VM's to automate the process.
To change the keyboard layout on a Windows machine to Dvorak using a script, you can use PowerShell to modify the registry settings related to keyboard layouts. Here’s a step-by-step guide on how to achieve this: ### Method 1: Using PowerShell Script You can create a PowerShell script to set the keyboard layout to Dv...
23,603
[ { "from": "human", "value": "Does anyone know the API call I can use to change the keyboard layout on a windows machine to Dvorak? Doing it through the UI is easy but I'd like to have a script that I can run on new VM's to automate the process. \n" }, { "from": "gpt", "value": "To change the k...
I've got a User table with a bitmask that contains the user's roles. The linq query below returns all the users whose roles include 1, 4 or 16. var users = from u in dc.Users where ((u.UserRolesBitmask & 1) == 1) || ((u.UserRolesBitmask & 4) == 4) || ((u.UserRolesBitmask & 16)...
Certainly! You can rewrite your LINQ query using the `GetUsersFromRoles` method by using a combination of `Any` and `Aggregate` methods to dynamically create the bitmask checks based on the `UserRoles` array. Here’s a revised version of your method: ```csharp private List<User> GetUsersFromRoles(uint[] userRoles) { ...
26,611
[ { "from": "human", "value": "I've got a User table with a bitmask that contains the user's roles. The linq query below returns all the users whose roles include 1, 4 or 16. \nvar users = from u in dc.Users\n where ((u.UserRolesBitmask & 1) == 1)\n || ((u.UserRolesBitmask & 4) == 4)\...
I've googled around a bit, but maybe I didn't put the correct magik incantation into the search box. Does anyone know how to get output parameters from a stored procedure in Python? I'm using pymssql to call a stored procedure, and I'm not sure of the correct syntax to get the output parameter back. I don't think I ca...
To retrieve output parameters from a stored procedure using `pymssql` in Python, you'll need to set up the output parameters correctly in your SQL query and also bind them in your Python code. Below is an example of how to do this. Assuming you have a stored procedure defined like this: ```sql CREATE PROCEDURE MyProc...
22,639
[ { "from": "human", "value": "I've googled around a bit, but maybe I didn't put the correct magik incantation into the search box. \nDoes anyone know how to get output parameters from a stored procedure in Python? I'm using pymssql to call a stored procedure, and I'm not sure of the correct syntax to get the...
I'm developing a cart that needs to calculate tax and am looking for a 3rd party tax service to handle the calculations. I've used Avalara in another app, but it's somewhat miserable since I have to use the Rjb gem with their java library. Does anyone have a recommendation for a tax service that works well with rails...
There are several tax calculation services that integrate well with Rails and offer a more seamless experience compared to using Avalara's Java library. Here are a few popular options: 1. **TaxJar**: - TaxJar provides a simple API for calculating sales tax, and it integrates well with Rails applications. They have ...
24,762
[ { "from": "human", "value": "I'm developing a cart that needs to calculate tax and am looking for a 3rd party tax service to handle the calculations. \nI've used Avalara in another app, but it's somewhat miserable since I have to use the Rjb gem with their java library.\nDoes anyone have a recommendation f...
I run into this occasionally and always forget how to do it. One of those things that pop up ever so often. Also, what's the formula to convert angles expressed in radians to degrees and back again?
It's common to forget the conversion formulas between radians and degrees since they aren't used all the time. Here are the formulas you need: 1. **To convert from radians to degrees**: \[ \text{Degrees} = \text{Radians} \times \left(\frac{180}{\pi}\right) \] 2. **To convert from degrees to radians**: \...
27,759
[ { "from": "human", "value": "I run into this occasionally and always forget how to do it.\nOne of those things that pop up ever so often.\nAlso, what's the formula to convert angles expressed in radians to degrees and back again?\n" }, { "from": "gpt", "value": "It's common to forget the convers...
In a project we have two build types, one for continuous integration and one that runs our test suite. When the Quality Indicators report is run, it displays data from all builds regardless of build type. The report suggests that one can only run it on a specific build type but the query that populates the builds fiel...
Yes, it is possible to filter by Build Type to ensure that only builds associated with your test suite are included in the Quality Indicators report. To achieve this, you'll need to adjust the query that populates the builds field so that it accepts the specific Build Type parameter and filters the results accordingly....
27,719
[ { "from": "human", "value": "In a project we have two build types, one for continuous integration and one that runs our test suite. When the Quality Indicators report is run, it displays data from all builds regardless of build type.\nThe report suggests that one can only run it on a specific build type bu...
Right now I'm not sure...
That's completely okay! If you have questions or need assistance with something specific, feel free to share. I'm here to help!
30,462
[ { "from": "human", "value": "Right now I'm not sure...\n" }, { "from": "gpt", "value": "That's completely okay! If you have questions or need assistance with something specific, feel free to share. I'm here to help!" } ]
I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter. The function looks like this: Private Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = "45") as boolean 'stuff end function and I'm Invoking it like this: Dim result As Boolean...
When invoking a method with optional parameters using `Reflector.InvokeMethod`, you need to be mindful of how the optional parameters are handled in VB.NET. In your case, if you don’t pass the third parameter, it will not match the method signature exactly, and thus it won't invoke the method. However, you can pass `N...
25,945
[ { "from": "human", "value": "I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter.\nThe function looks like this: \nPrivate Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = \"45\") as boolean\n'stuff\nend function\n\nand...
I've just seen this in the MS Visual Studio docs and the part in bold doesn't make sense to me. Is it wrong or am I not understanding it properly? If you run this, b appears to hold "hello" (as I would expect) and not "h". Strings are immutable--the contents of a string object cannot be changed after the object is crea...
Your confusion is understandable! The behavior of strings in C# (and many other programming languages) can indeed be somewhat unintuitive due to the way immutability is handled. Let's break it down: 1. **String Immutability**: In C#, strings are immutable, meaning that once a string is created, it cannot be modified....
26,220
[ { "from": "human", "value": "I've just seen this in the MS Visual Studio docs and the part in bold doesn't make sense to me. Is it wrong or am I not understanding it properly? If you run this, b appears to hold \"hello\" (as I would expect) and not \"h\".\nStrings are immutable--the contents of a string obj...
Has anyone used TUDBC? This looks interesting, but I wonder how valuable it would be for me to investigate. I'm curious about anyone's good or bad experience.
TUDBC (Trans Universal Database Connector) is designed to offer a unified way to connect to multiple database types with a single interface. Users have reported various experiences, which can be helpful when considering whether to investigate further. ### Positive Experiences: 1. **Unified Access**: Many users appreci...
21,948
[ { "from": "human", "value": "Has anyone used TUDBC? This looks interesting, but I wonder how valuable it would be for me to investigate. I'm curious about anyone's good or bad experience.\n" }, { "from": "gpt", "value": "TUDBC (Trans Universal Database Connector) is designed to offer a unified w...
Possible Duplicate: How to parse a string to an int in C++? How do you convert a C++ string to an int? Assume you are expecting the string to have actual numbers in it ("1", "345", "38944", for example). Also, let's assume you don't have boost, and you really want to do it the C++ way, not the crufty old C way.
In modern C++, you can convert a string to an integer using the `std::stoi` function, which is part of the `<string>` header. This function is safe and adheres to C++'s type system. Here's how you can do it: ```cpp #include <iostream> #include <string> int main() { std::string str = "12345"; // Example string ...
24,226
[ { "from": "human", "value": "\nPossible Duplicate:\nHow to parse a string to an int in C++? \n\nHow do you convert a C++ string to an int?\nAssume you are expecting the string to have actual numbers in it (\"1\", \"345\", \"38944\", for example).\nAlso, let's assume you don't have boost, and you really want...