instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Is it possible to change the auto-increment offset on a pre-existing table with JavaDB? I'm having a problem where inserting new records usually (but not always) fails with an error complaining about using an existing key (my auto-increment column). To populate this database, I took a dump from another database (MyS...
Yes, it is possible to change the auto-increment offset in JavaDB (also known as Apache Derby) for a pre-existing table, but it's important to follow specific steps to ensure that the auto-increment values start generating from a new point. In JavaDB, the auto-increment value is typically managed by a sequence associa...
43,204
[ { "from": "human", "value": "Is it possible to change the auto-increment offset on a pre-existing table with JavaDB? \nI'm having a problem where inserting new records usually (but not always) fails with an error complaining about using an existing key (my auto-increment column). To populate this database...
I was wondering if there is a good IRC channel around somewhere that allows iPhone developers to get together and talk about code and etc. Any channel already around that people are using?
While IRC has declined in popularity with the rise of other communication platforms, there are still active channels for developers. For iPhone developers specifically, you might want to check out the following IRC channels: 1. **#ios** - This channel typically has discussions focused on iOS development, Swift, and Ob...
46,993
[ { "from": "human", "value": "I was wondering if there is a good IRC channel around somewhere that allows iPhone developers to get together and talk about code and etc.\nAny channel already around that people are using?\n" }, { "from": "gpt", "value": "While IRC has declined in popularity with th...
How can I determine when the control key is held down during button click in a C# Windows program? I want one action to take place for Ctrl/Click and a different one for Click.
In a C# Windows Forms application, you can determine if the Control key is being held down during a button click event by checking the state of the `Control.ModifierKeys` property. This property indicates which modifier keys (like Ctrl, Shift, or Alt) are currently pressed. Here's a simple example of how to implement ...
42,547
[ { "from": "human", "value": "How can I determine when the control key is held down during button click in a C# Windows program? I want one action to take place for Ctrl/Click and a different one for Click.\n" }, { "from": "gpt", "value": "In a C# Windows Forms application, you can determine if t...
My Alt key was unknowingly stuck down and I tried to open my Window Menu in VS, which resulted in removing the menu from the bar. My question is, how the heck do I get it back?
If you've accidentally hidden the menu bar in Visual Studio and want to get it back, here are the steps you can follow: 1. **Toggle the Menu Bar**: - Press `Alt` to see if the menu bar appears temporarily. If it does, you can try to toggle it back. - You can also press `Ctrl + Alt + M` to see if that helps. 2. ...
44,606
[ { "from": "human", "value": "My Alt key was unknowingly stuck down and I tried to open my Window Menu in VS, which resulted in removing the menu from the bar.\nMy question is, how the heck do I get it back?\n" }, { "from": "gpt", "value": "If you've accidentally hidden the menu bar in Visual Stu...
At work we use confluence. On occasion it crashes, resulting in an error 500 page being generated. This page includes some interesting reference information, including: System Information: favouriteColour: Myrtle javaRuntime: Java(TM) SE Runtime Environment jvmVersion: 1.0 operatingSystem: Linux 2.6.18-92.1.1...
The mention of "Myrtle" as a favorite color in the Confluence error page is indeed one of those quirky easter eggs that developers sometimes include in their software. While there's no official explanation from Atlassian about why "Myrtle" was chosen specifically, it reflects a common practice in programming to inject ...
44,756
[ { "from": "human", "value": "At work we use confluence. \nOn occasion it crashes, resulting in an error 500 page being generated.\nThis page includes some interesting reference information, including:\n\nSystem Information:\n favouriteColour: Myrtle\n javaRuntime: Java(TM) SE Runtime Environment\n jvmVer...
I'm developing a web app. In it I have a section called categories that every time a user clicks one of the categories an update panel loads the appropriate content. After the user clicked the category I want to change the browser's address bar url from www.mysite.com/products to something like www.mysite.com/produ...
Yes, you can achieve this using the HTML5 History API, specifically the `history.pushState()` method. This allows you to change the URL in the address bar without reloading the page. Here's how you can implement it: 1. When a user clicks a category, you can update the URL using `history.pushState()`. 2. You can then ...
42,918
[ { "from": "human", "value": "I'm developing a web app. In it I have a section called categories that every time a user clicks one of the categories an update panel loads the appropriate content. \nAfter the user clicked the category I want to change the browser's address bar url from\nwww.mysite.com/product...
Do you all add revision fixed to your custom fields? And what is the point of have Work Start? I thought resolve issue is good enough?
When managing issues in a project management or issue tracking system, adding custom fields like "revision fixed" can be beneficial for several reasons: 1. **Clarity on Versioning**: The "revision fixed" field allows teams to specify which version or revision of the product the issue was fixed in. This helps in tracki...
44,837
[ { "from": "human", "value": "Do you all add revision fixed to your custom fields?\nAnd what is the point of have Work Start? I thought resolve issue is good enough?\n" }, { "from": "gpt", "value": "When managing issues in a project management or issue tracking system, adding custom fields like \...
So I have this c# application that needs to ping my web server thats running linux/php stack. I am having problems with the c# way of base 64 encoding bytes. my c# code is like: byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("the string"); String enc = Convert.ToBase64String(encbuff); and php side: $data = $_REQU...
The issue you're facing might not directly relate to the base64 encoding itself, but rather how you are sending or receiving the data between C# and PHP. Let's clarify a few things and ensure that everything is handled correctly. 1. **Base64 Encoding**: The C# code you provided correctly encodes a string in Base64. Th...
41,866
[ { "from": "human", "value": "So I have this c# application that needs to ping my web server thats running linux/php stack.\nI am having problems with the c# way of base 64 encoding bytes.\nmy c# code is like:\nbyte[] encbuff = System.Text.Encoding.UTF8.GetBytes(\"the string\");\nString enc = Convert.ToBase6...
Where can I set it? I need files to be encoded in UTF-8 by default... there is nothing in Tools -> Options or any other menu as far as I know :( P.S. I don't need to set default encoding for Project or so, I need it to be default for any files I create. Thanks for your help :)
To set UTF-8 as the default encoding for all new files you create in various text editors or Integrated Development Environments (IDEs), the steps can vary depending on the tool you are using. Here are instructions for some popular ones: ### Visual Studio Code 1. Open the settings (File > Preferences > Settings or Ctr...
41,968
[ { "from": "human", "value": "Where can I set it? I need files to be encoded in UTF-8 by default... there is nothing in Tools -> Options or any other menu as far as I know :( \nP.S. I don't need to set default encoding for Project or so, I need it to be default for any files I create. Thanks for your help :)...
I've got an NSBrowser hooked up to an NSTreeController bound to an array of NSTreeNode objects. It's easy enough to get the text portion working by setting the Content and Content Value bindings to properly reference the tree controller, but how do I set the image for each cell using bindings?
To set the image for each cell in an `NSBrowser` that is hooked up to an `NSTreeController`, you will need to use the `NSBrowserDelegate` methods to provide images for the cells, along with bindings for the text. Here's a step-by-step approach on how to achieve this: 1. **Create an Image Property**: Make sure that ea...
43,645
[ { "from": "human", "value": "I've got an NSBrowser hooked up to an NSTreeController bound to an array of NSTreeNode objects. It's easy enough to get the text portion working by setting the Content and Content Value bindings to properly reference the tree controller, but how do I set the image for each cell ...
What is the simplest way in VB6 to loop through all the files in a specified folder directory and get their names?
In VB6, you can use the `Dir` function to loop through all the files in a specified folder directory. Here’s a simple example that demonstrates how to do this: ```vb Private Sub ListFilesInFolder() Dim folderPath As String Dim fileName As String ' Specify the folder path folderPath = "C:\Your\Fold...
42,711
[ { "from": "human", "value": "What is the simplest way in VB6 to loop through all the files in a specified folder directory and get their names?\n" }, { "from": "gpt", "value": "In VB6, you can use the `Dir` function to loop through all the files in a specified folder directory. Here’s a simple e...
I'm brand new to jQuery and have some experience using Prototype. In Prototype, there is a method to "flash" an element — ie. briefly highlight it in another color and have it fade back to normal so that the user's eye is drawn to it. Is there such a method in jQuery? I see fadeIn, fadeOut, and animate, but I don't see...
In jQuery, there isn't a built-in method specifically called "flash" like in Prototype, but you can achieve a similar effect by combining `animate()` or using the `fadeTo()` method along with a bit of CSS. The idea is to temporarily change the background color of the element, and then return it to its original color af...
42,700
[ { "from": "human", "value": "I'm brand new to jQuery and have some experience using Prototype. In Prototype, there is a method to \"flash\" an element — ie. briefly highlight it in another color and have it fade back to normal so that the user's eye is drawn to it. Is there such a method in jQuery? I see fa...
What is the best solution to build several CDT C++ projects from the command line? The projects have references and so it is not possible to just build single projects.
To build several CDT (C/C++ Development Tooling) projects from the command line, especially when they have interdependencies, you can consider a few different approaches. Below are some common methods: ### 1. **Makefile-based Approach** If you are comfortable with Makefiles, you can create a top-level Makefile that de...
41,674
[ { "from": "human", "value": "What is the best solution to build several CDT C++ projects from the command line? The projects have references and so it is not possible to just build single projects.\n" }, { "from": "gpt", "value": "To build several CDT (C/C++ Development Tooling) projects from th...
In my Rails app I have three models, Projects, BlogPosts and Images. Projects and BlogPosts can have many linked images and an image can be linked to a Project, a BlogPost or both. What is the best way of setting up the associations to make this work in Rails?
To set up your Rails app with the specified associations between `Projects`, `BlogPosts`, and `Images`, you will want to define a many-to-many relationship for images. Here’s a suitable way to structure these models using join tables: 1. **Models**: - `Project` - `BlogPost` - `Image` - You will need a join...
42,353
[ { "from": "human", "value": "In my Rails app I have three models, Projects, BlogPosts and Images. Projects and BlogPosts can have many linked images and an image can be linked to a Project, a BlogPost or both.\nWhat is the best way of setting up the associations to make this work in Rails?\n" }, { "...
I have an access query which creates some output, 3 columns named e.g. A, B, and C. I would like to create a function where I can automatically output this query to a text file without the header rows. I am currently outputting the file to excel then opening the file and deleting the first row. The user then has to con...
To create a function that automatically outputs the results of an Access query to a text file without the header rows, you can use VBA (Visual Basic for Applications) in Access. Below is an example of how you might structure this function. This function will run your query and save the results directly to a text file w...
43,279
[ { "from": "human", "value": "I have an access query which creates some output, 3 columns named e.g. A, B, and C.\nI would like to create a function where I can automatically output this query to a text file without the header rows. I am currently outputting the file to excel then opening the file and deleti...
I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy?
Yes, you can efficiently trim long sequences of the same value from a binary file using NumPy. This approach is particularly effective for large binary files, as it avoids loading the entire file into memory as a string. Here’s a step-by-step guide on how you could implement this: 1. Read the binary data from the fil...
43,146
[ { "from": "human", "value": "I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like nump...
How can I rename a schema using SQL Server?
In SQL Server, you can rename a schema using the `ALTER SCHEMA` statement. However, it is important to note that SQL Server does not provide a direct command to rename a schema. Instead, you typically have to move all objects in the schema to a new schema with the desired name and then drop the old schema. Here is a s...
43,937
[ { "from": "human", "value": "How can I rename a schema using SQL Server? \n" }, { "from": "gpt", "value": "In SQL Server, you can rename a schema using the `ALTER SCHEMA` statement. However, it is important to note that SQL Server does not provide a direct command to rename a schema. Instead, yo...
I'm looking at buying a code-signing certificate from Comodo (they seem to be the cheapest). Can someone who has done this tell me how long it takes to issue the certificate once you submit your business documents?
The time it takes to issue a code-signing certificate from Comodo (now known as Sectigo) can vary based on a few factors, such as the type of certificate you're purchasing (organization validation vs. extended validation) and the completeness of the documents you submit. Generally, here are some typical timelines: 1. ...
45,218
[ { "from": "human", "value": "I'm looking at buying a code-signing certificate from Comodo (they seem to be the cheapest).\nCan someone who has done this tell me how long it takes to issue the certificate once you submit your business documents?\n" }, { "from": "gpt", "value": "The time it takes ...
Would the following make the objects fulfil all characteristics that enums have in JavaScript? Something like: my.namespace.ColorEnum = { RED : 0, GREEN : 1, BLUE : 2 } // later on if(currentColor == my.namespace.ColorEnum.RED) { // whatever } Or is there some other way I can do this?
Your approach of defining an enum-like object in JavaScript is valid and will work as intended. By using an object to hold the color constants, you can reference them easily later in your code. However, traditional JavaScript does not have built-in support for enums like some other languages do, such as Java or TypeScr...
42,998
[ { "from": "human", "value": "Would the following make the objects fulfil all characteristics that enums have in JavaScript? Something like:\nmy.namespace.ColorEnum = {\n RED : 0,\n GREEN : 1,\n BLUE : 2\n}\n\n// later on\n\nif(currentColor == my.namespace.ColorEnum.RED) {\n // whatever\n}\n\n\nOr is the...
I have used extension methods to extend html helpers to make an RSS repeater: public static string RSSRepeater(this HtmlHelper html, IEnumerable<IRSSable> rss) { string result=""; foreach (IRSSable item in rss) { result += "<item>" + item.GetRSSItem().InnerXml + "</item>"; ...
It looks like you're trying to pass an `IEnumerable<Issue>` to your `RSSRepeater` extension method, which expects an `IEnumerable<IRSSable>`. Since `Issue` implements `IRSSable`, you should be able to pass it directly, but you'll need to ensure that the conversion to `IEnumerable<IRSSable>` is done correctly. The issu...
43,608
[ { "from": "human", "value": "I have used extension methods to extend html helpers to make an RSS repeater:\n public static string RSSRepeater(this HtmlHelper html, IEnumerable<IRSSable> rss)\n {\n string result=\"\";\n\n foreach (IRSSable item in rss)\n {\n result += \"...
This seems like it should be easy but I'm stumped. In WPF, I'd like a TextBox that stretches to the width of it's parent, but only to a maximum width. The problem is that I want it to be left justified within its parent. To get it to stretch you have to use HorizontalAlignment="Stretch", but then the result is centered...
To achieve a TextBox that stretches to the width of its parent with a maximum width, while being left justified, you can use the `HorizontalAlignment` property set to `Left`, along with a `Width` that is bound to its parent's width minus any padding or margins. However, for a simpler solution, you can place the TextBox...
43,184
[ { "from": "human", "value": "This seems like it should be easy but I'm stumped. In WPF, I'd like a TextBox that stretches to the width of it's parent, but only to a maximum width. The problem is that I want it to be left justified within its parent. To get it to stretch you have to use HorizontalAlignment=\...
I'm developing my application (on Linux) and sadly it sometimes hangs. I can use Ctrl+C to send sigint, but my program is ignoring sigint because it's too far gone. So I have to do the process-killing-dance: Ctrl+Z $ ps aux | grep process_name $ kill -9 pid Is there a way to configure bash to send the kill signal to t...
Yes, you can configure a custom key binding in your terminal (like bash) to send a `SIGKILL` signal to the currently running process. Here's how to set this up in a Linux terminal: 1. **Use `trap` to Catch Signals:** First, modify your shell environment to ensure that a specific key combination can send a `SIGKILL`...
43,113
[ { "from": "human", "value": "I'm developing my application (on Linux) and sadly it sometimes hangs. I can use Ctrl+C to send sigint, but my program is ignoring sigint because it's too far gone. So I have to do the process-killing-dance:\nCtrl+Z\n$ ps aux | grep process_name\n$ kill -9 pid\n\nIs there a way ...
I have a file and I don't know how big it's going to be (it could be quite large, but the size will vary greatly). I want to search the last 10 lines or so to see if any of them match a string. I need to do this as quickly and efficiently as possible and was wondering if there's anything better than: s = "foo" last_b...
When dealing with potentially large files, reading all lines into memory at once (using `readlines()`) can be inefficient and consume a lot of resources. Instead, you can efficiently read only the last few lines of a file without loading the entire file into memory. One way to do this is to seek to the end of the fil...
43,573
[ { "from": "human", "value": "I have a file and I don't know how big it's going to be (it could be quite large, but the size will vary greatly). I want to search the last 10 lines or so to see if any of them match a string. I need to do this as quickly and efficiently as possible and was wondering if there...
I'm looking for a way to automatically get the Java Wireless Toolkit storage root (the directory where the JWT stores the file system of a mobile device simulator), in an Ant build file. Is there a property file or an environment variable that the JWT stores that path?
In the Java Wireless Toolkit (JWT), the storage root for the device simulator is not stored directly in a standard environment variable or a dedicated properties file that you can reference easily in an Ant build file. However, there are a couple of ways to determine the storage root path, depending on how your environ...
43,747
[ { "from": "human", "value": "I'm looking for a way to automatically get the Java Wireless Toolkit storage root (the directory where the JWT stores the file system of a mobile device simulator), in an Ant build file.\nIs there a property file or an environment variable that the JWT stores that path?\n" }, ...
I recently learnt that oracle has a feature which was pretty useful to me - as the designer/implementator didn't care much about data history - I can query the historical state of a record if it's available yet in the oracle cache, like this: select * from ( select * from sometable where some_condition )...
In Oracle, you can use the Flashback Query feature to view historical data, but the standard `AS OF TIMESTAMP` clause allows you to specify a specific point in time, not a range. If you need to query historical data over a specific range, you will typically need to perform two separate queries, one for the start of th...
44,323
[ { "from": "human", "value": "I recently learnt that oracle has a feature which was pretty useful to me - as the designer/implementator didn't care much about data history - I can query the historical state of a record if it's available yet in the oracle cache, like this:\nselect * \n from ( select * \n ...
In an attempt to hide the Safari UI components for an web-app bookmarked as a Homescreen Icon. I am using this meta tag <meta name="apple-mobile-web-app-capable" content="yes" /> as specified on iPhone Dev Center but the address bar and toolbar are still there when launched from the home screen icon. What do I need ...
To successfully hide the Safari UI components when launching your web app from a Home Screen icon on iOS, you need to ensure that you're using the correct meta tags and that your web app is set up correctly. The key meta tag to make your web app run in standalone mode (without the address bar and toolbar) is indeed: `...
43,839
[ { "from": "human", "value": "In an attempt to hide the Safari UI components for an web-app bookmarked as a Homescreen Icon. I am using this meta tag \n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n\nas specified on iPhone Dev Center but the address bar and toolbar are still there when laun...
Could anyone provide any example of NAnt script for C++ project build automation? Thanks!
Certainly! Below is a simple example of a NAnt script that automates the build process for a C++ project. This example assumes you have a basic C++ project structure and want to compile `.cpp` files into an executable. ### Example NAnt Build Script for C++ Project ```xml <?xml version="1.0" encoding="utf-8" ?> <proje...
41,390
[ { "from": "human", "value": "Could anyone provide any example of NAnt script for C++ project build automation?\nThanks!\n" }, { "from": "gpt", "value": "Certainly! Below is a simple example of a NAnt script that automates the build process for a C++ project. This example assumes you have a basic...
How should I check if my ISP blocks port 25?
To check if your ISP is blocking port 25, which is commonly used for SMTP (sending email), you can follow these steps: ### Method 1: Telnet Command 1. **Open Command Prompt or Terminal:** - On Windows, press `Win + R`, type `cmd`, and press Enter. - On macOS/Linux, open Terminal. 2. **Use Telnet to Test Port 2...
41,068
[ { "from": "human", "value": "How should I check if my ISP blocks port 25?\n" }, { "from": "gpt", "value": "To check if your ISP is blocking port 25, which is commonly used for SMTP (sending email), you can follow these steps:\n\n### Method 1: Telnet Command\n\n1. **Open Command Prompt or Termina...
I have a line of Fortran code, which includes some text. I'm changing the text, which makes the code line too long for Fortran, so I split it over two lines using 'a'. Was: IF (MYVAR .EQ. 1) THEN WRITE(iott,'(A) (A)') 'ABC=', SOMEVAR Changed to: IF (MYVAR .EQ. 1) THEN WRITE(iott,'(A) (A)') 'ABC DEF GHI JK...
In Fortran, when you split a line using the continuation character `a`, any whitespace that appears between the `a` and the next character (including a quote `'`) is retained. This means that if you have: ```fortran WRITE(iott,'(A) (A)') 'ABC DEF GHI JK a ' // 'L=', SOMEVAR ``` The space before the quote `'L='` on ...
46,713
[ { "from": "human", "value": "I have a line of Fortran code, which includes some text. I'm changing the text, which makes the code line too long for Fortran, so I split it over two lines using 'a'. \nWas:\n IF (MYVAR .EQ. 1) THEN\n WRITE(iott,'(A) (A)') 'ABC=', SOMEVAR\n\nChanged to:\n IF (MYVAR .EQ. 1)...
Regex to Find Second Char is Alpha up to 5 Alpha Followed by 1 numeral. Thanks
To create a regex that matches strings where the second character is an alphabetic character, followed by up to five additional alphabetic characters, and ending with a single numeral, you can use the following pattern: ```regex ^[A-Za-z]([A-Za-z]{0,5})\d$ ``` ### Explanation: - `^` asserts the start of the string. -...
43,606
[ { "from": "human", "value": "Regex to Find Second Char is Alpha up to 5 Alpha Followed by 1 numeral.\nThanks\n" }, { "from": "gpt", "value": "To create a regex that matches strings where the second character is an alphabetic character, followed by up to five additional alphabetic characters, and...
How do I build a VST plugin on Mac without using Xcode? (I'm using Code::Blocks).
Building a VST plugin on Mac without using Xcode is possible, but it requires a good understanding of the VST SDK, C++, and the build process. Since you're using Code::Blocks, you'll need to set up your project correctly. Here’s a step-by-step guide to get you started: ### Prerequisites 1. **VST SDK**: Download the VS...
40,368
[ { "from": "human", "value": "How do I build a VST plugin on Mac without using Xcode? (I'm using Code::Blocks).\n" }, { "from": "gpt", "value": "Building a VST plugin on Mac without using Xcode is possible, but it requires a good understanding of the VST SDK, C++, and the build process. Since you...
recently I downloaded this open source project and I am trying to compile it. However, one of the line is giving me an error. "import com.sun.org.apache.xpath.internal.functions.WrongNumberArgsException;" Seems that i am missing a library.... is there a way to know WHICH library do I need? I tried searching on google f...
The import statement `import com.sun.org.apache.xpath.internal.functions.WrongNumberArgsException;` indicates that the code you are working with is trying to use an internal class from the Java standard library, specifically from the Apache XPath implementation that is included with the JDK itself. Here are a few poin...
42,048
[ { "from": "human", "value": "recently I downloaded this open source project and I am trying to compile it.\nHowever, one of the line is giving me an error.\n\"import com.sun.org.apache.xpath.internal.functions.WrongNumberArgsException;\"\nSeems that i am missing a library.... is there a way to know WHICH li...
I'm just trying to do simple scripting with F#, and Math.PI seems to have 'disappeared'. I've referenced FSharp.PowerPack.dll, but still can't find it.
In F#, the mathematical constant `Math.PI` is available from the `System` namespace, specifically in the `System.Math` class. If you are scripting in F#, you need to make sure that you reference the appropriate namespaces to access `Math.PI`. Here's a simple example of how you can access `Math.PI` in an F# script: ``...
46,419
[ { "from": "human", "value": "I'm just trying to do simple scripting with F#, and Math.PI seems to have 'disappeared'. I've referenced FSharp.PowerPack.dll, but still can't find it.\n" }, { "from": "gpt", "value": "In F#, the mathematical constant `Math.PI` is available from the `System` namespac...
I want to know where the solution/project is stored on my hard drive. I would have thought right clicking on the project from within Visual Studio would have the information on where it is stored on my hard drive, but it doesn't.
In Visual Studio, if you want to find out where your project is stored on your hard drive, you can follow these steps: 1. **Solution Explorer**: Open the Solution Explorer pane in Visual Studio. If it’s not visible, you can enable it by clicking on `View` in the menu bar and then selecting `Solution Explorer`. 2. **L...
45,649
[ { "from": "human", "value": "I want to know where the solution/project is stored on my hard drive.\nI would have thought right clicking on the project from within Visual Studio would have the information on where it is stored on my hard drive, but it doesn't.\n" }, { "from": "gpt", "value": "In ...
Using logparser you can pass on parameters to the query you'd like to run such as: logparser file:query.sql?logs=somewhere\*.log -o:Sql -server:databaseserver -database:database -createtable:ON -i:IISW3C -iCheckPoint:somewhere\query.lpc -transactionRowCount:200 Now I want to pass a second parameter to the sql q...
Yes, the behavior you're observing with Logparser is due to the way it parses the parameters from the command line. Logparser does not support passing multiple parameters in the manner you've tried (using the `&` character), which leads to it treating the entire string as a single parameter. There are a few workaround...
43,668
[ { "from": "human", "value": "Using logparser you can pass on parameters to the query you'd like to run such as:\nlogparser file:query.sql?logs=somewhere\\*.log -o:Sql -server:databaseserver \n -database:database -createtable:ON -i:IISW3C \n -iCheckPoint:somewhere\\query.lpc -transactionRowCount:200\n\nNo...
How could I setup a nice indice on cap:deploy? I want the remote server to nice the cp commands like so: nice -n 19 cp ...
To set up a Capistrano deployment that uses `nice` to lower the priority of `cp` commands on the remote server, you will need to customize the `deploy.rb` configuration file to wrap the `cp` command with the `nice` command. Here's how you can do it: 1. **Edit your `deploy.rb` file**: You typically find this file in t...
40,749
[ { "from": "human", "value": "How could I setup a nice indice on cap:deploy?\nI want the remote server to nice the cp commands like so: \nnice -n 19 cp ...\n\n" }, { "from": "gpt", "value": "To set up a Capistrano deployment that uses `nice` to lower the priority of `cp` commands on the remote se...
How can I set up GNU screen to allow the mouse's scrollwheel to scroll around in the scrollback buffer? I tried to Google about this, but most hits were on how to allow applications inside screen to use the scrollwheel.
To enable mouse support in `GNU Screen` so that you can use the mouse's scrollwheel to navigate the scrollback buffer, you need to modify your `.screenrc` configuration file. Here’s how to do that: 1. **Open your `.screenrc` file**: If you don’t have one already, create it in your home directory. ```bash nano ~...
43,865
[ { "from": "human", "value": "How can I set up GNU screen to allow the mouse's scrollwheel to scroll around in the scrollback buffer? I tried to Google about this, but most hits were on how to allow applications inside screen to use the scrollwheel.\n" }, { "from": "gpt", "value": "To enable mous...
We have a Silverlight application that needs to load a number of .png files. We can load the images OK, but Silverlight doesn't support reading the pixel data from the Image class. Can anyone suggest a simple solution for getting at this data? Our current best bet would be a third party .png loading library, but we a...
If you're working with a Silverlight application and need to access pixel data from PNG images, you're correct that the built-in `Image` class does not provide direct access to pixel data. Here are a few suggestions on how you might achieve your goal: ### 1. Use a Third-Party Library Since you've already considered th...
41,885
[ { "from": "human", "value": "We have a Silverlight application that needs to load a number of .png files. We can load the images OK, but Silverlight doesn't support reading the pixel data from the Image class.\nCan anyone suggest a simple solution for getting at this data? Our current best bet would be a ...
How do I delete all the emails in my highrise app? I don't want to delete the entire thing and start over, I've got companies and tags and metadata. What's the easiest way? This question paraphrased from Tibor Holoda's question on GetSatisfaction
To delete all emails in your Highrise app without affecting your companies, tags, and metadata, you can follow these steps: 1. **Log in to Highrise**: Access your Highrise account with your credentials. 2. **Navigate to the Emails Section**: Go to the emails section where all your messages are stored. 3. **Select E...
44,377
[ { "from": "human", "value": "How do I delete all the emails in my highrise app? I don't want to delete the entire thing and start over, I've got companies and tags and metadata. What's the easiest way?\nThis question paraphrased from Tibor Holoda's question on GetSatisfaction\n" }, { "from": "gpt", ...
If one has a regular Foo entity and call persist(foo) the @Id is automatically set on the entity. However, if the said Foo entity has a collection of Bars bound to it via (...) @OneToMany(cascade=Cascade.ALL) Set<Bar> getBars() (...) and such instance is already persisted, if one creates a new Bar and add it to the ...
When you use JPA (Java Persistence API) and persist an entity like `Foo`, the `@Id` of that entity is set automatically by the JPA provider. When you have a one-to-many relationship, such as `Foo` having a collection of `Bar` entities, you might face the scenario where after calling `merge(foo)`, the newly created `Bar...
42,309
[ { "from": "human", "value": "If one has a regular Foo entity and call persist(foo) the @Id is automatically set on the entity.\nHowever, if the said Foo entity has a collection of Bars bound to it via \n(...)\n@OneToMany(cascade=Cascade.ALL) \nSet<Bar> getBars()\n(...)\n\nand such instance is already persis...
I'm writing into a log file, but I want to log into a table named "Log" in my database. How can I accomplish this?
To log messages into a database table instead of writing to a file, you will need to establish a connection to your database and perform SQL insert operations to add the log entries to your "Log" table. Below is a general approach that you can follow, depending on the programming language and database you are using. He...
43,899
[ { "from": "human", "value": "I'm writing into a log file, but I want to log into a table named \"Log\" in my database. \nHow can I accomplish this?\n" }, { "from": "gpt", "value": "To log messages into a database table instead of writing to a file, you will need to establish a connection to your...
Which component to use to play mp3 files from streams/files and also to know the lenght in seconds of that mp3 stream?
To play MP3 files from streams or files and also to know the length of the MP3 in seconds, you can use various libraries and components depending on the programming language or platform you are working with. Here are a few suggestions: ### For JavaScript (Web Development) 1. **Howler.js**: A popular audio library that...
41,592
[ { "from": "human", "value": "Which component to use to play mp3 files from streams/files and also to know the lenght in seconds of that mp3 stream?\n" }, { "from": "gpt", "value": "To play MP3 files from streams or files and also to know the length of the MP3 in seconds, you can use various libr...
I need a tool to measure a website's performance that's free and does not require any changes to be made to the code (jsp asp pages). All help is appreciated.
There are several free online tools you can use to measure a website's performance without requiring any changes to the code. Here are some popular options: 1. **Google PageSpeed Insights**: This tool analyzes the content of a web page and provides suggestions to make that page faster. You simply enter the URL of the ...
43,830
[ { "from": "human", "value": "I need a tool to measure a website's performance that's free and does not require any changes to be made to the code (jsp asp pages). All help is appreciated.\n" }, { "from": "gpt", "value": "There are several free online tools you can use to measure a website's perf...
I know that using ls -l "directory/directory/filename" tells me the permissions of a file. How do I do the same on a directory? I could obviously use ls -l on the directory higher in the hierarchy and then just scroll till I find it but it's such a pain. If I use ls -l on the actual directory, it gives the permissions/...
To check the permissions of a directory itself rather than its contents, you can use the `ls -ld` command followed by the path to the directory. The `-d` option tells `ls` to list information about the directory itself instead of its contents. For example, if you want to check the permissions of the directory `direct...
47,894
[ { "from": "human", "value": "I know that using ls -l \"directory/directory/filename\" tells me the permissions of a file. How do I do the same on a directory?\nI could obviously use ls -l on the directory higher in the hierarchy and then just scroll till I find it but it's such a pain. If I use ls -l on the...
When parsing HTML for certain web pages (most notably, any windows live page) I encounter a lot of URL’s in the following format. http\x3a\x2f\x2fjs.wlxrs.com\x2fjt6xQREgnzkhGufPqwcJjg\x2fempty.htm These appear to be partially UTF8 escaped strings (\x2f = /, \x3a=:, etc …). Is there a .Net API that can be used to tran...
In .NET, you can decode these partially escaped strings using a combination of regular expressions and the `Uri` class. While there is no built-in API that directly converts these specific escaped strings to a `System.Uri`, you can achieve this with a simple helper method. Here's a sample method that can decode the st...
44,556
[ { "from": "human", "value": "When parsing HTML for certain web pages (most notably, any windows live page) I encounter a lot of URL’s in the following format.\nhttp\\x3a\\x2f\\x2fjs.wlxrs.com\\x2fjt6xQREgnzkhGufPqwcJjg\\x2fempty.htm\nThese appear to be partially UTF8 escaped strings (\\x2f = /, \\x3a=:, etc...
How can I get data from a database that I can only access through an ODBC Data Source (DSN) in T-SQL MS SQL Server, any version?
To access data from a database via an ODBC Data Source Name (DSN) in T-SQL on MS SQL Server, you can use a feature called **Linked Servers**. This allows you to create a connection to external data sources, including ODBC DSNs, enabling you to execute queries against those sources as if they were part of your SQL Serve...
43,090
[ { "from": "human", "value": "How can I get data from a database that I can only access through an ODBC Data Source (DSN) in T-SQL MS SQL Server, any version?\n" }, { "from": "gpt", "value": "To access data from a database via an ODBC Data Source Name (DSN) in T-SQL on MS SQL Server, you can use ...
Could anyone suggest a good packet sniffer class for c++? Looking for a easy insertable class I can use in my c++ program, nothing complicated.
There are several libraries available for packet sniffing in C++. Here are some recommendations that you can easily integrate into your C++ projects: 1. **PCAP (libpcap on Linux, WinPcap/Npcap on Windows)**: - **Description**: PCAP is a widely used library for capturing network packets. It provides an API for packe...
42,163
[ { "from": "human", "value": "Could anyone suggest a good packet sniffer class for c++? Looking for a easy insertable class I can use in my c++ program, nothing complicated.\n" }, { "from": "gpt", "value": "There are several libraries available for packet sniffing in C++. Here are some recommend...
I want to create a volume slider for my application. I don't mind whether it controls master volume or program volume, but I don't want to use pinvoke if there's an alternative. I'm using C# with .NET 3.5.
Creating a volume slider in a C# application without using P/Invoke to interact with the Windows audio API can be accomplished by using a high-level library that wraps the necessary functionalities. For .NET Framework 3.5, you can use the **NAudio** library, which simplifies audio handling in .NET applications. Here's...
42,084
[ { "from": "human", "value": "I want to create a volume slider for my application. I don't mind whether it controls master volume or program volume, but I don't want to use pinvoke if there's an alternative. I'm using C# with .NET 3.5.\n" }, { "from": "gpt", "value": "Creating a volume slider i...
Why is the Pseudo header prepended to the UDP datagram for the computation of the UDP checksum? What's the rational behind this?
The use of a pseudo header in the computation of the UDP (User Datagram Protocol) checksum serves several important purposes related to ensuring data integrity and facilitating reliable transport of datagrams over IP networks. Here are the key reasons and rationale behind this design choice: 1. **Source and Destinatio...
43,823
[ { "from": "human", "value": "Why is the Pseudo header prepended to the UDP datagram for the computation of the UDP checksum? What's the rational behind this?\n" }, { "from": "gpt", "value": "The use of a pseudo header in the computation of the UDP (User Datagram Protocol) checksum serves several...
I have two models. We'll call them object A and object B. Their design looks something like this: class Foo(models.Model): name = models.CharField() class Bar(models.Model): title = models.CharField() Foo= models.ForeignKey('myapp.Foo') Now, suppose I want to make a method within Foo that returns all B...
In Django, you can use the related manager that Django provides for reverse relationships. When you define a `ForeignKey` in your `Bar` model that points to `Foo`, Django automatically creates a reverse relationship on the `Foo` model. You can access all `Bar` instances related to a particular `Foo` instance using the...
43,000
[ { "from": "human", "value": "I have two models. We'll call them object A and object B. Their design looks something like this:\nclass Foo(models.Model):\n name = models.CharField()\n\nclass Bar(models.Model):\n title = models.CharField()\n Foo= models.ForeignKey('myapp.Foo')\n\nNow, suppose I wa...
When I do this: new SelectList(items, dataValueField, dataTextField, items.First()); I get a SelectList with that item selected (it is inserted as SelectedValue), but not highlighted. What should I do to get a dropdown with a list where I decide in advance what item is selected when the page loads?
To create a dropdown list in ASP.NET MVC with a specific item pre-selected, you'll want to ensure you're passing the correct parameters to the `SelectList` constructor. The `SelectList` constructor you've shown is generally correct, but there are a few things to check: 1. **Ensure that `items.First()` is returning the...
41,667
[ { "from": "human", "value": "When I do this:\nnew SelectList(items, dataValueField, dataTextField, items.First());\n\nI get a SelectList with that item selected (it is inserted as SelectedValue), but not highlighted.\nWhat should I do to get a dropdown with a list where I decide in advance what item is sele...
To lay the groundwork for this question, I'm going to state that I'm getting my definitions for MVC, MVP, and Passive View from the following: Model View Controller (MVC) Model View Presenter (MVP) Passive View (PV) Apple has always stated that it uses the MVC design pattern, but I noticed in OS X 10.5 we've gotten NSV...
You're correct in observing that Apple's approach to application architecture has evolved over the years, particularly with the introduction of concepts like `NSViewController`, Key-Value Observing (KVO), and bindings. While Apple has historically emphasized the Model-View-Controller (MVC) design pattern, the introduct...
42,467
[ { "from": "human", "value": "To lay the groundwork for this question, I'm going to state that I'm getting my definitions for MVC, MVP, and Passive View from the following:\nModel View Controller (MVC)\nModel View Presenter (MVP)\nPassive View (PV)\nApple has always stated that it uses the MVC design pattern...
I am using the date picker provided by jQuery UI to select a date range that ends up in a single text input with something like 11/11/2008 - 12/05/2008. What would you recommend as far a validation (jQuery/JavaScript) on the client side as well as code for validation on the server side (ASP.NET/C#) to make sure the us...
Validating date ranges both on the client side and the server side is important to ensure that the input meets expected formats and logical constraints. Here’s how you could approach validation in both JavaScript/jQuery for client-side and ASP.NET/C# for server-side. ### Client-side Validation (JavaScript/jQuery) 1. ...
42,587
[ { "from": "human", "value": "I am using the date picker provided by jQuery UI to select a date range that ends up in a single text input with something like 11/11/2008 - 12/05/2008. What would you recommend as far a validation (jQuery/JavaScript) on the client side as well as code for validation on the ser...
I want to insert a new row into an Access database. I'm looking at doing something like: oConnection = new Connection("connectionstring") oTable = oCennection.table("Orders") oRow = oTable.NewRow oRow.field("OrderNo")=21 oRow.field("Customer") = "ABC001" oTable.insert Which seems to be a sensible way of doing things ...
In VB.NET, while your pseudo-code reflects a desired object-oriented approach, accessing an Access database typically relies on ADO.NET, which involves the use of SQL commands or `OleDb` data adapters. However, you can achieve similar functionality to your desired approach using ADO.NET. Below is an example of how to i...
42,689
[ { "from": "human", "value": "I want to insert a new row into an Access database. I'm looking at doing something like: \noConnection = new Connection(\"connectionstring\")\noTable = oCennection.table(\"Orders\")\noRow = oTable.NewRow\noRow.field(\"OrderNo\")=21\noRow.field(\"Customer\") = \"ABC001\"\noTable....
While the J2EE module reference feature allows your to create common Java library projects, I can't find a neat way to do this for web content. I have common JSPs, CSS files, JavaScript libraries and even descriptor fragments that I would like to use across a number of Dynamic Web Projects, so that these artefacts are...
Hi Matt, You're right that J2EE (Java EE) doesn't have a built-in mechanism specifically for sharing web content like JSPs, CSS files, or JavaScript across multiple Dynamic Web Projects. However, there are several approaches you can consider to promote reuse of web artifacts: 1. **Shared Library Approach**: - Crea...
42,599
[ { "from": "human", "value": "While the J2EE module reference feature allows your to create common Java library projects, I can't find a neat way to do this for web content.\nI have common JSPs, CSS files, JavaScript libraries and even descriptor fragments that I would like to use across a number of Dynamic...
Python Decimal doesn't support being constructed from float; it expects that you have to convert float to a string first. This is very inconvenient since standard string formatters for float require that you specify number of decimal places rather than significant places. So if you have a number that could have as man...
To convert a float to a `Decimal` while preserving its value as closely as possible without losing precision, you can use the `str()` function instead of formatting with `%.15f`. This way, you avoid the pitfalls of floating-point representation when converting to a string. Here's a function that demonstrates this appr...
42,930
[ { "from": "human", "value": "Python Decimal doesn't support being constructed from float; it expects that you have to convert float to a string first.\nThis is very inconvenient since standard string formatters for float require that you specify number of decimal places rather than significant places. So i...
I need to copy a text from a textbox into the clipboard with ASP.NET. I want a code that is comparable with Mozilla Firefox and IE.
Copying text directly to the clipboard via a server-side language like ASP.NET is not directly possible because clipboard access is a client-side operation that needs JavaScript. You can achieve this by using a combination of JavaScript and ASP.NET. Below is an example of how to copy text from a textbox to the clipboa...
43,739
[ { "from": "human", "value": "I need to copy a text from a textbox into the clipboard with ASP.NET. I want a code that is comparable with Mozilla Firefox and IE.\n" }, { "from": "gpt", "value": "Copying text directly to the clipboard via a server-side language like ASP.NET is not directly possibl...
I'm using Visual Studio 2008 and I want to automate the process of building the installer by running a batch file. The batch file should first sign the assemblies and than start the building of the installer. After the installer is created the batch file should sign the .msi file too. Is this possible?
Yes, you can definitely automate the process of signing assemblies and creating an installer using a batch file in Visual Studio 2008. Below are the general steps you can follow to create your batch file: ### Steps to Create the Batch File: 1. **Sign Assemblies**: Use the `signtool` utility or any signing tool you ar...
42,240
[ { "from": "human", "value": "I'm using Visual Studio 2008 and I want to automate the process of building the installer by running a batch file.\nThe batch file should first sign the assemblies and than start the building of the installer. After the installer is created the batch file should sign the .msi fi...
I want to store a URL prefix in an Windows environment variable. The ampersands in the query string makes this troublesome though. For example: I have a URL prefix of http://example.com?foo=1&bar= and want to create a full URL by providing a value for the bar parameter. I then want to launch that URL using the "start" ...
In a Windows batch file, the `%` syntax is used to access environment variables, and unfortunately, there isn't a direct way to apply the tilde `~` operator to strip quotes from a variable in the same way as you would for command line arguments. However, you can use `set` with string manipulation to achieve your goal....
45,125
[ { "from": "human", "value": "I want to store a URL prefix in an Windows environment variable. The ampersands in the query string makes this troublesome though.\nFor example: I have a URL prefix of http://example.com?foo=1&bar= and want to create a full URL by providing a value for the bar parameter. I then ...
I want to discard all remaining characters in a string as soon as one of several unwanted characters is encountered. As soon as a blacklisted character is encountered, the string before that point should be returned. For instance, if I have an array: $chars = array("a", "b", "c"); How would I go through the following ...
To achieve this in PHP, you can loop through each character of the string and check if it is in your blacklist of characters. As soon as you encounter one of the blacklisted characters, you can return the substring that was built up until that point. Here’s how you can implement this: ```php $chars = array("a", "b",...
44,855
[ { "from": "human", "value": "I want to discard all remaining characters in a string as soon as one of several unwanted characters is encountered.\nAs soon as a blacklisted character is encountered, the string before that point should be returned.\nFor instance, if I have an array:\n$chars = array(\"a\", \"b...
I'm looking for a graphically oriented D&D type tool/utility that can be used to build ad hoc reports from data contained in XML data files. The users are technical, but not developers -- so XSLT is right out... Eclipse' BIRT does this kind of thing, but something more lightweight is preferred.
If you're looking for a more lightweight and user-friendly tool than Eclipse BIRT for generating ad hoc reports from XML data files, here are a few options to consider: 1. **Microsoft Power BI**: - Power BI allows users to connect to XML data files and provides a user-friendly interface for building reports and das...
42,149
[ { "from": "human", "value": "I'm looking for a graphically oriented D&D type tool/utility that can be used to build ad hoc reports from data contained in XML data files. The users are technical, but not developers -- so XSLT is right out...\nEclipse' BIRT does this kind of thing, but something more lightwei...
If I have a Django form such as: class ContactForm(forms.Form): subject = forms.CharField(max_length=100) message = forms.CharField() sender = forms.EmailField() And I call the as_table() method of an instance of this form, Django will render the fields as the same order as specified above. My question is ...
In Django, the order of fields in a form is determined by the order in which the form's attributes (the fields) are defined in the class. When the form class is created, Django collects the fields and stores them in an ordered structure (specifically an `OrderedDict`), which preserves the insertion order. This means th...
43,433
[ { "from": "human", "value": "If I have a Django form such as:\nclass ContactForm(forms.Form):\n subject = forms.CharField(max_length=100)\n message = forms.CharField()\n sender = forms.EmailField()\n\nAnd I call the as_table() method of an instance of this form, Django will render the fields as the...
I'm used to passing around string like this in my C++ applications: void foo(const std::string& input) { std::cout << input.size() << std::endl; } void bar() { foo("stackoverflow"); } Now I have a case where I want the string to be NULL: void baz() { foo("stackoverflow"); foo(NULL); // very bad with foo imple...
When you have a function like `foo` that should handle both strings and null values, there are several approaches to solve the problem without complicating your code unnecessarily. Here are some options: ### 1. Use `std::optional<std::string>` With C++17 and later, you can use `std::optional`, which allows you to rep...
43,684
[ { "from": "human", "value": "I'm used to passing around string like this in my C++ applications:\nvoid foo(const std::string& input)\n{\n std::cout << input.size() << std::endl;\n}\n\nvoid bar()\n{\n foo(\"stackoverflow\");\n}\n\nNow I have a case where I want the string to be NULL:\nvoid baz()\n{\n foo(...
I have a pretty much default installation on mysql on Windows 2003. I am rebuilding some indexes and the process only seems to use 3-20% of the CPU. Is there a way to allow it to use more and speed up the process?
When rebuilding indexes in MySQL, the process may not fully utilize the CPU for several reasons, including the configuration settings of MySQL, the workload on the server, and how MySQL handles resources. Here are several approaches you can take to potentially increase CPU usage and speed up the index rebuilding proces...
40,362
[ { "from": "human", "value": "I have a pretty much default installation on mysql on Windows 2003. I am rebuilding some indexes and the process only seems to use 3-20% of the CPU.\nIs there a way to allow it to use more and speed up the process?\n" }, { "from": "gpt", "value": "When rebuilding ind...
I got a row structure looks like ID bigint, ScanRept XML I want to wind up with a file named 4.xml containing just the xml from the ScanRept column where the ID number is 4. I don't want to do it interactively (by going into Manager Studio, finding the row, right-clicking the field and doing Save AS) - that's what I'll...
You can achieve this by using SQL to query your database and then exporting the XML data to a file using a combination of SQL and C#. Below are the steps to automate this process: ### Step 1: SQL Query to Retrieve the XML First, write a SQL query to retrieve the XML from the `ScanRept` column where `ID` is 4. You can...
38,055
[ { "from": "human", "value": "I got a row structure looks like ID bigint, ScanRept XML\nI want to wind up with a file named 4.xml containing just the xml from the ScanRept column where the ID number is 4.\nI don't want to do it interactively (by going into Manager Studio, finding the row, right-clicking the ...
How do I programmatically reset the Excel Find and Replace dialog box parameters to defaults ("Find what", "Replace with", "Within", "Search", "Look in", "Match case", "Match entire cell contents")? I am using Application.FindFormat.Clear and Application.ReplaceFormat.Clear to reset find and replace cell formats. Inter...
To programmatically reset the parameters in the Excel Find and Replace dialog box to their default values using VBA, you can follow these steps. Although Excel does not provide a direct method to reset the dialog box, you can manually clear or reset the values in your code. Here’s how you can clear the parameters for ...
41,801
[ { "from": "human", "value": "How do I programmatically reset the Excel Find and Replace dialog box parameters to defaults (\"Find what\", \"Replace with\", \"Within\", \"Search\", \"Look in\", \"Match case\", \"Match entire cell contents\")?\nI am using Application.FindFormat.Clear and Application.ReplaceFo...
I'm using VS2008 Team Suite, ASP.NET MVC Beta, with TestDriven.Net installed. When I created my project from the template, it created a "Tests" project as well and put some controller tests for the AccountController in a folder inside this project. I've added other controllers and associated tests. Howerver, when I r...
It seems like you're experiencing a specific issue related to how TestDriven.Net interacts with folder structures in your test project. This behavior may be linked to how the tool resolves paths when creating new test stubs. Here are a few potential solutions and troubleshooting steps you can try: 1. **Check TestDrive...
43,263
[ { "from": "human", "value": "I'm using VS2008 Team Suite, ASP.NET MVC Beta, with TestDriven.Net installed. When I created my project from the template, it created a \"Tests\" project as well and put some controller tests for the AccountController in a folder inside this project. I've added other controlle...
I redirect the user to the login page when user click log out however I don't think it clears any application or session because all the data persisted when the user logs back in. Currently the login page has a login control and the code behind on the page is only wired up the login Authenticate. Can someone direct me ...
When dealing with user authentication in an ASP.NET web application, it's important to ensure that you correctly manage sessions and authentication tokens. To properly log out a user, you should invalidate their session and any authentication tokens, so that when they log back in, their previous session data is not ret...
42,001
[ { "from": "human", "value": "I redirect the user to the login page when user click log out however I don't think it clears any application or session because all the data persisted when the user logs back in.\nCurrently the login page has a login control and the code behind on the page is only wired up the ...
I've had this problem before and found that basically I've got a connection that I'm not closing quickly enough (leaving connections open and waiting for garbage collection isn't really a best practice). Now I'm getting it again but I can't seem to find where I'm leaving my connections open. By the time is see the erro...
Tracking down open database connections can indeed be challenging, especially when the connections are cleared by the database before you can diagnose the issue. Here are some strategies you can use to instrument your code and database to help identify the source of the problem: ### 1. Code Review and Best Practices B...
41,491
[ { "from": "human", "value": "I've had this problem before and found that basically I've got a connection that I'm not closing quickly enough (leaving connections open and waiting for garbage collection isn't really a best practice).\nNow I'm getting it again but I can't seem to find where I'm leaving my con...
I'm revisiting som old code of mine and have stumbled upon a method for getting the title of a website based on its url. It's not really what you would call a stable method as it often fails to produce a result and sometimes even produces incorrect results. Also, sometimes it fails to show some of the characters from t...
Your method for fetching a website's title can indeed be improved in several ways. Here are some suggestions to enhance stability, performance, and encoding handling: 1. **Use HttpClient**: The `HttpClient` class is preferred over `WebRequest` and `WebResponse`. It provides a simpler and more flexible API for making H...
41,884
[ { "from": "human", "value": "I'm revisiting som old code of mine and have stumbled upon a method for getting the title of a website based on its url. It's not really what you would call a stable method as it often fails to produce a result and sometimes even produces incorrect results. Also, sometimes it fa...
I have a bunch of controls (textbox and combobox) on a form with toolstripcontainer and toolstripbuttons for save, cancel etc for edits. We are using .Net 3.5 SP1 There is bunch of logic written in control.lostfocus and control.leave events. These events are not being called when clicked on the toolstrip buttons. Is ...
It looks like you found a solution to your problem, which is great! For those who might encounter a similar issue, here's a quick recap and additional context on the solution you found: ### Issue In your Windows Forms application, you had textboxes and comboboxes with logic in their `Leave` and `LostFocus` events. Whe...
41,684
[ { "from": "human", "value": "I have a bunch of controls (textbox and combobox) on a form with toolstripcontainer and toolstripbuttons for save, cancel etc for edits. We are using .Net 3.5 SP1\n There is bunch of logic written in control.lostfocus and control.leave events. These events are not being called ...
P1 and P2 are processes or nodes in a cluster. f1 and f2 are their flags. Supposing strong memory model, and that both processes may be restarted at any moment, and that restarting a process clears it's flag, here's an algorithm that I came up with and couldn't yet break, but that bothers me for it's not theoretically...
Your algorithm is an interesting attempt to solve the mutual exclusion problem, and you've outlined some key characteristics. Let's analyze it step by step to see if it holds up to scrutiny under a strong memory model, which means operations appear to execute in a totally ordered manner (suitable for reasoning about ra...
41,638
[ { "from": "human", "value": "P1 and P2 are processes or nodes in a cluster. f1 and f2 are their flags. Supposing strong memory model, and that both processes may be restarted at any moment, and that restarting a process clears it's flag, here's an algorithm that I came up with and couldn't yet break, but t...
I'm a pretty experienced Grails developer, but most of my experience has been with using grails for serving up JSON/XML to a flex app and some relatively simple HTML websites. I've been diving deeper into using the sitemesh integration in grails and I'm struggling a little to find best practices for some more complex c...
It sounds like you're diving deep into Grails and Sitemesh, and I understand that some of the documentation can be a bit sparse, especially regarding advanced use cases. Let’s break down your questions and provide some examples and explanations to help clarify these concepts. ### 1. `g:applyLayout` The `g:applyLayout...
40,693
[ { "from": "human", "value": "I'm a pretty experienced Grails developer, but most of my experience has been with using grails for serving up JSON/XML to a flex app and some relatively simple HTML websites.\nI've been diving deeper into using the sitemesh integration in grails and I'm struggling a little to f...
I need to achieve the following when opening an HTML in Excel (Response.contentType="application/vnd.ms-excel") : force Excel to consider content of td cells as numbers make the above so that any subsequent user-entered formulas work on these cells (when the spreadsheet is opened) So far I was successful with adding ...
To achieve your goal of forcing Excel to interpret the content of `<td>` cells as numbers while ensuring that any subsequent user-entered formulas work on those cells, you'll need to ensure that the content is presented correctly in a way that Excel recognizes as numeric values. ### Suggested Approach 1. **Use Correc...
43,291
[ { "from": "human", "value": "I need to achieve the following when opening an HTML in Excel (Response.contentType=\"application/vnd.ms-excel\") :\n\nforce Excel to consider content of td cells as numbers\nmake the above so that any subsequent user-entered formulas work on these cells (when the spreadsheet is...
Do you know any documentation about the rules of using update sites? I have managed the last 2 and a half years the update site of our company, and these are the problems I have to address: Not all projects use the same eclipse version. We had projects that used eclipse 2.1 (WSAD), eclipse 3.0 (RAD 6), eclipse 3.2 (RA...
Managing update sites for Eclipse plugins across multiple Eclipse versions can indeed be challenging. Here are some guidelines and strategies for effectively organizing your update sites and minimizing maintenance work: ### 1. **Determine the Number of Update Sites** The number of update sites you should use largely ...
42,412
[ { "from": "human", "value": "Do you know any documentation about the rules of using update sites? I have managed the last 2 and a half years the update site of our company, and these are the problems I have to address:\n\nNot all projects use the same eclipse version. We had projects that used eclipse 2.1 (...
We use COM objects to access excel spreadsheets in an NT service (via the Windows Scripting Host). Prior to Vista, this worked beautifully, but starting with Vista, we receive this error: Microsoft Office Excel cannot access the file 'c:\myfiles\test.xls'. There are several possible reasons: The file name or path doe...
It appears that you're encountering a common issue related to the way that services interact with the desktop and user sessions starting with Windows Vista. This is primarily due to the increased security model in Windows Vista and later, where services run in a different session than the user's interactive desktop. H...
43,834
[ { "from": "human", "value": "We use COM objects to access excel spreadsheets in an NT service (via the Windows Scripting Host). Prior to Vista, this worked beautifully, but starting with Vista, we receive this error:\nMicrosoft Office Excel cannot access the file 'c:\\myfiles\\test.xls'. There are several ...
In the below link, Linq-To-Sql produces a range of methods to get data back based on various real-world needs (e.g. recent topics, etc). How can I get Subsonic to produce me a set of classes which would interrogate and return data back from my data source in such a way? I get classes which really just present CRUD ops....
SubSonic is a lightweight ORM (Object-Relational Mapping) tool for .NET that allows you to work with databases more easily. By default, SubSonic generates classes that primarily provide basic CRUD (Create, Read, Update, Delete) operations. However, you can extend these generated classes to add custom queries and method...
43,681
[ { "from": "human", "value": "In the below link, Linq-To-Sql produces a range of methods to get data back based on various real-world needs (e.g. recent topics, etc).\nHow can I get Subsonic to produce me a set of classes which would interrogate and return data back from my data source in such a way? I get c...
I need a RegExp which matches a word or multiple words in quotes. [\w]* matches a word "[\w\W&&[^"]]*" matches multiple words in quotes. (btw, not sure why \w\W works, but not a simple . (which should match all characters) So how do i combine these two regexp?
To create a single regular expression that matches both a single word and multiple words within quotes, we can use an alternation (the `|` operator) to combine the two patterns. Here's how you can do it: ```regex \b\w+\b|"[^"]*" ``` ### Explanation: - `\b\w+\b`: - `\b`: Word boundary, ensures we match whole words...
44,189
[ { "from": "human", "value": "I need a RegExp which matches a word or multiple words in quotes.\n[\\w]* matches a word\n\"[\\w\\W&&[^\"]]*\" matches multiple words in quotes.\n(btw, not sure why \\w\\W works, but not a simple . (which should match all characters)\nSo how do i combine these two regexp?\n" }...
I have this form: <form name="customize"> Only show results within <select name="distance" id="slct_distance"> <option>25</option> <option>50</option> <option>100</option> <option value="10000" selected="selected">Any</option> </select> miles of zip code ...
To select both the `<select>` element and the `<input>` element within the specific form using a single jQuery selector, you can use a comma to separate the two selectors within the same form. However, the way you've written it is almost correct; you just need to adjust the syntax slightly. Here’s how you can do it: ...
46,358
[ { "from": "human", "value": "I have this form:\n<form name=\"customize\">\n Only show results within \n <select name=\"distance\" id=\"slct_distance\">\n <option>25</option>\n <option>50</option>\n <option>100</option>\n <option value=\"10000\" selected=...
Does anyone have problem getting files from starteam using the cruise control tool for setting up automatic build job?? The script seems to run fine but fail after some time with the error message Error occurred: Unable to read data from the network: the connection to the StarTeam server has been lost. I am not sure w...
It sounds like you're experiencing connectivity issues between CruiseControl and your StarTeam server, particularly related to the automatic disconnection due to inactivity. Here are several steps you can take to troubleshoot and potentially resolve the issue: ### 1. **Check StarTeam Server Settings:** - Verify the...
40,468
[ { "from": "human", "value": "Does anyone have problem getting files from starteam using the cruise control tool for setting up automatic build job??\nThe script seems to run fine but fail after some time with the error message \nError occurred:\nUnable to read data from the network: the connection to the St...
Is it ever OK to use Environment.TickCount to calculate time spans? int start = Environment.TickCount; // Do stuff int duration = Environment.TickCount - start; Console.WriteLine("That took " + duration " ms"); Because TickCount is signed and will rollover after 25 days (it takes 50 days to hit all 32 bits, but you ha...
Using `Environment.TickCount` for measuring elapsed time can be risky due to the potential rollover issue, as you've identified. The `Environment.TickCount` property returns the number of milliseconds since the system started, but it is a signed 32-bit integer. This means that after approximately 24.9 days (2^31 millis...
41,727
[ { "from": "human", "value": "Is it ever OK to use Environment.TickCount to calculate time spans?\nint start = Environment.TickCount;\n// Do stuff\nint duration = Environment.TickCount - start;\nConsole.WriteLine(\"That took \" + duration \" ms\");\n\nBecause TickCount is signed and will rollover after 25 da...
Basically I am trying to retrieve a list of stored procedure parameters using Linq to SQL? Is there a way to do this?
In LINQ to SQL, you typically work with tables and their columns rather than stored procedures directly. However, if you want to retrieve the parameters of a stored procedure from a SQL Server database, you will need to execute a SQL query against the `INFORMATION_SCHEMA.PARAMETERS` or the `sys.parameters` system catal...
41,710
[ { "from": "human", "value": "Basically I am trying to retrieve a list of stored procedure parameters using Linq to SQL? Is there a way to do this?\n" }, { "from": "gpt", "value": "In LINQ to SQL, you typically work with tables and their columns rather than stored procedures directly. However, i...
Ok this is more of a computer science question, than a question based on a particular language, but is there a difference between a map operation and a foreach operation? Or are they simply different names for the same thing?
Yes, there is a difference between a **map** operation and a **forEach** operation, and they serve different purposes, even though they might seem similar at first glance. ### Map Operation - **Purpose**: The `map` function is used to transform each element of a collection (like an array or list) into a new collectio...
43,641
[ { "from": "human", "value": "Ok this is more of a computer science question, than a question based on a particular language, but is there a difference between a map operation and a foreach operation? Or are they simply different names for the same thing?\n" }, { "from": "gpt", "value": "Yes, the...
I am using an open source client to programmatically process incoming emails (on Windows 2003). The only way to prevent receiving previously read emails is to delete them from the server. This is less than ideal. As far as I know, there is no command in Pop3 to set emails as being read. So how do you go about this?
You're correct that POP3 does not provide a mechanism for marking emails as read; it is primarily designed for downloading emails from a server to a local client, and it typically does not maintain the state of emails on the server after they've been downloaded. Here are a few alternatives you can consider for handlin...
42,804
[ { "from": "human", "value": "I am using an open source client to programmatically process incoming emails (on Windows 2003). The only way to prevent receiving previously read emails is to delete them from the server. This is less than ideal. As far as I know, there is no command in Pop3 to set emails as bei...
When moving my .Net Compact Framework application to the SD-card of a Windows CE device, the program executes slower then running it from the internal memory. I thought, the start-up might be slower, but it is the whole program. There is no IO to the storage card. Why is my application so slow and how does the compact ...
Running a .NET Compact Framework application from an SD card instead of internal memory on a Windows CE device can lead to performance issues for several reasons. Here are some factors to consider: 1. **SD Card Speed**: Not all SD cards are created equal in terms of speed. If the SD card has a lower read/write speed c...
42,636
[ { "from": "human", "value": "When moving my .Net Compact Framework application to the SD-card of a Windows CE device, the program executes slower then running it from the internal memory.\nI thought, the start-up might be slower, but it is the whole program. There is no IO to the storage card.\nWhy is my ap...
I was trying to write code that would auto-close a Toplevel Tk window in Python. I ended up getting it to work, but ran into a little problem along the way that I wasn't able to figure out. The second two buttons work, but the first one doesn't and I don't understand why... Any ideas? from Tkinter import * root = Tk()...
The issue you're facing with the first button is due to how you're specifying the command for that button. When you use `command=lambda: TL.destroy`, you need to call the `destroy()` method by actually including parentheses after it. Without the parentheses, you are simply passing a reference to the `destroy` method, i...
46,064
[ { "from": "human", "value": "I was trying to write code that would auto-close a Toplevel Tk window in Python.\nI ended up getting it to work, but ran into a little problem along the way that I wasn't able to figure out.\nThe second two buttons work, but the first one doesn't and I don't understand why...\nA...
Edit: This behaviour is reproducible with query globals on. I have the following: $_SESSION['query_key'] = $_GET['query_key']; print($query_key); Vs. $_SESSION['query_key'] = clone $_GET['query_key']; print($query_key); The former prints out the value of $query_key, while the latter prints nothing. What sort ...
The behavior you're observing has to do with how `clone` works in PHP and the way variables are assigned and referenced. Let's break down your code and the behavior you see: 1. **First Example**: ```php $_SESSION['query_key'] = $_GET['query_key']; print($query_key); ``` Here, you're assigning the va...
44,097
[ { "from": "human", "value": "Edit: This behaviour is reproducible with query globals on.\nI have the following:\n $_SESSION['query_key'] = $_GET['query_key'];\n print($query_key);\n\nVs.\n $_SESSION['query_key'] = clone $_GET['query_key'];\n print($query_key);\n\nThe former prints out the value of $quer...
I'm trying to find out the last time a computer came out of standby/hibernate. I know I could get this by watching Win32_PowerManagementEvent, but that doesn't work in this instance as I need something I can poll - any ideas? It doesn't have to be WMI, I'm just assuming that's the place it would be. Thanks!
To determine the last time a computer came out of standby or hibernate, you can check the system's event logs rather than relying solely on WMI, which may not provide the polling capability you need. On Windows, you can use the Event Viewer to check specific events related to power state changes. The events related to...
44,555
[ { "from": "human", "value": "I'm trying to find out the last time a computer came out of standby/hibernate. I know I could get this by watching Win32_PowerManagementEvent, but that doesn't work in this instance as I need something I can poll - any ideas? It doesn't have to be WMI, I'm just assuming that's t...
I have a web directory where I store some config files. I'd like to use wget to pull those files down and maintain their current structure. For instance, the remote directory looks like: http://mysite.com/configs/.vim/ .vim holds multiple files and directories. I want to replicate that on the client using wget. Can't ...
To use `wget` to download a directory and maintain its structure, you can use the `-r` (recursive) option along with `-np` (no parent) to prevent wget from downloading files from parent directories. You might also want to use `-nH` (no host directories) and `--cut-dirs` to avoid creating extra directory levels that mig...
44,576
[ { "from": "human", "value": "I have a web directory where I store some config files. I'd like to use wget to pull those files down and maintain their current structure. For instance, the remote directory looks like:\nhttp://mysite.com/configs/.vim/\n\n.vim holds multiple files and directories. I want to rep...
Just trying to make the enter key pressed after a time delay in vb6, all the examples I find don't seem to be working, any help? Just trying to simulate a keystroke. Focus doesn't matter.
To simulate a keystroke in VB6, you can use the `keybd_event` API function, which allows you to generate keyboard input. If you want to simulate pressing the Enter key after a time delay, you can use the `Sleep` function to create the delay. Below is a simple example of how to do this. 1. First, you need to declare th...
44,312
[ { "from": "human", "value": "Just trying to make the enter key pressed after a time delay in vb6, all the examples I find don't seem to be working, any help?\nJust trying to simulate a keystroke. Focus doesn't matter.\n" }, { "from": "gpt", "value": "To simulate a keystroke in VB6, you can use ...
When you are considering an upgrade in a development tool, how important is backwards-compatibility to you? Would you still purchase Visual Studio 2010 if it required significant changes to your source code? Where is the tipping point for you in terms of trading backwards compatibility for new features?
Backwards compatibility is a crucial factor when considering an upgrade in a development tool, as it can significantly impact the efficiency of the development process. If an upgrade requires significant changes to existing source code, it can lead to substantial costs in terms of time and resources, as well as potenti...
39,962
[ { "from": "human", "value": "When you are considering an upgrade in a development tool, how important is backwards-compatibility to you? Would you still purchase Visual Studio 2010 if it required significant changes to your source code? Where is the tipping point for you in terms of trading backwards comp...
Is there anything in Clojure that is equivalent to Common Lisp's symbol-name function?
In Clojure, the equivalent of Common Lisp's `symbol-name` function, which returns the name of a symbol as a string, can be achieved using the `name` function. Here's how you can use it: ```clojure (def my-symbol 'example) (name my-symbol) ; => "example" ``` In this example, `name` retrieves the name of the symbol ...
48,181
[ { "from": "human", "value": "Is there anything in Clojure that is equivalent to Common Lisp's\nsymbol-name function?\n" }, { "from": "gpt", "value": "In Clojure, the equivalent of Common Lisp's `symbol-name` function, which returns the name of a symbol as a string, can be achieved using the `nam...
I am a bit of an ant newbie, and I'm having trouble making a jar correctly. As an example, say I want to make a jar with my StringUtil class. Using the following ant directive, I can create the jar, but the problem is that the directory structure is lost. It simply puts StringUtil.class in the base directory of the jar...
To ensure that the directory structure is preserved when creating your JAR file with Ant, you need to use a `<fileset>` that includes the entire directory structure rather than just a single file. You can specify the base directory from which the paths are relative. Here’s how you can modify your Ant directive to incl...
45,007
[ { "from": "human", "value": "I am a bit of an ant newbie, and I'm having trouble making a jar correctly. As an example, say I want to make a jar with my StringUtil class. Using the following ant directive, I can create the jar, but the problem is that the directory structure is lost. It simply puts StringUt...
OpenId is open source and can be implemented by anyone. In both cases my credentials are held on a third party server. The only advantage I can think of for using Microsoft Passport is the reliability of Microsoft.
You’re right in noting that both OpenID and Microsoft Passport (now known as Microsoft Account) involve the use of third-party servers for authentication. Here are some additional considerations when comparing OpenID and Microsoft Account: ### OpenID **Advantages:** 1. **Decentralization**: OpenID allows users to choo...
42,519
[ { "from": "human", "value": "\nOpenId is open source and can be\nimplemented by anyone. \nIn both cases my credentials are\nheld on a third party server.\nThe only advantage I can think of\nfor using Microsoft Passport is the\nreliability of Microsoft.\n\n" }, { "from": "gpt", "value": "You’re r...
I looked at SQL Server dateformat codes but I couldn't find dd.mm.yyyy hh:mm format in the list. German Date Format(Code is 4) works for me but it doesn't contain hh:mm. Does someone know this format's code?
In SQL Server, while there isn't a built-in format code that directly formats dates as `dd.mm.yyyy hh:mm`, you can achieve this by using the `FORMAT` function or by combining date formatting functions. Here’s how you can format a date in SQL Server to achieve the desired format: ### Using the FORMAT function (SQL Ser...
44,582
[ { "from": "human", "value": "I looked at SQL Server dateformat codes but I couldn't find dd.mm.yyyy hh:mm format in the list. German Date Format(Code is 4) works for me but it doesn't contain hh:mm. Does someone know this format's code?\n" }, { "from": "gpt", "value": "In SQL Server, while ther...
I'm building a python application from some source code I've found Here I've managed to compile and fix some problems by searching the web, but I'm stuck at this point: When running the application this message appears. alt text http://img511.imageshack.us/img511/4481/loadfr0.png This python app, usues swig to link to ...
The error message you are encountering indicates that there is a problem with loading a DLL, specifically related to `msvcr80.dll`. The steps you've taken so far to resolve the issue suggest you've put in considerable effort, but there may be some additional things to check. Here are several suggestions you can consid...
40,701
[ { "from": "human", "value": "I'm building a python application from some source code I've found Here\nI've managed to compile and fix some problems by searching the web, but I'm stuck at this point:\nWhen running the application this message appears.\nalt text http://img511.imageshack.us/img511/4481/loadfr0...
Does anyone have settings for Visual Studio, in XML or a .vssettings-file, that is compatible with StyleCop? I've used the book Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries for guidance on what Microsoft finds to be the correct way to format C# and set my Visual Studio-sett...
Configuring Visual Studio settings to be compatible with StyleCop can be a bit challenging, as StyleCop has its own set of rules and conventions that may not align perfectly with the default formatting settings in Visual Studio. However, you can adjust your Visual Studio formatting settings to minimize conflicts with S...
42,413
[ { "from": "human", "value": "Does anyone have settings for Visual Studio, in XML or a .vssettings-file, that is compatible with StyleCop?\nI've used the book Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries for guidance on what Microsoft finds to be the correct way ...
I'm trying to find a good way to detect a loss of connection. My adapter is implemented as a Fix::Application based on one of the examples. It uses a socket initiator to connect to the fix gateway. When I unplug the internet it takes about 30 seconds for the Fix::Application's onLogout method to be fired. It seems li...
Detecting a loss of connection in a FIX application implemented with the QuickFIX library can be somewhat delayed due to the underlying TCP socket behavior. When you unplug the internet, the TCP layer may not immediately recognize the connection loss, which can cause the delay you're observing before the `onLogout` met...
40,907
[ { "from": "human", "value": "I'm trying to find a good way to detect a loss of connection. \nMy adapter is implemented as a Fix::Application based on one of the examples. It uses a socket initiator to connect to the fix gateway. \nWhen I unplug the internet it takes about 30 seconds for the Fix::Application...
I have somewhat of a staging server on the public internet running copies of the production code for a few websites. I'd really not like it if the staging sites get indexed. Is there a way I can modify my httpd.conf on the staging server to block search engine crawlers? Changing the robots.txt wouldn't really work ...
To prevent search engine crawlers from indexing your staging server, you can add specific configurations to your `httpd.conf` file that apply globally to all sites on the server. Here are a couple of methods you can use: ### 1. Block Crawlers with HTTP Headers You can add the `X-Robots-Tag` HTTP header to your config...
41,645
[ { "from": "human", "value": "I have somewhat of a staging server on the public internet running copies of the production code for a few websites. I'd really not like it if the staging sites get indexed. \nIs there a way I can modify my httpd.conf on the staging server to block search engine crawlers? \nCh...
How do I create a Web Application Project in VS 2008? How is it different from a "WebSite" project?
Creating a Web Application Project in Visual Studio 2008 involves several steps. Here's a detailed guide on how to do that, along with an explanation of the differences between a Web Application Project and a Website project. ### Creating a Web Application Project in Visual Studio 2008 1. **Open Visual Studio 2008**:...
39,069
[ { "from": "human", "value": "How do I create a Web Application Project in VS 2008? How is it different from a \"WebSite\" project?\n" }, { "from": "gpt", "value": "Creating a Web Application Project in Visual Studio 2008 involves several steps. Here's a detailed guide on how to do that, along wi...