instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Does anyone know of a whirlwind tour of Eclipse that would help a (former) Visual Studio user get up to speed with it? I just want something that tells me where all the basic features are and what all the cool stuff I've heard so much about is? So far I've been using it mostly as a text editor and have had some luck co...
Transitioning from Visual Studio to Eclipse can indeed be challenging due to the differences in interface and functionality. Here’s a whirlwind guide to help you get up to speed with Eclipse, along with some tips on configuration, plugins, and debugging. ### Overview of Eclipse Eclipse is an Integrated Development Env...
20,895
[ { "from": "human", "value": "Does anyone know of a whirlwind tour of Eclipse that would help a (former) Visual Studio user get up to speed with it?\nI just want something that tells me where all the basic features are and what all the cool stuff I've heard so much about is?\nSo far I've been using it mostly...
I need to update data to a mssql 2005 database so I have decided to use adodbapi, which is supposed to come built into the standard installation of python 2.1.1 and greater. It needs pywin32 to work correctly and the open office python 2.3 installation does not have pywin32 built into it. It also seems like this built ...
Using Jython is a great alternative when you're working with OpenOffice and need database access, especially if you're facing difficulties with the standard Python installation. However, if you decide to continue with Python and want to use `pywin32` and `adodbapi` with your OpenOffice Python environment, here are some...
26,848
[ { "from": "human", "value": "I need to update data to a mssql 2005 database so I have decided to use adodbapi, which is supposed to come built into the standard installation of python 2.1.1 and greater.\nIt needs pywin32 to work correctly and the open office python 2.3 installation does not have pywin32 bui...
How can I change the color of a DataGridView border when BorderStyle = FixedSingle?
In a WinForms application, if you want to change the color of a `DataGridView` border when its `BorderStyle` is set to `FixedSingle`, you will need to customize the painting of the control because the default border is not directly changeable through properties. You can achieve this by handling the `Paint` event of the...
25,714
[ { "from": "human", "value": "How can I change the color of a DataGridView border when BorderStyle = FixedSingle?\n" }, { "from": "gpt", "value": "In a WinForms application, if you want to change the color of a `DataGridView` border when its `BorderStyle` is set to `FixedSingle`, you will need to...
What's the best way for constructing headers, and footers? Should you call it all from the controller, or include it from the view file? I'm using CodeIgniter, and I'm wanting to know what's the best practice for this. Loading all the included view files from the controller, like this? class Page extends Controller { ...
When it comes to constructing headers and footers in CodeIgniter, both approaches you mentioned have their merits, but it's generally considered best practice to keep your controllers lean and your views organized. Let's break down the pros and cons of each method to help you decide which one to adopt. ### Option 1: L...
22,055
[ { "from": "human", "value": "What's the best way for constructing headers, and footers? Should you call it all from the controller, or include it from the view file? I'm using CodeIgniter, and I'm wanting to know what's the best practice for this. Loading all the included view files from the controller, li...
What is the right way to populate the model for the index page in a grails app? There is no IndexController by default, is there some other mechanism for getting lists of this and that into the model?
In a Grails application, the approach to populating the model for the index page can depend on the structure of your application and how you want to manage your controllers and views. 1. **Default Behavior**: In Grails, the default entry point for your application is usually the `index.gsp` page, which is found in the...
25,099
[ { "from": "human", "value": "What is the right way to populate the model for the index page in a grails app? There is no IndexController by default, is there some other mechanism for getting lists of this and that into the model?\n" }, { "from": "gpt", "value": "In a Grails application, the appr...
I am working through a book which gives examples of Ranges being converted to equivalent arrays using their "to_a" methods When i run the code in irb I get the following warning warning: default `to_a' will be obsolete What is the the correct alternative to using to_a? are there alternate ways to populate an array wi...
The warning you are seeing indicates that the default `to_a` method will be obsolete in future versions of Ruby. This is a sign that it's better to use the more explicit way of converting ranges to arrays. In Ruby, you can convert a range to an array in several ways without using the `to_a` method: 1. **Using `Array[...
21,530
[ { "from": "human", "value": "I am working through a book which gives examples of Ranges being converted to equivalent arrays using their \"to_a\" methods\nWhen i run the code in irb I get the following warning\n warning: default `to_a' will be obsolete\n\nWhat is the the correct alternative to using to_a?\n...
We have a scenario where we want to display a list of items and indicate which is the "current" item (with a little arrow marker or a changed background colour). ItemsControl is no good to us, because we need the context of "SelectedItem". However, we want to move the selection programattically and not allow the user t...
In WPF, achieving the functionality you're describing can be a bit tricky since you want a list of items that visually indicates the current selection while preventing user interaction. While there is no straightforward built-in property to make a `ListBox` non-interactive but still visually active, you have a couple o...
23,308
[ { "from": "human", "value": "We have a scenario where we want to display a list of items and indicate which is the \"current\" item (with a little arrow marker or a changed background colour).\nItemsControl is no good to us, because we need the context of \"SelectedItem\". However, we want to move the selec...
We have a project coming up where the PM is insistent that the team should "eat their own dog food"? At what point is it realistic to do this? e.g. assume we have to write an editor. We can't use this editor at the beginning to actually code because it doesn't exist. We have to use another editor. For a while during th...
"Eat your own dog food" (also known as "dogfooding") refers to the practice of using your own products to demonstrate their value and identify potential issues. It’s a great approach for building confidence in your product, but you're correct that it requires careful planning, especially for new software tools like an ...
26,022
[ { "from": "human", "value": "We have a project coming up where the PM is insistent that the team should \"eat their own dog food\"?\nAt what point is it realistic to do this?\ne.g. assume we have to write an editor. We can't use this editor at the beginning to actually code because it doesn't exist. We have...
I need to write a browser interface for an application running embedded on a single board computer (Gumstix Verdex for anyone who's interested), so I won't be able to use any web frameworks due to space and processor constraints (and availability for the environment I'm running in). I'm limited to the core Python and ...
Creating a browser interface using CGI in Python is a solid choice given your constraints. Here are some recommended resources that will help you understand CGI programming in Python, including books and online resources: ### Books 1. **"Python Web Programming" by Steve Holden, et al.** - This book covers various ...
23,533
[ { "from": "human", "value": "I need to write a browser interface for an application running embedded on a single board computer (Gumstix Verdex for anyone who's interested), so I won't be able to use any web frameworks due to space and processor constraints (and availability for the environment I'm running ...
I've been researching memory mapped files for a project and would appreciate any thoughts from people who have either used them before, or decided against using them, and why? In particular, I am concerned about the following, in order of importance: concurrency random access performance ease of use portability
Memory-mapped files can be a powerful tool for certain applications, and it's great that you're considering various aspects before deciding whether to use them in your project. Here’s a breakdown of the factors you mentioned based on common experiences and considerations from those who have worked with memory-mapped fi...
22,908
[ { "from": "human", "value": "I've been researching memory mapped files for a project and would appreciate any thoughts from people who have either used them before, or decided against using them, and why?\nIn particular, I am concerned about the following, in order of importance:\n\nconcurrency\nrandom acce...
Does MSTest have standalone GUI similar to nUnit that lets me use it and run test without visual studio? What is the official site for MSTest where I can learn more about how to use it?
MSTest itself does not have a standalone GUI like NUnit does. MSTest is primarily designed to be integrated into the Visual Studio IDE and run tests within that environment. However, you can run MSTest from the command line using the `vstest.console.exe` tool, which allows you to execute tests without needing to open V...
28,043
[ { "from": "human", "value": "Does MSTest have standalone GUI similar to nUnit that lets me use it and run test without visual studio? What is the official site for MSTest where I can learn more about how to use it?\n" }, { "from": "gpt", "value": "MSTest itself does not have a standalone GUI lik...
I have some thread-related questions, assuming the following code. Please ignore the possible inefficiency of the code, I'm only interested in the thread part. //code without thread use public static int getNextPrime(int from) { int nextPrime = from+1; boolean superPrime = false; while(!superPrime) { ...
Your questions touch on some important concepts in multithreading and how they behave in Java. Let's break this down step by step: ### Understanding Your Code 1. **Original Code**: Your original code to find the next prime number runs sequentially. The `getNextPrime` method checks each number one by one to determine ...
25,635
[ { "from": "human", "value": "I have some thread-related questions, assuming the following code. Please ignore the possible inefficiency of the code, I'm only interested in the thread part.\n//code without thread use\npublic static int getNextPrime(int from) {\n int nextPrime = from+1;\n boolean super...
I'm sure this one is easy but I've tried a ton of variations and still cant match what I need. The thing is being too greedy and I cant get it to stop being greedy. Given the text: test=this=that=more text follows I want to just select: test= I've tried the following regex (\S+)=(\S.*) (\S+)?= [^=]{1} ... Thanks al...
To match only `test=` from the given text `test=this=that=more text follows`, you can use a regex pattern that specifically captures the desired part. Here's a regex that should work for your requirement: ```regex ^(test)= ``` ### Explanation: - `^`: Asserts the position at the start of the line. - `(test)`: Matches ...
22,545
[ { "from": "human", "value": "I'm sure this one is easy but I've tried a ton of variations and still cant match what I need. The thing is being too greedy and I cant get it to stop being greedy.\nGiven the text:\ntest=this=that=more text follows\n\nI want to just select:\ntest=\n\nI've tried the following r...
YAML seems like a great format for configuration files & data binding persistent objects in human-readable form... Is there a C++ library that handles YAML? Does Boost::Serialization have plans for a YAML option? EDIT: I would prefer an OO library.
Yes, there are several C++ libraries available for handling YAML, with `yaml-cpp` being one of the most popular ones. Here's a brief overview of `yaml-cpp` and its capabilities: ### yaml-cpp - **Description**: `yaml-cpp` is a YAML parser and emitter in C++. It is a header-only library and provides a simple and intuit...
25,590
[ { "from": "human", "value": "YAML seems like a great format for configuration files & data binding persistent objects in human-readable form...\nIs there a C++ library that handles YAML? Does Boost::Serialization have plans for a YAML option?\nEDIT: I would prefer an OO library.\n" }, { "from": "gpt...
My $SHELL is tcsh. I want to run a C shell script that will call a program many times with some arguments changed each time. The program I need to call is in Fortran. I do not want to edit it. The program only takes arguments once it is executed, but not on the command line. Upon calling the program in the script, the ...
To handle the situation you've described in a C shell (tcsh) script, you need to interact with the Fortran program in a way that allows you to run it multiple times with different arguments without having to exit the script every time. Since the Fortran program takes control and you need to manually enter values, you c...
24,651
[ { "from": "human", "value": "My $SHELL is tcsh. I want to run a C shell script that will call a program many times with some arguments changed each time. The program I need to call is in Fortran. I do not want to edit it. The program only takes arguments once it is executed, but not on the command line. Upo...
I'm writing some DB routines and I'm using prepared statements. My environment is PDO with PHP5. I understand prepared statements primarily provide a performance benefit, as well as some auxiliary bonuses such as not having to manually SQL-escape input data. My question is about the performance part. I have two implem...
You've raised an excellent question regarding the use of prepared statements in PDO and their performance implications in your PHP application. Let’s break down the differences between your two implementations (`getPrice_A` and `getPrice_B`) and discuss the performance benefits of prepared statements. ### Performance ...
13,851
[ { "from": "human", "value": "I'm writing some DB routines and I'm using prepared statements. My environment is PDO with PHP5.\nI understand prepared statements primarily provide a performance benefit, as well as some auxiliary bonuses such as not having to manually SQL-escape input data.\nMy question is ab...
How do I query the iPhone's current IP address?
To find the current IP address of your iPhone, you can follow these steps: ### For Wi-Fi Connection: 1. **Open the Settings app**: Locate and tap on the **Settings** app on your iPhone's home screen. 2. **Select Wi-Fi**: Tap on **Wi-Fi** to see the list of available networks. 3. **Find your connected network**: Make s...
27,461
[ { "from": "human", "value": "How do I query the iPhone's current IP address?\n" }, { "from": "gpt", "value": "To find the current IP address of your iPhone, you can follow these steps:\n\n### For Wi-Fi Connection:\n1. **Open the Settings app**: Locate and tap on the **Settings** app on your iPho...
I am writing a custom session handler in PHP and trying to make the methods defined in session_set_save_handler private. session_set_save_handler( array('Session','open'), array('Session','close'), array('Session','read'), array('Session','write'), array('Session','destroy'), array('Session','gc...
In PHP, when you define a method as `private`, it can only be called from within the same class. However, when you set the session handler using `session_set_save_handler`, the methods are invoked by the session handling system, which does not have access to the private methods of your class. This is why you are encoun...
25,688
[ { "from": "human", "value": "I am writing a custom session handler in PHP and trying to make the methods defined in session_set_save_handler private.\nsession_set_save_handler(\n array('Session','open'),\n array('Session','close'),\n array('Session','read'),\n array('Session','write'),\n arra...
After reading this old article measuring the memory consumption of several object types, I was amazed to see how much memory Strings use in Java: length: 0, {class java.lang.String} size = 40 bytes length: 7, {class java.lang.String} size = 56 bytes While the article has some tips to minimize this, I did not find them...
Your observations about the memory consumption of `String` objects in Java are valid, and the Java `String` class can indeed be quite memory-intensive due to its design. The default internal representation of strings as `char[]` means that each character occupies two bytes (due to the UTF-16 encoding). As you've pointe...
25,011
[ { "from": "human", "value": "After reading this old article measuring the memory consumption of several object types, I was amazed to see how much memory Strings use in Java:\nlength: 0, {class java.lang.String} size = 40 bytes\nlength: 7, {class java.lang.String} size = 56 bytes\n\nWhile the article has so...
I have a bunch of JSP files and backend in Tomcat. I have 3 different versions of JSP with same logic inside but with different layouts. So if I change some logic I have three JSP file to fix. What is the proper soution for such a scenario? I thought of some XML and XSLT stack: backend gives only data in XML and than f...
Your scenario is a common problem in web development where you want to separate concerns between the presentation (UI) and the business logic. It’s great that you’re thinking about how to reduce redundancy in your JSP files! Here are several approaches you can consider for managing your JSP files more efficiently: ###...
24,987
[ { "from": "human", "value": "I have a bunch of JSP files and backend in Tomcat. I have 3 different versions of JSP with same logic inside but with different layouts. So if I change some logic I have three JSP file to fix.\nWhat is the proper soution for such a scenario? I thought of some XML and XSLT stack:...
I'm developing a poker game in C#. At the moment I'm trying to get the players hand score using RegEx. I search the string (composed of the cards suit and number) and look for suits or numbers to match the RegEx. If i get 2 matches then the player has a pair, 3 matches he has 3 of a kind. I have 3 classes at the momen...
Using regular expressions (RegEx) to score poker hands can be an interesting approach, but it may not be the most efficient or optimal way to achieve your goal. Regular expressions are powerful for pattern matching, but they may add unnecessary complexity to your poker hand evaluation, especially since you only need to...
24,949
[ { "from": "human", "value": "I'm developing a poker game in C#. At the moment I'm trying to get the players hand score using RegEx. I search the string (composed of the cards suit and number) and look for suits or numbers to match the RegEx. If i get 2 matches then the player has a pair, 3 matches he has 3 ...
0x34363932353433373538323038353135353439
The string you've provided appears to be a hexadecimal representation of binary data. If we convert this hexadecimal string to ASCII, we can see what it represents. Let's break it down: 1. The hexadecimal string is: ``` 0x34363932353433373538323038353135353439 ``` 2. Ignoring the "0x" prefix, the string is...
29,025
[ { "from": "human", "value": "0x34363932353433373538323038353135353439\n" }, { "from": "gpt", "value": "The string you've provided appears to be a hexadecimal representation of binary data. If we convert this hexadecimal string to ASCII, we can see what it represents. \n\nLet's break it down:\n\n...
Is there a compression API available for use on the iPhone? We're building some RESTful web services for our iPhone app to talk to, but we want to compress at least some of the conversations for efficiency. I don't care what the format (ZIP, LHA, whatever) is, and it does not need to be secure. Some respondents have po...
Yes, you can definitely perform compression on the iPhone for data that you want to POST to a web service. The iOS SDK provides several options for compressing data before sending it. Here are a couple of approaches you can consider: ### 1. Use `zlib` for GZIP Compression You can use the `zlib` library, which is avail...
24,991
[ { "from": "human", "value": "Is there a compression API available for use on the iPhone? We're building some RESTful web services for our iPhone app to talk to, but we want to compress at least some of the conversations for efficiency.\nI don't care what the format (ZIP, LHA, whatever) is, and it does not n...
So I was reading those Windows Vista UI guidelines someone linked to in another question, and they mentioned that you should be able to survive a switch to 120 DPI. Well, I fire up my handy VM with my app installed, and what do we get... AAAAGH!!! MASSIVE UI FAIL! Everything's all jumbled: some containers aren't big en...
You've raised some important points about UI design and DPI settings, especially when targeting Windows Forms versus WPF. Let's tackle your questions one by one. ### 1. Tricks for Achieving a Font-Size-Independent Layout in Windows Forms If you choose to stay with Windows Forms, here are some techniques you can imple...
20,504
[ { "from": "human", "value": "So I was reading those Windows Vista UI guidelines someone linked to in another question, and they mentioned that you should be able to survive a switch to 120 DPI. Well, I fire up my handy VM with my app installed, and what do we get... AAAAGH!!! MASSIVE UI FAIL!\nEverything's ...
Is it possible to send a HTTP response with a permanent redirect from a Stellent (now called Oracle UCM) website? We're using version 7.5.2 with iDoc script. We can use the iDoc function setHttpHeader() to send the Location HTTP header, but how to send the HTTP response code 301, to signal the permanent redirect to the...
Yes, it is possible to send an HTTP response with a permanent redirect (301 status code) using iDoc script in Oracle Universal Content Management (UCM) version 7.5.2. To achieve this, you'll need to set both the `Location` HTTP header and the HTTP response status code. Here's a basic example of how to do this using `s...
28,849
[ { "from": "human", "value": "Is it possible to send a HTTP response with a permanent redirect from a Stellent (now called Oracle UCM) website? We're using version 7.5.2 with iDoc script.\nWe can use the iDoc function setHttpHeader() to send the Location HTTP header, but how to send the HTTP response code 30...
I need to perform Diffs between Java strings. I would like to be able to rebuild a string using the original string and diff versions. Has anyone done this in Java? What library do you use? String a1; // This can be a long text String a2; // ej. above text with spelling corrections String a3; // ej. above text with spe...
To perform diffs between Java strings and rebuild a string using the original string and its diff versions, you can use a library called **Google Diff Match Patch**. This library provides powerful algorithms to compute the differences between strings and allows you to reconstruct the original strings from these differe...
22,680
[ { "from": "human", "value": "I need to perform Diffs between Java strings. I would like to be able to rebuild a string using the original string and diff versions. Has anyone done this in Java? What library do you use?\nString a1; // This can be a long text\nString a2; // ej. above text with spelling correc...
I have searched but apparently my google foo is weak. What I need is a way to prompt for user input in the console and have the request time out after a period of time and continue executing the script if no input comes in. As near as I can tell, Read-Host does not provide this functionality. Neither does $host.UI.Prom...
Your implementation of a timeout function in PowerShell is quite clever. You are using a loop to wait for user input while also allowing for a delay to simulate a timeout. However, if you want to improve upon this and allow for the potential of waiting for input for a specified duration while continuing the script exec...
24,600
[ { "from": "human", "value": "I have searched but apparently my google foo is weak. What I need is a way to prompt for user input in the console and have the request time out after a period of time and continue executing the script if no input comes in. As near as I can tell, Read-Host does not provide this ...
When hiring a front-end developer, what specific skills and practices should you test for? What is a good metric for evaluating their skill in HTML, CSS and Javascript? Obviously, table-less semantic HTML and pure CSS layout are probably the key skills. But what about specific techniques? Should he/she be able to effor...
When hiring a front-end developer, it’s crucial to evaluate both their technical skills and their understanding of best practices in HTML, CSS, and JavaScript. Here are specific skills and practices you might consider testing for, along with good metrics for evaluation: ### HTML Skills 1. **Semantic HTML**: Candidates...
20,660
[ { "from": "human", "value": "When hiring a front-end developer, what specific skills and practices should you test for? What is a good metric for evaluating their skill in HTML, CSS and Javascript?\nObviously, table-less semantic HTML and pure CSS layout are probably the key skills. But what about specific ...
We are looking for a open source J2EE Application server for log budget deployments. We are considering JBoss and Glassfish. Which is the best open source application server? Any comparative study available?
When considering an open-source J2EE application server for low-budget deployments, both JBoss (now known as WildFly) and GlassFish have been popular choices. Each server has its strengths and weaknesses, and the best choice depends on your specific requirements, including community support, feature set, performance, a...
23,281
[ { "from": "human", "value": "We are looking for a open source J2EE Application server for log budget deployments. We are considering JBoss and Glassfish. Which is the best open source application server? Any comparative study available?\n" }, { "from": "gpt", "value": "When considering an open-s...
Our team is looking to switch from using mbunit to mstest, but there appears to be some disconnect between the two. Does anyone know how to simulate the CombinatorialTest and Factory attributes from mbunit when using mstest? I think that is our only stumbling block before doing the switch.
Switching from MbUnit (now part of Gallio) to MSTest can be a bit challenging, especially when it comes to features like the `CombinatorialTest` and `Factory` attributes that facilitate parameterized testing in MbUnit. MSTest does not have direct equivalents for these features, but you can achieve similar functionality...
23,749
[ { "from": "human", "value": "Our team is looking to switch from using mbunit to mstest, but there appears to be some disconnect between the two.\nDoes anyone know how to simulate the CombinatorialTest and Factory attributes from mbunit when using mstest?\nI think that is our only stumbling block before doin...
I've created some fairly simple XAML, and it works perfectly (at least in KAXML). The storyboards run perfectly when called from within the XAML, but when I try to access them from outside I get the error: 'buttonGlow' name cannot be found in the name scope of 'System.Windows.Controls.Button'. I am loading the XAML w...
The issue you're encountering stems from how WPF handles name scopes in relation to the `ControlTemplate`. When you create a `Storyboard` in the resources of a `ControlTemplate`, it can only resolve the names of the elements within that specific template when it's applied. Therefore, when you're trying to access the `S...
19,795
[ { "from": "human", "value": "I've created some fairly simple XAML, and it works perfectly (at least in KAXML). The storyboards run perfectly when called from within the XAML, but when I try to access them from outside I get the error:\n'buttonGlow' name cannot be found in the name scope of 'System.Windows....
In my MEF usage, I have a bunch of imports that I want to make available in many other parts of my code. Something like: [Export (typeof (IBarProvider))] class MyBarFactory : IBarPovider { [Import] public IFoo1Service IFoo1Service { get; set; } [Import] public IFoo2Service IFoo2Service { get; set; } ...
In Managed Extensibility Framework (MEF), you can simplify the handling of multiple imports by using a combination of collections, properties, or even composition patterns. Below are a few approaches you could consider: ### 1. Use a Collection of Services You can expose your services as a collection. For example, you...
23,613
[ { "from": "human", "value": "In my MEF usage, I have a bunch of imports that I want to make available in many other parts of my code. Something like:\n[Export (typeof (IBarProvider))]\nclass MyBarFactory : IBarPovider\n{\n [Import]\n public IFoo1Service IFoo1Service { get; set; }\n\n [Import]\n ...
Say I create an object thus: var myObject = {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"}; What is the best way to retrieve a list of the property names? i.e. I would like to end up with some variable 'keys' such that: keys == ["ircEvent", "method", "regex"]
In JavaScript, you can use the `Object.keys()` method to retrieve the property names (keys) of an object. Here’s how you can do it for your `myObject`: ```javascript var myObject = { "ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*" }; // Retrieve the keys var keys = Object.keys(myObject); ...
30,186
[ { "from": "human", "value": "Say I create an object thus:\nvar myObject =\n {\"ircEvent\": \"PRIVMSG\", \"method\": \"newURI\", \"regex\": \"^http://.*\"};\n\nWhat is the best way to retrieve a list of the property names? i.e. I would like to end up with some variable 'keys' such that:\nkeys == [\"ir...
I'm trying to display an array of files in order of date (last modified). I have done this buy looping through the array and sorting it into another array, but is there an easier (more efficient) way to do this?
Yes, there is a more efficient way to sort an array of files based on their last modified dates without needing to create a separate array. Most programming languages provide built-in sorting functions that you can use directly on your array of files. Here's how you can do it in a few popular programming languages: #...
22,516
[ { "from": "human", "value": "I'm trying to display an array of files in order of date (last modified).\nI have done this buy looping through the array and sorting it into another array, but is there an easier (more efficient) way to do this?\n" }, { "from": "gpt", "value": "Yes, there is a more ...
This may be a simple fix - but I'm trying to sum together all the nodes (Size property from the Node class) on the binary search tree. Below in my BST class I have the following so far, but it returns 0: private long sum(Node<T> thisNode) { if (thisNode.Left == null && thisNode.Right == null) ...
It looks like you're trying to sum the `Size` property of the nodes in your binary search tree (BST), but the current implementation of your `sum` method has some issues. 1. **Base Case**: You're returning `0` when you reach a leaf node, which is correct, but you should also include the `Size` of the current node in t...
22,525
[ { "from": "human", "value": "This may be a simple fix - but I'm trying to sum together all the nodes (Size property from the Node class) on the binary search tree. Below in my BST class I have the following so far, but it returns 0:\n private long sum(Node<T> thisNode)\n {\n if (thisNode.Left =...
For example, if I were to write a calendar app on top of AIR, say with Flex, could this app pop up reminder windows for approaching appointments, just like Microsoft Outlook can? Clarification: Can those windows be actual dialogs where I can enter and save information?
Yes, if you were to write a calendar app using Adobe AIR with Flex, you can definitely create pop-up reminder windows for approaching appointments, similar to what Microsoft Outlook does. Adobe AIR allows you to create desktop applications, and you have the capability to implement dialog windows. You can create custom...
29,247
[ { "from": "human", "value": "For example, if I were to write a calendar app on top of AIR, say with Flex, could this app pop up reminder windows for approaching appointments, just like Microsoft Outlook can?\nClarification: Can those windows be actual dialogs where I can enter and save information?\n" }, ...
I'm wrapping up a Javascript widget in a Wicket component. I want to let the JS side talk to the component. What I've got so far: Component in question goes like talker = new GridAjaxBehavior(); this.add(talker); in constructor and then, later on, puts something like "var MyGridTalker = new talker(" + this.talke...
It looks like you're on the right track with your Wicket component and the `GridAjaxBehavior`. To enable your JavaScript to communicate with your Wicket component, you're implementing an AJAX callback through `AbstractDefaultAjaxBehavior`. Here’s how you can handle this to ensure that your JavaScript can call the behav...
24,401
[ { "from": "human", "value": "I'm wrapping up a Javascript widget in a Wicket component. I want to let the JS side talk to the component. What I've got so far:\nComponent in question goes like\ntalker = new GridAjaxBehavior();\nthis.add(talker); \n\nin constructor\nand then, later on, puts something lik...
I know there is already a question about this but my issue is more oriented to remote scenarios. With net start/stop you can specify a /y parameter to bounce users off current sessions but you cannot start/stop remotely. With sc you can start/stop remotely but if the SQLServer instance is being used it won't let you st...
To forcibly disconnect users from a SQL Server instance and then stop the SQL Server service remotely, you will need to follow a sequence of steps. There isn't a direct command that does everything in one go, but you can achieve this by utilizing a combination of SQL commands and service control commands. Here’s a reco...
27,195
[ { "from": "human", "value": "I know there is already a question about this but my issue is more oriented to remote scenarios.\nWith net start/stop you can specify a /y parameter to bounce users off current sessions but you cannot start/stop remotely.\nWith sc you can start/stop remotely but if the SQLServer...
I was checking out the TIBCO GI the other day and I was impressed. Has anyone used it extensively? What are your thoughts? What drawbacks did you encounter? Is it suitable for Internet or only Intranet apps? I appreciate any input you can shed on this.
TIBCO General Interface (GI) is a platform used for building rich internet applications (RIAs). It allows developers to create interactive and data-driven user interfaces that can be deployed on the web. Here are some insights based on user experiences and general knowledge about TIBCO GI: ### User Feedback 1. **Ease...
24,077
[ { "from": "human", "value": "I was checking out the TIBCO GI the other day and I was impressed.\n\nHas anyone used it extensively?\nWhat are your thoughts?\nWhat drawbacks did you encounter?\nIs it suitable for Internet or only Intranet apps?\n\nI appreciate any input you can shed on this.\n" }, { "...
Is it good practice to let abstract classes define instance variables? public abstract class ExternalScript extends Script { String source; public abstract void setSource(String file); public abstract String getSource(); } The sub class, ExternalJavaScript.class, would then automatically get the source ...
Defining instance variables in abstract classes is a common practice in object-oriented programming and can be good or bad depending on the context and how you want to structure your code. Here are some considerations for your specific scenario: ### Pros of Defining Instance Variables in Abstract Classes 1. **Code Reu...
27,755
[ { "from": "human", "value": "Is it good practice to let abstract classes define instance variables?\npublic abstract class ExternalScript extends Script {\n\n String source;\n\n public abstract void setSource(String file);\n\n public abstract String getSource();\n}\n\nThe sub class, ExternalJavaScr...
I have an XML column in a table; I want to "promote" a certain value in that XML as a computed column and index it for faster searching. I have a function that takes in the XML information and outputs the element of interest, like this: CREATE FUNCTION [dbo].[fComputeValue] (@data XML) RETURNS datetime WITH SCHEMABINDI...
The issue you are encountering is due to the fact that SQL Server considers the `datetime` type as a non-deterministic type when it comes to computed columns. Specifically, when you work with XML data and perform queries against it, SQL Server cannot guarantee that the value it extracts will always yield a deterministi...
26,136
[ { "from": "human", "value": "I have an XML column in a table; I want to \"promote\" a certain value in that XML as a computed column and index it for faster searching. I have a function that takes in the XML information and outputs the element of interest, like this:\nCREATE FUNCTION [dbo].[fComputeValue] (...
I have an application written using VS2005 in C# targeting the Compact Framework 2.0 SP2. As part of the solution, I have CAB deploy project which deploys to the device without a problem. What I can't do is create a shortcut to my application on the devices desktop. I have spent several hours reading various bits of do...
Creating a desktop shortcut for a Compact Framework application on a Windows Mobile device using a CAB (Cabinet) deployment project can be a bit tricky. It looks like you're on the right track, but there are a few details to keep in mind that may be causing issues. Here’s a step-by-step approach to ensure that you crea...
26,392
[ { "from": "human", "value": "I have an application written using VS2005 in C# targeting the Compact Framework 2.0 SP2. As part of the solution, I have CAB deploy project which deploys to the device without a problem. What I can't do is create a shortcut to my application on the devices desktop.\nI have spen...
I have an array of integers: int[] number = new int[] { 2,3,6,7 }; What is the easiest way of converting these into a single string where the numbers are separated by a character (like: "2,3,6,7")? I'm using C# and .NET 3.5.
In C# and .NET 3.5, you can convert an array of integers into a single string with the numbers separated by a specific character (like a comma) using the `String.Join` method. Here's how you can do it: ```csharp using System; class Program { static void Main() { int[] number = new int[] { 2, 3, 6, 7 }...
29,917
[ { "from": "human", "value": "I have an array of integers:\nint[] number = new int[] { 2,3,6,7 };\n\nWhat is the easiest way of converting these into a single string where the numbers are separated by a character (like: \"2,3,6,7\")?\nI'm using C# and .NET 3.5.\n" }, { "from": "gpt", "value": "In...
My understanding is that in unix, when memory is freed, the memory doesn't get returned back to the operating system, it stays in the process to be used again for the next call to malloc. On windows, I understand that the memory actually gets returned to the operating system. Is there any big difference between these t...
The behavior you describe regarding memory management in UNIX-like systems and Windows is indeed a result of design decisions in their respective memory allocators and not solely an operating system-wide characteristic. Here’s a more detailed look at the differences, their implications, and pros/cons. ### Memory Manag...
24,926
[ { "from": "human", "value": "My understanding is that in unix, when memory is freed, the memory doesn't get returned back to the operating system, it stays in the process to be used again for the next call to malloc.\nOn windows, I understand that the memory actually gets returned to the operating system.\n...
I am looking for resources on Microsoft Sync Framework. Although MSDN and Google Search gave me the brief overview, I want some demos and presentations. Also, is Live Mesh based on Sync Framework?
The Microsoft Sync Framework is a comprehensive synchronization platform that allows developers to build synchronization capabilities into their applications. For resources on the Sync Framework, you can explore the following: ### Resources for Microsoft Sync Framework 1. **Official Documentation**: - The official...
26,969
[ { "from": "human", "value": "I am looking for resources on Microsoft Sync Framework. Although MSDN and Google Search gave me the brief overview, I want some demos and presentations.\nAlso, is Live Mesh based on Sync Framework?\n" }, { "from": "gpt", "value": "The Microsoft Sync Framework is a co...
I'm actually developing a Web Service in Java using Axis 2. I designed my service as a POJO (Plain Old Java Object) with public method throwing exceptions : public class MyService { public Object myMethod() throws MyException { [...] } } I then generated the WSDL using Axis2 ant task. With the WSDL I gen...
It seems that you're encountering issues with exception handling in your Axis 2 web service implementation. Specifically, you're seeing `AxisFault` instead of your custom exception `MyExceptionException` when the service method throws an exception. Let's break down some key points regarding how Axis 2 handles exception...
23,459
[ { "from": "human", "value": "I'm actually developing a Web Service in Java using Axis 2.\nI designed my service as a POJO (Plain Old Java Object) with public method throwing exceptions :\npublic class MyService {\n public Object myMethod() throws MyException {\n [...]\n }\n}\n\nI then generated t...
I'm using SWFUpload to handle file uploads and have run into a problem where any file upload >= 3 min will time out. As far as I can tell, Apache and PHP are configured properly to handle large files. Are there any settings with Flash that might affect this? Does Flash have some sort of timeout value I could change?
SWFUpload uses Flash for file uploads, and while most configurations around file uploads are handled by the server (like Apache and PHP settings), there are a couple of Flash-related settings you might want to check regarding timeouts. ### Flash Timeout Considerations 1. **Flash Player Settings**: By default, Flash P...
26,013
[ { "from": "human", "value": "I'm using SWFUpload to handle file uploads and have run into a problem where any file upload >= 3 min will time out. As far as I can tell, Apache and PHP are configured properly to handle large files. Are there any settings with Flash that might affect this? Does Flash have some...
What do you use to monitor the uptime / performance of your websites, specifically those based on a PHP/MySQL platform like Wordpress? I'm looking for something that alerts me if the site is down, or performing too slowly, and has some useful (not volumeous!) charts showing me any potential problems, and what to do abo...
To monitor the uptime and performance of websites, especially those based on PHP/MySQL platforms like WordPress, there are several tools available that can help you get alerts and insights without overwhelming you with data. Here are some popular options: 1. **UptimeRobot**: - **Features**: Monitors uptime at 5-min...
23,192
[ { "from": "human", "value": "What do you use to monitor the uptime / performance of your websites, specifically those based on a PHP/MySQL platform like Wordpress?\nI'm looking for something that alerts me if the site is down, or performing too slowly, and has some useful (not volumeous!) charts showing me ...
Edit: Ryan raised a good point. I specifically want to be able to map to and from while still storing human-readable values in the database. That is, I don't want a bunch of enumeration integers in my database.
Ryan raised a good point. I specifically want to be able to map values to and from a format that allows for storing human-readable values in the database. I prefer not to use a series of enumeration integers in the database.
31,129
[ { "from": "human", "value": "Edit: Ryan raised a good point. I specifically want to be able to map to and from while still storing human-readable values in the database. That is, I don't want a bunch of enumeration integers in my database.\n" }, { "from": "gpt", "value": "Ryan raised a good po...
I am currently writing a little bootstrap code for a service that can be run in the console. It essentially boils down to calling the OnStart() method instead of using the ServiceBase to start and stop the service (because it doesn't run the application if it isn't installed as a service and makes debugging a nightmare...
Your solution for running a Windows service in a console environment looks solid. By checking for `Debugger.IsAttached` or a specific command-line argument like `-console`, you allow for a flexible way to determine whether the application is being run as a service or interactively in a console. This is a practical appr...
24,796
[ { "from": "human", "value": "I am currently writing a little bootstrap code for a service that can be run in the console. It essentially boils down to calling the OnStart() method instead of using the ServiceBase to start and stop the service (because it doesn't run the application if it isn't installed as ...
If I want to construct a std::string with a line like: std::string my_string("a\0b"); Where i want to have three characters in the resulting string (a, null, b), I only get one. What is the proper syntax?
In C++, a null character (`\0`) is used as a string terminator for C-style strings. When you initialize a `std::string` using a string literal like `"a\0b"`, the string will stop at the first null character. Hence, you will only get the character `'a'`. If you want to create a `std::string` containing multiple charact...
28,292
[ { "from": "human", "value": "If I want to construct a std::string with a line like:\nstd::string my_string(\"a\\0b\");\n\nWhere i want to have three characters in the resulting string (a, null, b), I only get one. What is the proper syntax?\n" }, { "from": "gpt", "value": "In C++, a null charac...
That's a mouthful... Here's the issue, we're doing some client-side validation via AJAX calls to page methods (which are essentially web services). We've also added a drop-down on the page to choose your language and have created a class that inherits from Page that initializes localization based on the drop-down sele...
Localization can indeed be a challenge, especially when working with AJAX calls and page methods that do not go through the usual ASP.NET page lifecycle. Since you want to maintain the language preference across AJAX calls, there are a few approaches you can take to simplify your implementation: ### 1. Use Session or ...
22,017
[ { "from": "human", "value": "That's a mouthful...\nHere's the issue, we're doing some client-side validation via AJAX calls to page methods (which are essentially web services). We've also added a drop-down on the page to choose your language and have created a class that inherits from Page that initialize...
I want to be able to see how many lines were added to a file since the last quering without reading the whole file again. Something like : ptail my_file | fgrep "[ERROR]" | wc -l A solution in simple Perl would be prefered, since I don't have an easy access to a compiler.
Certainly! You can achieve this in Perl by maintaining a record of how many lines you've processed from the file so that you only read the new lines each time you query. Here’s a simple Perl script that does just that: ```perl #!/usr/bin/perl use strict; use warnings; use Time::HiRes qw(sleep); # File to watch my $f...
25,505
[ { "from": "human", "value": "I want to be able to see how many lines were added to a file since the last quering without reading the whole file again.\nSomething like :\nptail my_file | fgrep \"[ERROR]\" | wc -l \n\nA solution in simple Perl would be prefered, since I don't have an easy access to a compiler...
Scrum is quite popular dev.process these days and often Project Manager suddenly gets new title (Scrum Master). However it should be not just a new title, but new habits and new paradigm. What are the bad habits of your Scrum master?
Transitioning from a traditional project manager to a Scrum Master involves a significant shift in mindset and practices. Here are some common bad habits that a Scrum Master might exhibit, which can hinder the effectiveness of the Scrum process: 1. **Command and Control Mentality**: A Scrum Master should facilitate an...
22,846
[ { "from": "human", "value": "Scrum is quite popular dev.process these days and often Project Manager suddenly gets new title (Scrum Master). However it should be not just a new title, but new habits and new paradigm. What are the bad habits of your Scrum master?\n" }, { "from": "gpt", "value": "...
Are there any limitations on the amount of memory that the Flash player can use? If you have a SWF that over time gets a lot of data from the server, then more and more data will be kept in memory. Is there a limitation on this?
Yes, there are limitations on the amount of memory that Flash Player can use. The Flash Player does not have a fixed memory limit, but it is subject to certain constraints depending on the platform it is running on and the environment in which it is used. ### Key Considerations: 1. **Platform Variability**: The actua...
27,005
[ { "from": "human", "value": "Are there any limitations on the amount of memory that the Flash player can use? If you have a SWF that over time gets a lot of data from the server, then more and more data will be kept in memory. Is there a limitation on this?\n" }, { "from": "gpt", "value": "Yes, ...
I have worked on projects for embedded systems in the past where we have rearranged the order of declaration of stack variables to decrease the size of the resulting executable. For instance, if we had: void func() { char c; int i; short s; ... } We would reorder this to be: void func() { int i; ...
The behavior you're observing regarding the size of stack allocations due to variable alignment is indeed a well-known aspect of how compilers handle memory layout, particularly for local variables. The C and C++ standards do not permit compilers to reorder the declarations of variables within a single function body; h...
24,268
[ { "from": "human", "value": "I have worked on projects for embedded systems in the past where we have rearranged the order of declaration of stack variables to decrease the size of the resulting executable. For instance, if we had:\nvoid func()\n{\n char c;\n int i;\n short s;\n ...\n}\n\nWe wo...
I have the following class in C++: class a { const int b[2]; // other stuff follows // and here's the constructor a(void); } The question is, how do I initialize b in the initialization list, given that I can't initialize it inside the body of the function of the constructor, because b is const? This ...
In C++, when you have a `const` array as a member of a class, you can initialize it using an initializer list in the constructor. However, you cannot use an initializer like `[2,3]` directly in the initialization list. Instead, you can use a brace-enclosed initializer list. Here's how you can properly initialize the `...
27,868
[ { "from": "human", "value": "I have the following class in C++:\nclass a {\n const int b[2];\n // other stuff follows\n\n // and here's the constructor\n a(void);\n}\n\nThe question is, how do I initialize b in the initialization list, given that I can't initialize it inside the body of the func...
I am trying to learn how to use MSBuild so we can use it to build our project. There's what seems to be a very big hole in the documentation, and I find the hole everywhere I look, the hole being how do you name or otherwise designate the MSBuild project file? For example, the tutorial on MSBuild that can be downloa...
You're correct that the documentation often assumes a certain level of familiarity with how MSBuild operates, which can lead to confusion for those new to it. Let's clarify how to work with MSBuild project files. ### Naming and Location of MSBuild Project Files 1. **File Extension**: - While you can technically n...
23,625
[ { "from": "human", "value": "I am trying to learn how to use MSBuild so we can use it to build our project. There's what seems to be a very big hole in the documentation, and I find the hole everywhere I look, the hole being how do you name or otherwise designate the MSBuild project file? \nFor example, t...
I want to increment a cookie value every time a page is referenced even if the page is loaded from cache. What is the "best" or most concise way to implement this?
To increment a cookie value each time a page is referenced, even when served from cache, you can use JavaScript to ensure that the cookie is updated each time the page loads. Below is a concise implementation using JavaScript: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="v...
27,715
[ { "from": "human", "value": "I want to increment a cookie value every time a page is referenced even if the page is loaded from cache. What is the \"best\" or most concise way to implement this?\n" }, { "from": "gpt", "value": "To increment a cookie value each time a page is referenced, even whe...
I have seen at least one site in the past that had analytics on Open Source projects, describing lines of code, hours worked, number of check-ins, all sorts of stuff. Does anyone know of any of those sites?
Yes, there are several platforms and tools that provide analytics for open-source projects, offering insights into metrics such as lines of code, number of commits, contributors, and more. Here are a few notable ones: 1. **GitHub Insights**: GitHub provides some built-in analytics for repositories, including contribut...
28,494
[ { "from": "human", "value": "I have seen at least one site in the past that had analytics on Open Source projects, describing lines of code, hours worked, number of check-ins, all sorts of stuff.\nDoes anyone know of any of those sites?\n" }, { "from": "gpt", "value": "Yes, there are several pla...
How do you programmatically set a DataContext that specifies the selected item of a list? More simply, how do you reproduce this type of binding in code? <StackPanel> <ListBox Name="listBox1" /> <TextBox Name="textBox1" DataContext="{Binding ElementName=listBox1, Path=SelectedItem}" /> </StackPanel>
To programmatically set a `DataContext` in WPF (Windows Presentation Foundation) and achieve the equivalent of the XAML binding you provided, you would typically do the following in the code-behind (C#): 1. First, you need to create the `ListBox` and `TextBox` controls. 2. Then, you set the `DataContext` of the `TextB...
26,492
[ { "from": "human", "value": "How do you programmatically set a DataContext that specifies the selected item of a list? \nMore simply, how do you reproduce this type of binding in code?\n<StackPanel>\n <ListBox Name=\"listBox1\" />\n <TextBox Name=\"textBox1\" DataContext=\"{Binding ElementName=listBox...
Here is the input (html, not xml): ... html content ... <tag1> content for tag 1 </tag1> <tag2> content for tag 2 </tag2> <tag3> content for tag 3 </tag3> ... html content ... I would like to get 3 matches, each with two groups. First group would contain the name of the tag and the second group would contain the inner...
You can achieve this using regular expressions to match the specific HTML tags and capture their names and inner text. Here’s a regular expression pattern you can use: ```regex <(?<name>tag1|tag2|tag3)>(?<value>.*?)<\/\k<name>> ``` ### Explanation: - `<(?<name>tag1|tag2|tag3)>`: This matches the opening tag and captu...
27,802
[ { "from": "human", "value": "Here is the input (html, not xml):\n... html content ...\n<tag1> content for tag 1 </tag1>\n<tag2> content for tag 2 </tag2>\n<tag3> content for tag 3 </tag3>\n... html content ...\n\nI would like to get 3 matches, each with two groups. First group would contain the name of the ...
I have tried <ul id="contact_list"> <li id="phone">Local 604-555-5555</li> <li id="i18l_phone">Toll-Free 1-800-555-5555</li> </ul> with #contact_list { list-style: disc none inside; } #contact_list #phone { list-style-image: url(images/small_wood_phone.png); } #contact_list #i18l_phone { list-sty...
It sounds like you're encountering an issue with the CSS specificity or inheritance that's causing your `list-style-image` properties to be overridden. If your inline styles work correctly, it indicates that the CSS rules you've defined are not being applied properly due to specificity. Here are a few ways you can ens...
22,347
[ { "from": "human", "value": "I have tried\n<ul id=\"contact_list\">\n <li id=\"phone\">Local 604-555-5555</li>\n <li id=\"i18l_phone\">Toll-Free 1-800-555-5555</li>\n</ul>\n\nwith\n#contact_list\n{\n list-style: disc none inside;\n}\n\n#contact_list #phone\n{\n list-style-image: url(images/small...
I'm writing a web application that decodes Morse Code that is tapped in using mouse button. I originally did a proof of concept using conventional JavaScript, but now I'm redoing it using jQuery. Is there a clever way with jQuery to tell if a button has been pressed again within so many milliseconds, or not - and run s...
Certainly! You can achieve this by using a combination of jQuery's event handling and `setTimeout()` to manage the timing of button presses. The idea is to set a timeout that waits a specified amount of time after a button press, and if another button press occurs within that time frame, you can clear the timeout and s...
21,088
[ { "from": "human", "value": "I'm writing a web application that decodes Morse Code that is tapped in using mouse button.\nI originally did a proof of concept using conventional JavaScript, but now I'm redoing it using jQuery.\nIs there a clever way with jQuery to tell if a button has been pressed again with...
I need a software to admin my networks connections, I go to diferents clients with my notebook and I have to manually change my settings. Best software to do this? Windows and Mac, I use a MacBook with Vmware Fusion.
Managing network connections across different clients can be streamlined with several tools, especially since you're using both macOS and Windows through VMware Fusion. Here are some software solutions that can help you manage your network settings efficiently: ### 1. **NetSetMan** - **Platform:** Windows - **Features...
25,006
[ { "from": "human", "value": "I need a software to admin my networks connections, I go to diferents clients with my notebook and I have to manually change my settings. Best software to do this? Windows and Mac, I use a MacBook with Vmware Fusion.\n" }, { "from": "gpt", "value": "Managing network ...
When extending classes, I find it very descriptive to use the base (MyBase in VB) keyword when accessing methods in the base-class. And the this (Me in VB) keyword when accessing functions in the class extending the base-class. That goes for a "flat" structure with no inheritance as well. I find it easier to read this:...
In C#, there isn't a built-in way to enforce the use of `this` and `base` keywords at compile-time through the compiler options or language features. However, you can achieve something similar through the following approaches: 1. **Code Analysis Tools**: You can use static code analysis tools or style analyzers, such ...
26,333
[ { "from": "human", "value": "When extending classes, I find it very descriptive to use the base (MyBase in VB) keyword when accessing methods in the base-class. And the this (Me in VB) keyword when accessing functions in the class extending the base-class. That goes for a \"flat\" structure with no inherita...
What is the default capacity of a StringBuilder? And when should (or shouldn't) the default be used?
The default capacity of a `StringBuilder` in C# is 16 characters. This means that when you create a new instance of `StringBuilder` without specifying a capacity, it will be initialized with a buffer that can hold 16 characters before it needs to be resized. ### When to Use the Default Capacity 1. **Small, Simple Str...
28,679
[ { "from": "human", "value": "What is the default capacity of a StringBuilder?\nAnd when should (or shouldn't) the default be used?\n" }, { "from": "gpt", "value": "The default capacity of a `StringBuilder` in C# is 16 characters. This means that when you create a new instance of `StringBuilder` ...
What is the best way to load a locale-specific (i.e. translated) compiled help file (.chm)? Our install will deploy them alongside the satellite assemblies containing resources. I'd like to re-use the same probing rules the .NET framework uses to load the satellite assemblies, and I'd definitely like to avoid writing m...
Loading locale-specific compiled help files (.chm) while leveraging the .NET framework's built-in resource management can indeed be a bit tricky, as the `System.Windows.Forms.Help` class does not provide a direct way to specify a `CultureInfo` object for loading help files. However, you can achieve your goal by employi...
18,644
[ { "from": "human", "value": "What is the best way to load a locale-specific (i.e. translated) compiled help file (.chm)? Our install will deploy them alongside the satellite assemblies containing resources. I'd like to re-use the same probing rules the .NET framework uses to load the satellite assemblies, a...
I'm interested to know what are the "must have" JSP tag libraries apart from JSTL. All I've found so far are ccc - for accessing static constants in JSP (without scriptlet) displaytag - for generating sophisticated HTML tables that includes data paging, grouping, sorting, exporting etc. What other indispensible tag l...
In addition to JSTL (JavaServer Pages Standard Tag Library), the two tag libraries you've mentioned (ccc and displaytag) are indeed useful. Here are some other widely used and indispensable JSP tag libraries that you might find helpful: 1. **Apache Struts Tag Libraries**: If you're using the Struts framework, the Stru...
26,900
[ { "from": "human", "value": "I'm interested to know what are the \"must have\" JSP tag libraries apart from JSTL. All I've found so far are\n\nccc - for accessing static constants in JSP (without scriptlet)\ndisplaytag - for generating sophisticated HTML tables that includes data paging, grouping, sorting, ...
I am currently looking at a distributed cache solution. If money was not an issue, which would you recommend? www.scaleoutsoftware.com ncache memcacheddotnet MS Velocity
When considering a distributed cache solution and money is not an issue, it's essential to evaluate several factors beyond just cost, such as performance, scalability, ease of integration, community support, and features. Here's a brief overview of the options you've mentioned: 1. **ScaleOut Software**: - **Overvie...
23,056
[ { "from": "human", "value": "I am currently looking at a distributed cache solution. \nIf money was not an issue, which would you recommend?\n\nwww.scaleoutsoftware.com\nncache\nmemcacheddotnet\nMS Velocity\n\n" }, { "from": "gpt", "value": "When considering a distributed cache solution and mone...
Is there a better way to watch for new entries in a table besides selecting from it every n ticks of time or something like that? I have a table that an external program updates very often, and clients can watch for this new data as it arrive, how can I make that without having to set a fixed period of repeatable selec...
Yes, there are several more efficient ways to watch for new entries in a database table without the need for repeatedly polling the table at fixed intervals. Here are some common approaches: 1. **Database Triggers with Notifications**: Many databases support triggers, which can be configured to execute a function o...
26,114
[ { "from": "human", "value": "Is there a better way to watch for new entries in a table besides selecting from it every n ticks of time or something like that?\nI have a table that an external program updates very often, and clients can watch for this new data as it arrive, how can I make that without having...
I've been trying to figure out how to retrieve the text selected by the user in my webbrowser control and have had no luck after digging through msdn and other resources, So I was wondering if there is a way to actually do this. Maybe I simply missed something. I appreciate any help or resources regarding this. Thanks
To retrieve the text selected by the user in a WebBrowser control in a WinForms application, you can use the `IHTMLDocument2` interface provided by the `mshtml` library. Here's a step-by-step guide on how to accomplish this: 1. **Add References**: Ensure that you have added a reference to `Microsoft.mshtml` in your pr...
22,266
[ { "from": "human", "value": "I've been trying to figure out how to retrieve the text selected by the user in my webbrowser control and have had no luck after digging through msdn and other resources, So I was wondering if there is a way to actually do this. Maybe I simply missed something.\nI appreciate any...
Part of my latest webapp needs to write to file a fair amount as part of its logging. One problem I've noticed is that if there are a few concurrent users, the writes can overwrite each other (instead of appending to file). I assume this is because of the destination file can be open in a number of places at the same t...
Dealing with concurrent writes to a log file in an NFS environment can indeed be tricky, especially without the ability to use traditional file locking mechanisms like `flock`. Given your constraints, here are some alternative approaches you might consider: ### 1. Use a Centralized Logging Service Instead of writing l...
24,873
[ { "from": "human", "value": "Part of my latest webapp needs to write to file a fair amount as part of its logging. One problem I've noticed is that if there are a few concurrent users, the writes can overwrite each other (instead of appending to file). I assume this is because of the destination file can be...
s it possible to do the following in subsonic. SELECT * FROM TABLE1 WHERE Column1 > Column2 or Column1 < Colum3 All examples that I've seen assume you now a value to pass to the where clause. I'm trying to do this without creating a view. Thanks
In SubSonic, if you want to execute a query that compares columns within the same table without passing specific values, you can achieve this using the `SQL` method to write raw SQL. SubSonic provides flexibility for executing custom SQL queries. Here’s an example of how you can execute your SQL query using SubSonic: ...
25,205
[ { "from": "human", "value": "s it possible to do the following in subsonic.\nSELECT * FROM TABLE1\nWHERE Column1 > Column2 or Column1 < Colum3\nAll examples that I've seen assume you now a value to pass to the where clause. I'm trying to do this without creating a view.\nThanks\n" }, { "from": "gpt"...
I have a table with one column and about ten rows. The first column has rows with text as row headers, "header 1", "header 2". The second column contains fields for the user to type data (textboxes and checkboxes). I want to have a button at the top labelled "Add New...", and have it create a third column, with the...
Certainly! You can achieve this by using JavaScript to manipulate the DOM and dynamically create new columns in a table. Below is a simple example using HTML, CSS, and JavaScript to create a table with a button that adds a new column of input fields when clicked. ### HTML Structure ```html <!DOCTYPE html> <html lang=...
23,466
[ { "from": "human", "value": "I have a table with one column and about ten rows. The first column has rows with text as row headers, \"header 1\", \"header 2\". The second column contains fields for the user to type data (textboxes and checkboxes). \nI want to have a button at the top labelled \"Add New.....
I have a java application that has Web Services published using Axis. With the latest release one of the service methods in the WSDL is wrong. It has a field in a complex type with double instead of an array of doubles. I've checked the src WSDL and the generated classes like the data object and the binding stub, but ...
When working with Java applications that use Axis for web services, it's important to recognize that the WSDL being served may not always match your source definitions. Here are a few steps and considerations to help you identify where the mismatch is occurring: 1. **WSDL Publication Location**: Check the exact locati...
24,690
[ { "from": "human", "value": "I have a java application that has Web Services published using Axis.\nWith the latest release one of the service methods in the WSDL is wrong. It has a field in a complex type with double instead of an array of doubles.\nI've checked the src WSDL and the generated classes like...
What's the best way to store tags for a record? Just use a varchar field? What about when selecting rows that contains tag x? Use the like operator? thanks!
When it comes to storing tags for records in a database, there are several approaches to consider. While using a `VARCHAR` field is one option, it may not be the most efficient or flexible for managing tags, especially when it comes to querying and indexing. ### Common Approaches to Storing Tags 1. **Single VARCHAR F...
23,614
[ { "from": "human", "value": "What's the best way to store tags for a record? Just use a varchar field? What about when selecting rows that contains tag x? Use the like operator?\nthanks!\n" }, { "from": "gpt", "value": "When it comes to storing tags for records in a database, there are several a...
I guess I can extend the base providers to manipulate the base layout etc.Is there any place where I can get the java source code for default providers? Where are the classes for these default providers copied to ?What are list of things that I can manipulate by extending base containers? Is there a comprehensive docum...
Hi Vivek, It seems you're looking for information related to extending base providers, possibly in a Java application context, such as in a framework like JavaFX, Swing, or a similar UI toolkit. I’ll address your queries based on common practices and patterns seen in Java frameworks. ### 1. Source Code for Default Pr...
24,654
[ { "from": "human", "value": "I guess I can extend the base providers to manipulate the base layout etc.Is there any place where I can get the java source code for default providers? Where are the classes for these default providers copied to ?What are list of things that I can manipulate by extending base c...
Is it possible to call a class's static property to set the navigateurl property? <asp:HyperLink ID="hlRegister" NavigateUrl="<%= SomeClass.Property %>" runat="server" /> without using codebehind ofcourse!
In ASP.NET Web Forms, you can't directly use an inline expression like `<%= SomeClass.Property %>` in the `NavigateUrl` property of the `HyperLink` control. The `<%= %>` syntax is used to evaluate expressions in the context of rendering the page, and it cannot be used directly within the attributes of server controls l...
27,176
[ { "from": "human", "value": "Is it possible to call a class's static property to set the navigateurl property?\n\n<asp:HyperLink ID=\"hlRegister\" NavigateUrl=\"<%= SomeClass.Property %>\" runat=\"server\" />\n\n\nwithout using codebehind ofcourse!\n" }, { "from": "gpt", "value": "In ASP.NET We...
If I were to include .Net Framework setup file along with my apps (installation process is done by our own technician), to be install on a clean Windows (XP SP2/SP3 or Vista SP1) without prior installation of any framework, which of the .Net Framework setup do I need to install in sequence, to get to 3.5 SP1? Currently...
To install .NET Framework 3.5 SP1 on a clean Windows XP (SP2/SP3) or Vista (SP1) system without any prior installations, you need to install the frameworks in the correct sequence. Here's how to do it with the setup files you have: 1. **.NET Framework 2.0** - Install this first. It is the base for .NET 3.5. 2. **.NET ...
28,215
[ { "from": "human", "value": "If I were to include .Net Framework setup file along with my apps (installation process is done by our own technician), to be install on a clean Windows (XP SP2/SP3 or Vista SP1) without prior installation of any framework, which of the .Net Framework setup do I need to install ...
I`m parsing SQL query with C# Regex. I need also to make my pattern to understand "=", for example: string pattern = @"...something...(where)\s\w*\s*(order by)*...something else..."; the following query should match my pattern: select fieldslist from mytable where fieldvalue=someint order by specialfield how can I chan...
To modify your regex pattern to match SQL queries that use the `=` operator in the `WHERE` clause, you can expand your regex to accommodate the equality operator and ensure you correctly capture the required parts of the SQL query. The regex pattern you provided uses `\w*`, which only matches word characters (letters,...
25,262
[ { "from": "human", "value": "I`m parsing SQL query with C# Regex.\nI need also to make my pattern to understand \"=\", for example:\nstring pattern = @\"...something...(where)\\s\\w*\\s*(order by)*...something else...\";\nthe following query should match my pattern:\nselect fieldslist from mytable where fie...
So, my question is how do people get the word out that their website or blog exists? Do blogger invest in ads? Is is just through word of mouth? Or searching Google? I'm just curious how does a website build it's popularity. Do you just put your website up on the web and hope people find it? I know you can make your si...
Hi John, Building popularity for a website or blog involves a combination of strategies, and while some people may rely on word of mouth or hope for organic traffic, there are more proactive approaches to promote a site effectively. Here are some common techniques used to increase visibility and attract visitors: 1. ...
27,029
[ { "from": "human", "value": "So, my question is how do people get the word out that their website or blog exists? Do blogger invest in ads? Is is just through word of mouth? Or searching Google? I'm just curious how does a website build it's popularity. Do you just put your website up on the web and hope pe...
I've been battling PHP's email reading functions for the better part of two days. I'm writing a script to read emails from a mailbox and save any attachments onto the server. If you've ever done something similar, you might understand my pain: PHP doesn't play well with email! I've connected to the POP3 server and I ca...
You're on the right track with using `imap_fetchbody` to get the raw data of the email attachments. The data you are seeing is indeed a Base64 encoded string, which is common for email attachments. In order to save these attachments, you need to decode this data from Base64 and then write it to a file on your server. ...
14,700
[ { "from": "human", "value": "I've been battling PHP's email reading functions for the better part of two days. I'm writing a script to read emails from a mailbox and save any attachments onto the server. If you've ever done something similar, you might understand my pain: PHP doesn't play well with email!\n...
I'm using scriptaculous's Ajax.Autocompleter for a search with different filters. http://github.com/madrobby/scriptaculous/wikis/ajax-autocompleter The filters are requiring me to pass data into the autocompleter dynamically, which I've successfully learned to do from the following link. http://www.simpltry.com/2007/...
To achieve the desired functionality where the `Ajax.Autocompleter` makes a request not just when typing in the input field, but also when clicking on different filters, you will need to manipulate the `Autocompleter` instance directly from your filter click event. Here’s a general approach on how to implement this: ...
22,406
[ { "from": "human", "value": "I'm using scriptaculous's Ajax.Autocompleter for a search with different filters. \nhttp://github.com/madrobby/scriptaculous/wikis/ajax-autocompleter\nThe filters are requiring me to pass data into the autocompleter dynamically, which I've successfully learned to do from the fol...
I'm looking for a good JavaScript RegEx to convert names to proper cases. For example: John SMITH = John Smith Mary O'SMITH = Mary O'Smith E.t MCHYPHEN-SMITH = E.T McHyphen-Smith John Middlename SMITH = John Middlename SMITH Well you get the idea. Anyone come up with a comprehensive solution?
To achieve the conversion of names to proper case, you can use a combination of JavaScript's regular expressions and string manipulation methods. Below is a function that handles various cases, including handling names with apostrophes and hyphens appropriately. Here's a comprehensive solution: ```javascript function...
26,608
[ { "from": "human", "value": "I'm looking for a good JavaScript RegEx to convert names to proper cases. For example:\nJohn SMITH = John Smith\n\nMary O'SMITH = Mary O'Smith\n\nE.t MCHYPHEN-SMITH = E.T McHyphen-Smith \n\nJohn Middlename SMITH = John Middlename SMITH\n\nWell you get the idea.\nAnyone come up...
In the following code, used to get a list of products in a particular line, the command only returns results when I hard code (concatenate) productLine into the SQL. The parameter substitution never happens. + "lineName = '@productLine' " + "and isVisible = 1 "; M...
The issue you're encountering with parameter substitution in your SQL query likely stems from the way the SQL command is constructed. In your SQL string, you are using single quotes around the `@productLine` parameter, which prevents the parameter from being recognized correctly. Here's how to correct it: ### Correct...
25,626
[ { "from": "human", "value": "In the following code, used to get a list of products in a particular line, the command only returns results when I hard code (concatenate) productLine into the SQL. The parameter substitution never happens.\n + \"lineName = '@productLine' \" \n...
I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point. If I use: printf("%1.3f", 359.01335); printf("%1.3f", 359.00999); I get 359.013 359.010 Instead of the desired 359.013...
To achieve the desired output while controlling the number of digits after the decimal point in C's `printf()` function, you should use the correct format specifier. The format specifier you are using, `%1.3f`, controls the minimum width and the number of decimal places. In this case, the `1` before the decimal point...
29,566
[ { "from": "human", "value": "I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point. If I use:\nprintf(\"%1.3f\", 359.01335);\nprintf(\"%1.3f\", 359.00999);\n\nI ge...
I have a couple of buttons of which I modified how they look. I have set them as flat buttons with a background and a custom border so they look all pretty and nothing like normal buttons anymore (actually, they look like Office 2003 buttons now ;-). The buttons have a border of one pixel. However when the button gets ...
It sounds like you're encountering a common issue with button focus visualizations. Many UI frameworks automatically provide a focus outline or additional border to indicate that a button is currently focused. The good news is that you can usually customize or remove this focus style while maintaining the functionality...
17,053
[ { "from": "human", "value": "I have a couple of buttons of which I modified how they look. I have set them as flat buttons with a background and a custom border so they look all pretty and nothing like normal buttons anymore (actually, they look like Office 2003 buttons now ;-). The buttons have a border of...
I'm using MSTEST inside Visual Studio 2008. How can I have each unit test method in a certain test class act as if it were the first test to run so that all global state is reset before running each test? I do not want to explicitly clean up the world using TestInitialize, ClassInitialize, AssemblyInitialize, etc. For ...
In MSTest, there isn't a built-in way to run each test method in a separate AppDomain directly from attributes or configuration. However, you can achieve the desired effect of isolating your tests from global state by creating a custom test runner that does the setup and teardown logic for you. Here’s one approach to ...
27,184
[ { "from": "human", "value": "I'm using MSTEST inside Visual Studio 2008. How can I have each unit test method in a certain test class act as if it were the first test to run so that all global state is reset before running each test? I do not want to explicitly clean up the world using TestInitialize, Class...
I'd like to use the Object Test Bench in VS2008. The docs - and even the helpful text in the test bench window - say to right click on class in the Class View. Further reading indicates that this class must be in the startup project or referenced assembly. I've tried this on numerous classes - public, private, static, ...
Using the Object Test Bench in Visual Studio 2008 can sometimes be tricky, and it seems you've run into common issues. Here are a few things to consider and steps to troubleshoot the situation: 1. **Check the Project Type**: Ensure that your project is a type that supports the Object Test Bench, such as a Class Librar...
26,119
[ { "from": "human", "value": "I'd like to use the Object Test Bench in VS2008. The docs - and even the helpful text in the test bench window - say to right click on class in the Class View. Further reading indicates that this class must be in the startup project or referenced assembly. I've tried this on num...
I refresh Excel 2007 data connections via a C# program and OLE. Most of the work is done by a single Workbooks.RefreshAll() statement. As is the nature of refreshing spreadsheets, various things can go wrong. During the refresh process, the program can give dialog box error messages about "Data cannot be read from file...
Catching Excel dialog errors programmatically, especially in older versions like Excel 2007, can be a challenge. The standard error handling in C# doesn't directly intercept modal dialog boxes shown by Excel when errors occur during operations like refreshing data. However, there are some approaches you can take to ha...
25,601
[ { "from": "human", "value": "I refresh Excel 2007 data connections via a C# program and OLE. Most of the work is done by a single Workbooks.RefreshAll() statement.\nAs is the nature of refreshing spreadsheets, various things can go wrong. During the refresh process, the program can give dialog box error mes...
Let's say I have one class Foo that has a bunch of logic in it and another class Bar which is essentially the same. However, as Foo and Bar are different (but related) entities I need the difference to be apparent from my code (i.e. I can tell whether an instance is a Foo or a Bar) As I was whacking this together witho...
When deciding whether to use inheritance or composition for your classes, there are a few important considerations to keep in mind. ### Option 1: Inheritance ```java public class Foo { /* constructors, fields, method, logic and what-not */ } public class Bar extends Foo { /* nothing here but constructors */ } `...
26,204
[ { "from": "human", "value": "Let's say I have one class Foo that has a bunch of logic in it and another class Bar which is essentially the same. However, as Foo and Bar are different (but related) entities I need the difference to be apparent from my code (i.e. I can tell whether an instance is a Foo or a B...
Question number three in my quest to properly understand MVC before I implement it: I have two cases in mind: The primary application window needs to launch the preferences window. (One View invoking another View.) The primary Model for an application needs to access a property in the preferences Model. (One Model acc...
It’s great that you’re diving deep into understanding the Model-View-Controller (MVC) pattern and how to manage communication among various components. The scenarios you described are common challenges when implementing MVC, especially in more complex applications. Let’s break down your questions. ### 1. Communication...
25,745
[ { "from": "human", "value": "Question number three in my quest to properly understand MVC before I implement it:\nI have two cases in mind:\n\nThe primary application\nwindow needs to launch the\npreferences window. (One View\ninvoking another View.)\nThe primary Model for an application\nneeds to access a ...
The organization I currently work for an organization that is moving into the whole CMMI world of documenting everything. I was assigned (along with one other individual) the title of Configuration Manager. Congratulations to me right. Part of the duties is to perform on a regular basis (they are still defining regula...
It sounds like you're grappling with a common challenge in configuration management and software deployment, especially in the context of CMMI (Capability Maturity Model Integration) processes. Your idea of automating the physical configuration audit is a solid approach, and it can indeed be improved or enhanced to mak...
25,409
[ { "from": "human", "value": "The organization I currently work for an organization that is moving into the whole CMMI world of documenting everything. I was assigned (along with one other individual) the title of Configuration Manager. Congratulations to me right. \nPart of the duties is to perform on a reg...
I'm looking for a simple way to grab thumbnails of FLVs in ASP.NET, without having to change any permissions/settings on the server. Ideally, nothing is installed on the server machine, but if necessary, small tools such as FFmpeg are fine. I've tried FFmpeg using the command-line tool with Process.Start, but the same ...
Generating thumbnails from FLV files in ASP.NET can be a bit tricky, especially when you're trying to avoid permission issues and want to keep it simple. Below are a few methods you can consider to achieve this goal, some of which involve using FFmpeg but with different approaches to mitigate permission issues. ### 1....
23,062
[ { "from": "human", "value": "I'm looking for a simple way to grab thumbnails of FLVs in ASP.NET, without having to change any permissions/settings on the server. Ideally, nothing is installed on the server machine, but if necessary, small tools such as FFmpeg are fine.\nI've tried FFmpeg using the command-l...
I need something like this, a collection of elements which contains no duplicates of any element. Does Common Lisp, specifically SBCL, have any thing like this?
Yes, Common Lisp provides several ways to create collections of elements that contain no duplicates. In SBCL (Steel Bank Common Lisp), you can use the following options: 1. **Sets**: Common Lisp does not have a built-in set data type, but you can use hash tables to simulate a set. You can create a hash table and use i...
21,981
[ { "from": "human", "value": "I need something like this, a collection of elements which contains no duplicates of any element. Does Common Lisp, specifically SBCL, have any thing like this? \n" }, { "from": "gpt", "value": "Yes, Common Lisp provides several ways to create collections of elements...
I use XPather Browser to check my XPATH expressions on an HTML page. My end goal is to use these expressions in Selenium for the testing of my user interfaces. I got an HTML file with a content similar to this: <tr> <td>abc</td> <td>&nbsp;</td> </tr> I want to select a node with a text containing the string "&nbs...
In HTML, `&nbsp;` is an HTML entity that represents a non-breaking space. When the HTML is parsed, `&nbsp;` does not appear as text but as a space character. Therefore, when you're trying to select the `<td>` element containing `&nbsp;` using XPath, it will not work as expected since the actual text node contains a spa...
29,493
[ { "from": "human", "value": "I use XPather Browser to check my XPATH expressions on an HTML page.\nMy end goal is to use these expressions in Selenium for the testing of my user interfaces.\nI got an HTML file with a content similar to this:\n\n<tr>\n <td>abc</td>\n <td>&nbsp;</td>\n</tr>\n\nI want to sel...
A colleague of mine states that booleans as method arguments are not acceptable. They shall be replaced by enumerations. At first I did not see any benefit, but he gave me an example. What's easier to understand? file.writeData( data, true ); Or enum WriteMode { Append, Overwrite }; file.writeData( data, Append )...
Your colleague makes a valid point, and the example illustrates a common design principle in software development: favoring readability and expressiveness in your code. Here are some considerations regarding using booleans versus enumerations as method arguments: ### Pros of Using Enumerations: 1. **Clarity**: As you'...
27,243
[ { "from": "human", "value": "A colleague of mine states that booleans as method arguments are not acceptable. They shall be replaced by enumerations. At first I did not see any benefit, but he gave me an example.\nWhat's easier to understand?\nfile.writeData( data, true );\n\nOr\nenum WriteMode {\n Append,...
I thought people would be working on little code projects together, but I don't see them, so here's an easy one: Code that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact that zip codes keep getting issued, so yo...
That's a great idea! Let's go through a simple implementation of ZIP code validation in a few different programming languages. The primary format for a valid US ZIP code is either five digits (e.g., `12345`) or nine digits with a hyphen (ZIP+4) (e.g., `12345-6789`). Here's how we can implement this validation in diffe...
19,168
[ { "from": "human", "value": "I thought people would be working on little code projects together, but I don't see them, so here's an easy one:\nCode that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact...
When using the .NET WebBrowser control how do you open a link in a new window using the the same session (ie.. do not start a new ASP.NET session on the server), or how do you capture the new window event to open the URL in the same WebBrowser control?
When using the .NET `WebBrowser` control and you want to handle link clicks that typically would open in a new window, you can intercept the events for new window requests and manage how the URL is opened. The goal is to keep the same session with the server and prevent the new ASP.NET session from being initiated. He...
25,097
[ { "from": "human", "value": "When using the .NET WebBrowser control how do you open a link in a new window using the the same session (ie.. do not start a new ASP.NET session on the server), or how do you capture the new window event to open the URL in the same WebBrowser control?\n" }, { "from": "g...