instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
For a university project I programmed a Internet Explorer Browser Helper Object to process web document information while browsing. It were running successful on Windows XP with IE6 and IE7. Now I have the issue that under Windows Vista the same BHO needs administrator rights to run. Browser and BHO running if you sta...
When transitioning your Browser Helper Object (BHO) from Windows XP to Windows Vista, you are likely encountering issues related to the User Account Control (UAC) that was introduced in Windows Vista. Here are several suggestions that can help address the issue of requiring administrator rights for your BHO to run unde...
13,488
[ { "from": "human", "value": "For a university project I programmed a Internet Explorer Browser Helper Object to process web document information while browsing. It were running successful on Windows XP with IE6 and IE7.\nNow I have the issue that under Windows Vista the same BHO needs administrator rights ...
Attempt to send a message through a socket failed with WinSock error 10038. After around 40 seconds, messages are received successfully from the same socket and subsequently the send() is also succeeding in the same socket. This behaviour has been witnessed in Windows Server 2003. Is this any known behaviour with WinSo...
The WinSock error 10038 corresponds to the error code `WSAENOTSOCK`, which indicates that an operation was attempted on a non-socket. This typically occurs if you try to perform socket operations on an invalid or improperly initialized socket descriptor. The behavior you're observing—where you initially receive the er...
16,824
[ { "from": "human", "value": "Attempt to send a message through a socket failed with WinSock error 10038. After around 40 seconds, messages are received successfully from the same socket and subsequently the send() is also succeeding in the same socket. This behaviour has been witnessed in Windows Server 200...
I've currently got multiple select's on a page that are added dynamically with ajax calls using jquery. The problem I've had is I could not get the change event to work on the added select unless I use the onchange inside the tag e.g. <select id="Size" size="1" onchange="onChange(this);"> This works, but I'm wonderin...
Yes, you can bind event handlers to dynamically added elements in jQuery using event delegation. Instead of trying to bind the event directly to the select elements after they are created, you can bind the event to a parent element that exists at the time of the binding. This way, the event will propagate from the dyna...
17,819
[ { "from": "human", "value": "I've currently got multiple select's on a page that are added dynamically with ajax calls using jquery.\nThe problem I've had is I could not get the change event to work on the added select unless I use the onchange inside the tag e.g. \n<select id=\"Size\" size=\"1\" onchange=\...
I have to develop an application using C#.net that has to be run once a day. It only runs for at most one minute, so developing a Windows service is overkill and a scheduled task is the appropriate way. However, I have a few questions about how the application can communicate its results: How do I indicate to the task...
When developing a C# application that will run as a scheduled task, you're correct in thinking about how to communicate its results and log its output. Here are answers to your questions: ### 1. Indicating Task Failure to Task Scheduler Yes, the Task Scheduler in Windows uses the application’s exit code to determine ...
14,909
[ { "from": "human", "value": "I have to develop an application using C#.net that has to be run once a day. It only runs for at most one minute, so developing a Windows service is overkill and a scheduled task is the appropriate way.\nHowever, I have a few questions about how the application can communicate i...
In C# are the nullable primitive types (i.e. bool?) just aliases for their corresponding Nullable<T> type or is there a difference between the two?
In C#, nullable primitive types like `bool?`, `int?`, `double?`, etc., are indeed shorthand for the `Nullable<T>` struct. Specifically, `bool?` is an alias for `Nullable<bool>`, `int?` is an alias for `Nullable<int>`, and so on for other primitive types. ### Key Points: 1. **Alias**: The nullable syntax (`T?`) is jus...
18,006
[ { "from": "human", "value": "In C# are the nullable primitive types (i.e. bool?) just aliases for their corresponding Nullable<T> type or is there a difference between the two?\n" }, { "from": "gpt", "value": "In C#, nullable primitive types like `bool?`, `int?`, `double?`, etc., are indeed shor...
Is there a way to get the C/C++ preprocessor or a template or such to mangle/hash the __FILE__ and __LINE__ and perhaps some other external input like a build-number into a single short number that can be quoted in logs or error messages? (The intention would be to be able to reverse it (to a list of candidates if its ...
You can create a way to hash `__FILE__`, `__LINE__`, and other input to generate a unique identifier for logging purposes in C/C++. However, reversing the hash to retrieve the original values is generally not feasible if you're using a good hashing function, as hashing is typically a one-way operation. That said, you ...
17,292
[ { "from": "human", "value": "Is there a way to get the C/C++ preprocessor or a template or such to mangle/hash the __FILE__ and __LINE__ and perhaps some other external input like a build-number into a single short number that can be quoted in logs or error messages?\n(The intention would be to be able to r...
We've looked in Silverlight 2 recently and found no way to edit formatted text there. Is this really true, and are there any (maybe commercial) external rich text editors available?
Yes, you are correct that Silverlight 2 does not natively support editing formatted text. Silverlight's text handling capabilities were somewhat limited, especially in comparison to other frameworks that offered more robust rich text editing features. While there are some workarounds using custom implementations, suc...
17,131
[ { "from": "human", "value": "We've looked in Silverlight 2 recently and found no way to edit formatted text there. Is this really true, and are there any (maybe commercial) external rich text editors available?\n" }, { "from": "gpt", "value": "Yes, you are correct that Silverlight 2 does not nat...
I'm currently working on a project for medical image processing, that needs a huge amount of memory. Is there anything I can do to avoid heap fragmentation and to speed up access of image data that has already been loaded into memory? The application has been written in C++ and runs on Windows XP. EDIT: The application...
To avoid heap fragmentation and speed up access to image data in your C++ application on Windows XP, consider the following strategies: ### 1. **Use a Custom Memory Pool** Instead of using the default heap allocator, create a custom memory pool specifically designed for your application's needs. This can help reduce ...
14,004
[ { "from": "human", "value": "I'm currently working on a project for medical image processing, that needs a huge amount of memory. Is there anything I can do to avoid heap fragmentation and to speed up access of image data that has already been loaded into memory?\nThe application has been written in C++ and...
I would like to save data in cookies (user name, email address, etc...) but I don't the user to easily read it or modify it. I need to be able able to read the data back. How can I do that with php 5.2+? It would be used for "welcome back bob" kind of feature. It is not a replacement for persistence or session storage....
Storing sensitive data in cookies, such as usernames and email addresses, should be done carefully to avoid exposing the data to potential tampering or theft. While you can encrypt the data before storing it in cookies, be mindful that cookies are inherently less secure than other storage mechanisms like sessions or da...
15,153
[ { "from": "human", "value": "I would like to save data in cookies (user name, email address, etc...) but I don't the user to easily read it or modify it. I need to be able able to read the data back. How can I do that with php 5.2+?\nIt would be used for \"welcome back bob\" kind of feature. It is not a rep...
For RMI on server-side, do we need to start rmiregistry program, or just call LocateRegistry.createRegistry? If both are possible, what are the advantages and disadvantages?
In Java RMI (Remote Method Invocation), you have two main options for starting the RMI registry on the server-side: 1. **Starting the RMI Registry using the `rmiregistry` command-line program.** 2. **Using `LocateRegistry.createRegistry(int port)` programmatically in your Java code.** ### 1. Starting the RMI Registry...
14,224
[ { "from": "human", "value": "For RMI on server-side, do we need to start rmiregistry program, or just call LocateRegistry.createRegistry? \nIf both are possible, what are the advantages and disadvantages?\n" }, { "from": "gpt", "value": "In Java RMI (Remote Method Invocation), you have two main ...
Just wondering if someone could help me with some msbuild scripts that I am trying to write. What I would like to do is copy all the files and sub folders from a folder to another folder using msbuild. {ProjectName} |----->Source |----->Tools |----->Viewer |-----{about ...
It looks like you're on the right track, but there are a couple of things to address in your MSBuild script for copying files and subfolders correctly. Here’s a modified version of your script: ```xml <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <!-- Define propert...
13,811
[ { "from": "human", "value": "Just wondering if someone could help me with some msbuild scripts that I am trying to write. What I would like to do is copy all the files and sub folders from a folder to another folder using msbuild.\n{ProjectName}\n |----->Source\n |----->Tools\n |----...
Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing into html. Within each object is a bunch of html to be output that contains a second custom tag that I would like to also be rendered....
The issue you are encountering is related to how JSP handles custom tags and how content is processed before it is sent to the client. When you embed custom tags within a string (like in `importantNotice.getMessage()`), the JSP parser does not process that string as JSP content, which means any custom tags within it ar...
10,063
[ { "from": "human", "value": "Embedded custom-tag in dynamic content (nested tag) not rendering.\nI have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing into html. Within each object is a bunch of html to be output that contains a second custom ...
I need to layout a html datatable with CSS. The actual content of the table can differ, but there is always one main column and 2 or more other columns. I'd like to make the main column take up as MUCH width as possible, regardless of its contents, while the other columns take up as little width as possible. I can't s...
You can achieve the desired layout for your HTML table using CSS by leveraging the `table-layout: auto` property along with a combination of flexible and fixed properties for the columns. The main column can be allowed to take up as much space as possible by ensuring that it is not restricted by a specific width. Meanw...
12,050
[ { "from": "human", "value": "I need to layout a html datatable with CSS. \nThe actual content of the table can differ, but there is always one main column and 2 or more other columns. I'd like to make the main column take up as MUCH width as possible, regardless of its contents, while the other columns take...
I'm reading the book "The Software Architect's Profession" by Marc and Laura Sewell (Amazon link) and it got me wondering whether a software architect is a part of the old non-agile BDUF approach. Is there a place for software architects in an agile approach? I'm especially interested in Scrum. BTW I currently am the U...
Hi Rob, Great question! The role of a software architect can indeed fit within an agile framework, including Scrum, although the way they operate may differ from traditional, non-agile approaches like Big Design Up Front (BDUF). ### Traditional vs. Agile Architecting 1. **BDUF Approach:** - In a traditional BDUF ...
16,702
[ { "from": "human", "value": "I'm reading the book \"The Software Architect's Profession\" by Marc and Laura Sewell (Amazon link) and it got me wondering whether a software architect is a part of the old non-agile BDUF approach.\nIs there a place for software architects in an agile approach? I'm especially i...
I want to know how to create a table where you can adjust the column widths. I have not figured out how to do this. If you know the secret sauce to this technique please let me know.
Creating a table with adjustable column widths can vary depending on the tool or platform you're using. Here are instructions for several common scenarios: ### 1. HTML/CSS If you're working with HTML, you can use CSS to allow for adjustable column widths. Here’s a simple example: ```html <!DOCTYPE html> <html lang="...
14,624
[ { "from": "human", "value": "I want to know how to create a table where you can adjust the column widths. I have not figured out how to do this. If you know the secret sauce to this technique please let me know.\n" }, { "from": "gpt", "value": "Creating a table with adjustable column widths can ...
Consider the following 2 queries: select tblA.a,tblA.b,tblA.c,tblA.d from tblA where tblA.a not in (select tblB.a from tblB) select tblA.a,tblA.b,tblA.c,tblA.d from tblA left outer join tblB on tblA.a = tblB.a where tblB.a is null Which will perform better? My assumption is that in general the join will be better ex...
Your assumption about the performance comparison between the two queries is generally valid, but the actual performance can depend on several factors, including the size of the tables involved, indexing, and the specific database management system (DBMS) being used. Here's a brief analysis of both queries: 1. **Subqu...
14,494
[ { "from": "human", "value": "Consider the following 2 queries:\nselect tblA.a,tblA.b,tblA.c,tblA.d\nfrom tblA\nwhere tblA.a not in (select tblB.a from tblB)\n\nselect tblA.a,tblA.b,tblA.c,tblA.d\nfrom tblA left outer join tblB\non tblA.a = tblB.a where tblB.a is null\n\nWhich will perform better? My assump...
Are there any systems out there where one can check in changes for a website and have that automatically update the website. The website effetively runs off the latest stable build the whole time without the need to ftp the files to the server.
Yes, there are several systems and methodologies that allow for automatic deployment of changes to a website without needing to manually FTP files to the server. Here are a few popular options: 1. **Version Control with Continuous Integration/Continuous Deployment (CI/CD)**: - **Git**: Use a version control system ...
14,946
[ { "from": "human", "value": "Are there any systems out there where one can check in changes for a website and have that automatically update the website. \nThe website effetively runs off the latest stable build the whole time without the need to ftp the files to the server.\n" }, { "from": "gpt", ...
I am searching for a way to compress JavaScript code for the iPhone. Is there a way to avoid using a lot of CPU time on the small and rather slow device?
When it comes to compressing JavaScript for iPhone or any other mobile devices, optimizing performance while minimizing CPU usage is essential. Here are several strategies you can use to efficiently compress your JavaScript code: 1. **Minification**: Use tools like UglifyJS, Terser, or Google Closure Compiler to minif...
13,031
[ { "from": "human", "value": "I am searching for a way to compress JavaScript code for the iPhone. Is there a way to avoid using a lot of CPU time on the small and rather slow device?\n" }, { "from": "gpt", "value": "When it comes to compressing JavaScript for iPhone or any other mobile devices, ...
There's a famous bug in Visual Studio that prevents you from using the form designer on a subclass of an abstract form. This problem has already been elucidated and solved most elegantly by Urban Potato; that's not the part I'm having trouble with. The trouble is, I have duplicated the technique described by Urban P...
It sounds like you’re experiencing a frustrating issue with Visual Studio's form designer. Here are several troubleshooting steps and ideas to help you identify and resolve the problem: 1. **Check the Output Window**: When you open the designer, have a look at the Output window in Visual Studio. It might provide some ...
15,571
[ { "from": "human", "value": "There's a famous bug in Visual Studio that prevents you from using the form designer on a subclass of an abstract form. \nThis problem has already been elucidated and solved most elegantly by Urban Potato; that's not the part I'm having trouble with. The trouble is, I have dup...
I am studying for cryptography and I somehow stuck on understanding how DES works. Because it is around for a long time there should be nice tutorials like fancy diagrams, videos etc around the net. I searched but with no luck. Has anyone spotted anything "easy-to-digest" for the brain?
Certainly! The Data Encryption Standard (DES) can be a bit challenging to grasp at first due to its intricate processes and structure. However, there are several resources that can help simplify the concepts. Here are some suggestions: ### Online Tutorials and Articles 1. **Khan Academy**: They have a good introductor...
16,057
[ { "from": "human", "value": "I am studying for cryptography and I somehow stuck on understanding how DES works. Because it is around for a long time there should be nice tutorials like fancy diagrams, videos etc around the net. I searched but with no luck. Has anyone spotted anything \"easy-to-digest\" for ...
Below is a list of locks that SQL Server 2000 is meant to support. I am a bit confused as to what the "intent" locks actually mean. I've looked around on the Web and the answers seem to be a bit cryptic. Further to getting an answer to my specific question, I am hoping to use this question as a Wiki for what each lock...
Understanding SQL Server locking mechanisms, particularly "intent" locks, can indeed be a bit complex. Let's break down what intent locks mean and then summarize the various lock types along with their purposes and circumstances under which they are acquired. ### Intent Locks Overview Intent locks are a special type o...
9,887
[ { "from": "human", "value": "Below is a list of locks that SQL Server 2000 is meant to support. I am a bit confused as to what the \"intent\" locks actually mean. I've looked around on the Web and the answers seem to be a bit cryptic. \nFurther to getting an answer to my specific question, I am hoping to us...
JavaScript doesn't seem to have a native trim() method. How can I trim white spaces at the start and end of a string with JavaScript?
Actually, JavaScript does have a native `trim()` method for strings. This method removes whitespace from both the beginning and end of a string. You can use it as follows: ```javascript let str = " Hello, World! "; let trimmedStr = str.trim(); console.log(trimmedStr); // Output: "Hello, World!" ``` If you're wor...
18,961
[ { "from": "human", "value": "JavaScript doesn't seem to have a native trim() method. How can I trim white spaces at the start and end of a string with JavaScript?\n" }, { "from": "gpt", "value": "Actually, JavaScript does have a native `trim()` method for strings. This method removes whitespace ...
In order to create the proper queries I need to be able to run a query against the same datasource that the report is using. How do I get that information programatically? Preferably the connection string or pieces of data used to build the connection string.
To programmatically retrieve the connection string or data used to build the connection string for a report, the approach can vary based on the reporting tool or framework you're using. Here are some common methods depending on the context: ### 1. **SQL Server Reporting Services (SSRS)** If you're using SSRS, you can...
15,287
[ { "from": "human", "value": "In order to create the proper queries I need to be able to run a query against the same datasource that the report is using. How do I get that information programatically? Preferably the connection string or pieces of data used to build the connection string.\n" }, { "fr...
Using sql server 2000, I would like to take my production data and put it in my test database, but I don't want to overwrite the schema of the test database as there are fields in it that I haven't added to production yet. Can this be done? I should add that these databases are on different servers.
Yes, you can transfer data from your production database to your test database without overwriting the schema, especially when they are on different servers. You can accomplish this using SQL Server Management Studio or T-SQL scripts. Here are some steps to guide you through the process: ### Option 1: Using SQL Server...
13,944
[ { "from": "human", "value": "Using sql server 2000, I would like to take my production data and put it in my test database, but I don't want to overwrite the schema of the test database as there are fields in it that I haven't added to production yet. Can this be done? I should add that these databases ar...
Does anyone have experience using makefiles for Visual Studio C++ builds (under VS 2005) as opposed to using the project/solution setup. For us, the way that the project/solutions work is not intuitive and leads to configuruation explosion when you are trying to tweak builds with specific compile time flags. Under Uni...
Using Makefiles for C++ builds in Visual Studio (especially older versions like VS 2005) is definitely an option that can help manage complex build configurations more effectively than the default project/solution setup. Here's a breakdown of your considerations and some experiences shared by others: ### Advantages of...
14,706
[ { "from": "human", "value": "Does anyone have experience using makefiles for Visual Studio C++ builds (under VS 2005) as opposed to using the project/solution setup. For us, the way that the project/solutions work is not intuitive and leads to configuruation explosion when you are trying to tweak builds wi...
I've heard many programmers, particularly Delphi programmers scorn the use of 'with'. I thought it made programs run faster (only one reference to parent object) and that it was easier to read the code if used sensibly (less than a dozen lines of code and no nesting). Here's an example: procedure TBitmap32.FillRectS(...
Using the `with` statement in programming, especially in languages like Delphi (Object Pascal), is indeed a topic of debate among developers. Here are some pros and cons regarding the use of `with`, along with reasons why many programmers advise against it: ### Pros of Using `with`: 1. **Conciseness**: It allows you t...
17,693
[ { "from": "human", "value": "I've heard many programmers, particularly Delphi programmers scorn the use of 'with'. \nI thought it made programs run faster (only one reference to parent object) and that it was easier to read the code if used sensibly (less than a dozen lines of code and no nesting).\nHere's...
I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers. The caching works great when using it from a browser. However how does the caching work when calling it from a WCF Channel Factory or .NET Web Request Objects? So in the scenario where I have my website calling the WCF restful service when...
When you're working with a WCF RESTful service and handling caching through HTTP headers like ETags and expiration headers, the behavior differs depending on the client making the request. ### How Caching Works in Different Clients 1. **Browser Clients:** - Browsers automatically handle caching based on HTTP resp...
9,658
[ { "from": "human", "value": "I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers. \nThe caching works great when using it from a browser. However how does the caching work when calling it from a WCF Channel Factory or .NET Web Request Objects?\nSo in the scenario where I have my w...
Unfortunately, there seems to be no string.Split(string separator), only string.Split(char speparator). I want to break up my string based on a multi-character separator, a la VB6. Is there an easy (that is, not by referencing Microsoft.VisualBasic or having to learn RegExes) way to do this in c#? EDIT: Using .NET Fra...
In .NET Framework 3.5, there is no built-in method for splitting a string based on a multi-character separator directly using the `string.Split` method, which only works with single-character separators. However, you can implement a simple workaround using the `String.IndexOf` method in combination with a loop to find ...
15,638
[ { "from": "human", "value": "Unfortunately, there seems to be no string.Split(string separator), only string.Split(char speparator).\nI want to break up my string based on a multi-character separator, a la VB6. Is there an easy (that is, not by referencing Microsoft.VisualBasic or having to learn RegExes) ...
There is an interesting post over here about this, in relation to cross-application flow of control. Well, recently, I've come across an interesting problem. Generating the nth value in a potentially (practically) endless recursive sequence. This particular algorithm WILL be in atleast 10-15 stack references deep at t...
Using exceptions for flow control is a topic of much debate in software development. Exceptions are designed to handle exceptional circumstances, not regular control flow. In your case, using a `SuccessException` to break out of a deeply nested recursive sequence seems like a workaround, but it doesn't align with best ...
15,706
[ { "from": "human", "value": "There is an interesting post over here about this, in relation to cross-application flow of control. \nWell, recently, I've come across an interesting problem. Generating the nth value in a potentially (practically) endless recursive sequence. This particular algorithm WILL be i...
Some of the most efficient engineers, developers and IT professionals I know usually carry around a common "toolkit" of useful programs, add-ins or utilities which help them for day-to-day debugging, developing or designing. The question is: What is in your utility toolkit.. What tools couldn't you live without?
As an AI language model, I don't have personal experiences or preferences, but I can certainly compile a list of commonly used tools and utilities that many engineers, developers, and IT professionals often find indispensable in their day-to-day work. Here's a toolkit that many may consider essential: ### Development ...
14,774
[ { "from": "human", "value": "Some of the most efficient engineers, developers and IT professionals I know usually carry around a common \"toolkit\" of useful programs, add-ins or utilities which help them for day-to-day debugging, developing or designing.\nThe question is:\nWhat is in your utility toolkit.....
I'm wandering myself what component is the best for displaying fast search results in swing. I want to create something like this, make a text field where user can enter some text, during his entering I'll improve in back end fast search on database, and I want to show data bellow the text box, and he will be able to b...
In Swing, there isn't a built-in component that directly mimics the behavior of an AJAX search with dynamic result display while typing, but you can achieve this functionality by combining a few Swing components and implementing custom logic. Below are the steps and components you can use to create a fast search featur...
8,730
[ { "from": "human", "value": "I'm wandering myself what component is the best for displaying fast search results in swing. I want to create something like this, make a text field where user can enter some text, during his entering I'll improve in back end fast search on database, and I want to show data bell...
I'd like to automate TortoiseSVN as part of a commit process. Specifically I'd like to dynamically create a log entry for the commit dialog. I know that I can launch the commit dialog either from the commandline or by right clicking on a folder and selecting svncommit. I'd like to use the start commit hook to setup a l...
Automating the log entry process for TortoiseSVN commits can be a bit tricky, especially with older versions like 1.5.3. Below are some suggestions on how to create a log entry dynamically and effectively apply it during the commit process. ### Using the Commit Hook 1. **Create the Hook Script**: Since you want to us...
6,939
[ { "from": "human", "value": "I'd like to automate TortoiseSVN as part of a commit process.\nSpecifically I'd like to dynamically create a log entry for the commit dialog.\nI know that I can launch the commit dialog either from the commandline or by right clicking on a folder and selecting svncommit.\nI'd li...
When reading my RSS feed with the Thunderbird feed reader, some entries are duplicated. Google Reader does not have the same problem. Here is the faulty feed: http://plcoder.net/rss.php?rss=Blog There is a problem, but where? I added a GUID, but the problem remains. Other feeds do not duplicate like mine, so I will do ...
It sounds like you’ve encountered a common issue with RSS feeds, where entries can appear duplicated in certain feed readers due to how the entries are structured or how unique identifiers (GUIDs) are handled. Here are some potential reasons and solutions for duplicated entries in your RSS feed: 1. **GUID Uniqueness*...
15,943
[ { "from": "human", "value": "When reading my RSS feed with the Thunderbird feed reader, some entries are duplicated. Google Reader does not have the same problem.\nHere is the faulty feed:\nhttp://plcoder.net/rss.php?rss=Blog\nThere is a problem, but where?\nI added a GUID, but the problem remains. Other fe...
I'm on .NET 2.0, running under Medium Trust (so TimeZoneInfo and the Registry are not allowed options). I'm asking the user for two dates and a time zone, and would really love to be able to automatically determine whether I need to adjust the time zone for DST. This probably isn't even a valid scenario unless I hav...
In .NET 2.0 running under Medium Trust, you're indeed limited in your ability to leverage the `TimeZoneInfo` class and some other functionality that is typically available in a full .NET environment. However, you can still handle Daylight Saving Time (DST) adjustments manually by implementing a few key steps. Here's a...
12,825
[ { "from": "human", "value": "I'm on .NET 2.0, running under Medium Trust (so TimeZoneInfo and the Registry are not allowed options). I'm asking the user for two dates and a time zone, and would really love to be able to automatically determine whether I need to adjust the time zone for DST. \nThis probabl...
I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language. The idea is that an instructor would teach a class and there would be up to 10 students in the class at a time. The instructor would be able ...
There are several open-source or free data collaboration tools that could work well for your non-profit organization's remote language classes. Here are a few recommendations: ### 1. **Jitsi Meet** - **Description:** Jitsi Meet is an open-source video conferencing tool that supports audio and text chat. You can share ...
3,817
[ { "from": "human", "value": "I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language. The idea is that an instructor would teach a class and there would be up to 10 students in the class ...
When should I choose one or the other? What are the implications regarding space and (full-text) indexing? BTW: I'm currently using SQL Server 2005 planing to upgrade to 2008 in the following months. Thanks
When deciding between different database designs or configurations, especially in the context of SQL Server (like SQL Server 2005 or 2008), it’s important to consider various factors including data storage, indexing, full-text indexing, and application requirements. Here's a breakdown of considerations to help you make...
14,417
[ { "from": "human", "value": "When should I choose one or the other? What are the implications regarding space and (full-text) indexing?\nBTW: I'm currently using SQL Server 2005 planing to upgrade to 2008 in the following months.\nThanks\n" }, { "from": "gpt", "value": "When deciding between dif...
I'm trying to return a dictionary from a function. I believe the function is working correctly, but I'm not sure how to utilize the returned dictionary. Here is the relevant part of my function: Function GetSomeStuff() ' ' Get a recordset... ' Dim stuff Set stuff = CreateObject("Scripting.Dictionary") rs.M...
It looks like you are working with a function in VBScript that returns a `Scripting.Dictionary` object. You are on the right track with your attempts to call the function and capture the returned dictionary, but there's a small nuance regarding how to properly return an object from a function in VBScript. Here’s how y...
17,060
[ { "from": "human", "value": "I'm trying to return a dictionary from a function. I believe the function is working correctly, but I'm not sure how to utilize the returned dictionary.\nHere is the relevant part of my function:\nFunction GetSomeStuff()\n '\n ' Get a recordset...\n '\n\n Dim stuff\n Set st...
The following method does not work because the inner block declares a variable of the same name as one in the outer block. Apparently variables belong to the method or class in which they are declared, not to the block in which they are declared, so I therefore can't write a short little temporary block for debugging t...
The concept you're referring to is often called "variable shadowing" or "variable hiding." In languages that support variable shadowing, a variable declared in an inner scope can have the same name as a variable in an outer scope, allowing you to temporarily override the outer variable within that inner scope. In Java...
16,398
[ { "from": "human", "value": "The following method does not work because the inner block declares a variable of the same name as one in the outer block. Apparently variables belong to the method or class in which they are declared, not to the block in which they are declared, so I therefore can't write a sho...
I notice sometimes with my parent/child objects or many-to-many relationships, I need to call either SaveOrUpdate or Merge. Usually, when I need to call SaveOrUpdate, the exception I get on calling Merge has to do with transient objects not being saved first. Please explain the difference between the two.
In Hibernate (or similar ORM frameworks), `saveOrUpdate()` and `merge()` are two methods that serve different purposes when dealing with object persistence, especially in the context of parent/child relationships or many-to-many relationships. Here’s a detailed explanation of the differences between the two: ### `save...
14,571
[ { "from": "human", "value": "I notice sometimes with my parent/child objects or many-to-many relationships, I need to call either SaveOrUpdate or Merge. Usually, when I need to call SaveOrUpdate, the exception I get on calling Merge has to do with transient objects not being saved first.\nPlease explain the...
I know that a float isn't appropriate to store currency values because of rounding errors. Is there a standard way to represent money in C++? I've looked in the boost library and found nothing about it. In java, it seems that BigInteger is the way but I couldn't find an equivalent in C++. I could write my own money cl...
In C++, there's no built-in type specifically for handling currency values like there is in Java with `BigInteger`. However, there are a few approaches you can consider for managing currency amounts accurately. Here are some options: ### 1. Use `int` or `long long` for Cents One common approach is to represent currenc...
15,773
[ { "from": "human", "value": "I know that a float isn't appropriate to store currency values because of rounding errors. Is there a standard way to represent money in C++? \nI've looked in the boost library and found nothing about it. In java, it seems that BigInteger is the way but I couldn't find an equiva...
I'm generating a ton of XML that is to be passed to an API as a post variable when a user click on a form button. I also want to be able to show the user the XML before hand. The code is sorta like the following in structure: <?php $lots of = "php"; ?> <xml> <morexml> <?php while(){ ?> <somegeneratedx...
To achieve the goal of generating the XML only once and then using it in multiple places (both for preview and in the form input), you can store the generated XML in a variable. Here's a general structure on how you can do this: 1. Generate the XML and store it in a variable. 2. Echo the variable where you need it in ...
14,732
[ { "from": "human", "value": "I'm generating a ton of XML that is to be passed to an API as a post variable when a user click on a form button. I also want to be able to show the user the XML before hand.\nThe code is sorta like the following in structure:\n<?php\n $lots of = \"php\";\n?>\n\n<xml>\n <m...
I have an Eclipse RCP app I'm working on. It has some view-specific menus and one of the menu items is an item which I would like to display a tick next to when the corresponding functionality is enabled. Similarly, the next time the item is selected, the item should become unticked to reflect that the corresponding fu...
To toggle the state of a menu item in an Eclipse RCP application, you will want to work with the `IHandler` for your menu item, but also ensure that you update the menu item's state in the UI when it is selected. Here is a step-by-step guide on how to achieve this: 1. **Define the Menu Item in Your Plugin.xml**: Make ...
12,575
[ { "from": "human", "value": "I have an Eclipse RCP app I'm working on. It has some view-specific menus and one of the menu items is an item which I would like to display a tick next to when the corresponding functionality is enabled. Similarly, the next time the item is selected, the item should become unti...
What's a good method of programatically generating etag for web pages, and is this practice recommended? Some sites recommend turning etags off, others recommend producing them manually, and some recommend leaving the default settings active - what's the best way here?
ETags (Entity Tags) are a part of HTTP and are used primarily for caching and conditional requests. They allow a web server to maintain cache validity by letting the client know if the resource it has cached has changed or not. Here's a breakdown of the considerations around ETags: ### Generating ETags 1. **Use Conte...
13,981
[ { "from": "human", "value": "What's a good method of programatically generating etag for web pages, and is this practice recommended? Some sites recommend turning etags off, others recommend producing them manually, and some recommend leaving the default settings active - what's the best way here?\n" }, ...
How to create a database using T SQL script on a specified location? Let's say, I want to create a SQL server database on D:\temp\dbFolder. How to do this?
To create a SQL Server database using T-SQL (Transact-SQL) and specify the location for the database files, you will use the `CREATE DATABASE` statement along with the `PRIMARY` filegroup and specify the file paths for the database and log files. Here's a basic example of how to create a database named `MyDatabase` w...
16,663
[ { "from": "human", "value": "How to create a database using T SQL script on a specified location? Let's say, I want to create a SQL server database on D:\\temp\\dbFolder. How to do this?\n" }, { "from": "gpt", "value": "To create a SQL Server database using T-SQL (Transact-SQL) and specify the l...
Is there any way for the main form to be able to intercept events firing on a subcontrol on a user control? I've got a custom user-control embedded in the main Form of my application. The control contains various subcontrols that manipulate data, which itself is displayed by other controls on the main form. What I'd ...
To achieve the desired behavior of notifying the main form when subcontrols change, without triggering validation inappropriately, a common approach is to utilize events in your user control. Here’s how you can structure your user control and main form to effectively handle the scenario: ### Step 1: Define Events in t...
16,173
[ { "from": "human", "value": "Is there any way for the main form to be able to intercept events firing on a subcontrol on a user control?\nI've got a custom user-control embedded in the main Form of my application. The control contains various subcontrols that manipulate data, which itself is displayed by o...
For development, I use a local LAMP stack, for production I'm using MediaTemple's Django Container (which I'm loving BTW). MT's container uses lighthttpd. Honestly I've never had any other experience with it. I've always used Apache. I've been doing some reading: Onlamp TextDrive Linux.com Here's are questions: Wh...
Lighttpd and Apache are both popular web servers, each with its strengths and weaknesses. Let’s break down your questions: ### Strengths of Lighttpd vs. Apache: 1. **Performance and Resource Usage**: - **Lighttpd**: Designed for high-performance environments and optimized for low memory consumption, especially whe...
15,493
[ { "from": "human", "value": "For development, I use a local LAMP stack, for production I'm using MediaTemple's Django Container (which I'm loving BTW). MT's container uses lighthttpd. Honestly I've never had any other experience with it. I've always used Apache. I've been doing some reading:\n\nOnlamp\nTe...
I have a client that is asking me to give them a listing of every file and folder in the source code (and then a brief explanation of the source tree). Is there an easy way to create some sort of decently formatted list like this from a subversion repository?
Yes, you can easily create a listing of all files and folders in a Subversion (SVN) repository using a few command-line tools. You can utilize the `svn list` command to get the directory structure and then format the output to provide a brief explanation of the source tree. Here’s a step-by-step guide on how to do thi...
16,185
[ { "from": "human", "value": "I have a client that is asking me to give them a listing of every file and folder in the source code (and then a brief explanation of the source tree). Is there an easy way to create some sort of decently formatted list like this from a subversion repository?\n" }, { "fr...
Using the following query and results, I'm looking for the most recent entry where the ChargeId and ChargeType are unique. select chargeId, chargeType, serviceMonth from invoice CHARGEID CHARGETYPE SERVICEMONTH 1 101 R 8/1/2008 2 161 N 2/1/2008 3 101 R ...
To obtain the most recent entry for each unique combination of `ChargeId` and `ChargeType`, you can use the following SQL query. This query utilizes the `ROW_NUMBER()` function to rank the rows by `ServiceMonth` within each unique group of `ChargeId` and `ChargeType`, and then selects the most recent entries: ```sql W...
17,611
[ { "from": "human", "value": "Using the following query and results, I'm looking for the most recent entry where the ChargeId and ChargeType are unique.\nselect chargeId, chargeType, serviceMonth from invoice\n\n CHARGEID CHARGETYPE SERVICEMONTH\n1 101 R 8/1/2008\n2 161 N...
I need to generate random numbers in the range 1 - 10000 continuously with out duplication. Any recommendations? Description: we are building a new version for our application, which maintains records in Sqlite DB. in the last version of our application, we did not had unique key for each record. But now with new upgr...
To generate random numbers in the range of 1 to 10,000 continuously without duplication, you'll need a method to keep track of the numbers you've already generated. One effective approach is to shuffle a list of all possible numbers within your range and then iterate through them. Here's how you can do this in Python: ...
17,273
[ { "from": "human", "value": "I need to generate random numbers in the range 1 - 10000 continuously with out duplication. \nAny recommendations?\nDescription: we are building a new version for our application, which maintains records in Sqlite DB. in the last version of our application, we did not had unique...
I am trying to upgrade an named instance of MSDE to SQL Server 2008 Express. When I get to the "Select Features" page of the 2008 installer there are no instances listed. The upgrade to SQL Server 2005 Express (on the same VM image) however works fine. It seems to be a supported scenario (http://msdn.microsoft.com/en...
Upgrading from MSDE to SQL Server 2008 Express can be a bit tricky due to various factors. Here are some steps and considerations that may help you troubleshoot and successfully perform the upgrade: 1. **Check Compatibility**: Ensure that the version of MSDE you are using is compatible for upgrading to SQL Server 2008...
11,019
[ { "from": "human", "value": "I am trying to upgrade an named instance of MSDE to SQL Server 2008 Express. When I get to the \"Select Features\" page of the 2008 installer there are no instances listed. The upgrade to SQL Server 2005 Express (on the same VM image) however works fine.\nIt seems to be a supp...
We have a SQUID reverse proxy and a MOSS 2007 portal. All sites are using NTLM. We cannot get it working with SQUID as a reverse proxy. Any ideas where to start?
When configuring a Squid reverse proxy with NTLM authentication for a Microsoft SharePoint 2007 (MOSS) portal, there are several important steps and considerations to keep in mind. Here’s a structured approach to help troubleshoot and potentially resolve your issues. ### 1. **Basic Configuration of Squid** Ensure that...
10,920
[ { "from": "human", "value": "\nWe have a SQUID reverse proxy and a MOSS 2007 portal. All sites are using NTLM.\nWe cannot get it working with SQUID as a reverse proxy.\n\nAny ideas where to start?\n" }, { "from": "gpt", "value": "When configuring a Squid reverse proxy with NTLM authentication fo...
I am working on a Sharepoint Server 2007 State machine Workflow. Until now I have a few states and a custom Association/InitiationForm which I created with InfoPath 2007. In Addition I have a few modification forms. I have a Problem with the removing of the modification link in the state-page of my workflow. I have a ...
In SharePoint Server 2007 State Machine Workflows, the management of modification links can sometimes be tricky due to the way that the `EnableWorkflowModification` and `OnWorkflowModification` activities interact. Here are some troubleshooting steps and considerations that might help you resolve the issue with the mod...
15,902
[ { "from": "human", "value": "I am working on a Sharepoint Server 2007 State machine Workflow. Until now I have a few states and a custom Association/InitiationForm which I created with InfoPath 2007. In Addition I have a few modification forms. I have a Problem with the removing of the modification link in ...
I have a FinalBuilder project where I deploy an ASP.Net website to a remote folder, configured as a website in IIS. As part of my build script, I want to use the FinalBuilder action HTTP Get File to help determine whether my deployment was succesful. I'm having difficulty, because the website is configured (under IIS 6...
It seems like you're facing an issue with integrated Windows authentication in IIS 6 when trying to perform an HTTP GET request using FinalBuilder. Since the HTTP Get File action in FinalBuilder does not support integrated Windows authentication directly, you might consider a couple of workarounds to achieve your goal:...
14,274
[ { "from": "human", "value": "I have a FinalBuilder project where I deploy an ASP.Net website to a remote folder, configured as a website in IIS.\nAs part of my build script, I want to use the FinalBuilder action HTTP Get File to help determine whether my deployment was succesful.\nI'm having difficulty, bec...
I have seen a lot of C/C++ based solutions to this problem where we have to write a program that upon execution prints its own source. some solutions -- http://www.cprogramming.com/challenges/solutions/self_print.html Quine Page solution in many languages There are many more solutions on the net, each different from t...
Creating a self-replicating program, commonly known as a quine, is a fascinating exercise in programming, especially in compiled languages like C and C++. The challenge is to craft a program that outputs its own source code without using external files or system calls to read itself. Here’s a breakdown of how one might...
14,218
[ { "from": "human", "value": "I have seen a lot of C/C++ based solutions to this problem where we have to write a program that upon execution prints its own source. \nsome solutions --\nhttp://www.cprogramming.com/challenges/solutions/self_print.html\nQuine Page solution in many languages\nThere are many mor...
What is the difference between these two pieces of code type IInterface1 = interface procedure Proc1; end; IInterface2 = interface procedure Proc2; end; TMyClass = class(TInterfacedObject, IInterface1, IInterface2) protected procedure Proc1; procedure Proc2; end; And the following : typ...
You are correct in observing that the two pieces of code you provided differ in their implementation of interfaces and their hierarchy. Let's break down the differences, the implications, and any advantages or readability issues associated with each approach. ### First Example In the first example: ```pascal type ...
14,786
[ { "from": "human", "value": "What is the difference between these two pieces of code\ntype\n IInterface1 = interface\n procedure Proc1;\n end;\n\n IInterface2 = interface\n procedure Proc2;\n end;\n\n TMyClass = class(TInterfacedObject, IInterface1, IInterface2)\n protected\n procedure Proc1;...
When using regular expressions we generally, if not always use them to extract some kind of information. What I need is to replace the match value with some other value... Right now I'm doing this... def getExpandedText(pattern, text, replaceValue): """ One liner... really ugly but it's only used in here. ...
Yes, you can definitely use Python's `re` module to replace matches of a regular expression with a specific replacement string. The function `re.sub()` is designed specifically for this purpose. Here's how you can modify your function to use `re.sub()` for replacing the matched pattern with a given value: ```python i...
17,981
[ { "from": "human", "value": "When using regular expressions we generally, if not always use them to extract some kind of information. What I need is to replace the match value with some other value... \nRight now I'm doing this...\ndef getExpandedText(pattern, text, replaceValue):\n \"\"\"\n One l...
I'm writing an RSS to JSON parser and as a part of that, I need to use htmlentities() on any tag found inside the description tag. Currently, I'm trying to use preg_replace(), but I'm struggling a little with it. My current (non-working) code looks like: $pattern[0] = "/\<description\>(.*?)\<\/description\>/is"; $repla...
Using `preg_replace()` with backreferences in the replacement string is not straightforward, as PHP does not allow you to use a function like `htmlentities()` directly within the replacement string. Instead, you can use a callback function with `preg_replace_callback()` to achieve the desired behavior. This approach al...
17,164
[ { "from": "human", "value": "I'm writing an RSS to JSON parser and as a part of that, I need to use htmlentities() on any tag found inside the description tag. Currently, I'm trying to use preg_replace(), but I'm struggling a little with it. My current (non-working) code looks like:\n$pattern[0] = \"/\\<des...
I'm trying to set the width and height of an element with javascript to cover the entire browser viewport, and I'm successful using document.body.clientHeight but in IE6 it seems that I always get horizontal and vertical scrollbars because the element must be slightly too big. Now, I really don't want to use browser s...
To create a JavaScript solution that sets the width and height of an element to cover the entire browser viewport, including support for older browsers like IE6, you can use the following approach: 1. **Use `window.innerWidth` and `window.innerHeight` for modern browsers.** 2. **For older browsers (like IE6), fall bac...
14,913
[ { "from": "human", "value": "I'm trying to set the width and height of an element with javascript to cover the entire browser viewport, and I'm successful using document.body.clientHeight but in IE6 it seems that I always get horizontal and vertical scrollbars because the element must be slightly too big. \...
I need a very accurate way to time parts of my program. I could use the regular high-resolution clock for this, but that will return wallclock time, which is not what I need: I needthe time spent running only my process. I distinctly remember seeing a Linux kernel patch that would allow me to time my processes to nanos...
It sounds like you're looking for a way to measure CPU time used by your process with higher precision than what traditional system calls like `times()`, `clock()`, or `getrusage()` provide. The feature you might be referring to is likely related to the **Linux High Resolution Timer (hrtimers)** and the **`sched_cloc...
15,867
[ { "from": "human", "value": "I need a very accurate way to time parts of my program. I could use the regular high-resolution clock for this, but that will return wallclock time, which is not what I need: I needthe time spent running only my process.\nI distinctly remember seeing a Linux kernel patch that wo...
Suppose I have a database table with two fields, "foo" and "bar". Neither of them are unique, but each of them are indexed. However, rather than being indexed together, they each have a separate index. Now suppose I perform a query such as SELECT * FROM sometable WHERE foo='hello' AND bar='world'; My table a huge nu...
Most modern relational database management systems (RDBMS), including Oracle, MySQL, PostgreSQL, and SQL Server, employ sophisticated query optimization techniques. When you run a query like `SELECT * FROM sometable WHERE foo='hello' AND bar='world';`, the query optimizer evaluates various execution plans to determine ...
16,140
[ { "from": "human", "value": "Suppose I have a database table with two fields, \"foo\" and \"bar\". Neither of them are unique, but each of them are indexed. However, rather than being indexed together, they each have a separate index.\nNow suppose I perform a query such as SELECT * FROM sometable WHERE fo...
I'm trying to pass in a Base64 string into a C#.Net web application via the QueryString. When the string arrives the "+" (plus) sign is being replaced by a space. It appears that the automatic URLDecode process is doing this. I have no control over what is being passed via the QueryString. Is there any way to handle th...
You're correct that the behavior you're observing stems from the way URL encoding works. In URLs, the `+` character is interpreted as a space when the query string is decoded. Unfortunately, since you do not have control over the request that is being made, this can lead to issues when passing Base64 strings in the que...
16,241
[ { "from": "human", "value": "I'm trying to pass in a Base64 string into a C#.Net web application via the QueryString. When the string arrives the \"+\" (plus) sign is being replaced by a space. It appears that the automatic URLDecode process is doing this. I have no control over what is being passed via the...
I am creating an installer in IzPack. It is quite large, and I have broken up my XML files appropriately using <xinclude> and <xfragment> tags. Unfortunately, IzPack does not combine them together when you build your installer. This requires you to package the files with the installer, which just won't work. I was abo...
As of my last knowledge update in October 2023, Java's standard libraries (like the ones in `javax.xml`) do not provide built-in support for XInclude. This means that if you want to combine your XML files using XInclude, you will indeed need to implement this functionality yourself or rely on external libraries. Howev...
8,163
[ { "from": "human", "value": "I am creating an installer in IzPack. It is quite large, and I have broken up my XML files appropriately using <xinclude> and <xfragment> tags. Unfortunately, IzPack does not combine them together when you build your installer. This requires you to package the files with the ins...
It seems obvious that some people have been able to figure out how to access the iPhone camera through the SDK (Spore Origins, for example). How can this be done?
To access the iPhone camera through the SDK, developers typically use the APIs provided by Apple's iOS SDK. Here’s a general overview of how this can be achieved: ### Using AVFoundation Framework 1. **Import the Framework**: Make sure to import the AVFoundation framework in your project. This is the main framework th...
13,019
[ { "from": "human", "value": "It seems obvious that some people have been able to figure out how to access the iPhone camera through the SDK (Spore Origins, for example). How can this be done?\n" }, { "from": "gpt", "value": "To access the iPhone camera through the SDK, developers typically use t...
Does anyone know if there is a good equivalent to Java's Set collection in C#? I know that you can somewhat mimic a set using a Dictionary or a HashTable by populating but ignoring the values, but that's not a very elegant way.
Yes, C# has a built-in collection that is a good equivalent to Java's `Set`: the `HashSet<T>` class. The `HashSet<T>` class is part of the `System.Collections.Generic` namespace and provides a collection that contains unique elements, which is exactly what you want when working with a set. It offers set operations li...
16,757
[ { "from": "human", "value": "Does anyone know if there is a good equivalent to Java's Set collection in C#? I know that you can somewhat mimic a set using a Dictionary or a HashTable by populating but ignoring the values, but that's not a very elegant way. \n" }, { "from": "gpt", "value": "Yes, ...
A table in my area of responsibility of our product has been criticised as having more than one orthogonal index. What is an orthogonal index? Why is it bad? How can the situation be avoided? --Update-- The back-end database engine isn't necessarily relevant here as our application is database-agnostic. But if it helps...
An **orthogonal index** is not a standard term in database management but is likely used in your context to refer to the presence of multiple indexes that cover different dimensions or aspects of the data, potentially leading to performance issues or redundancy. ### What is an Orthogonal Index? In database design, th...
14,086
[ { "from": "human", "value": "A table in my area of responsibility of our product has been criticised as having more than one orthogonal index.\nWhat is an orthogonal index?\nWhy is it bad?\nHow can the situation be avoided?\n--Update--\nThe back-end database engine isn't necessarily relevant here as our app...
Does anyone know how I can get a format string to use bankers rounding? I have been using "{0:c}" but that doesn't round the same way that bankers rounding does. The Math.Round() method does bankers rounding. I just need to be able to duplicate how it rounds using a format string. Note: the original question was rath...
Bankers rounding, also known as round half to even, is not directly supported in .NET format strings like `"{0:c}"`. However, you can achieve your goal by explicitly using the `Math.Round()` method with the appropriate rounding mode, and then converting the result to a string format you desire. Here’s how you can impl...
17,436
[ { "from": "human", "value": "Does anyone know how I can get a format string to use bankers rounding? I have been using \"{0:c}\" but that doesn't round the same way that bankers rounding does. The Math.Round() method does bankers rounding. I just need to be able to duplicate how it rounds using a format str...
Note: not ASP.NET. I've read about various methods including using SOAPClient (is this part of the standard Windows 2003 install?), ServerXMLHTTP, and building up the XML from scratch and parsing the result manually. Has anyone ever done this? What did you use and would you recommend it?
When it comes to consuming web services in older systems like Windows Server 2003, there are indeed several methods you could use to make HTTP requests and handle XML responses. Here are some popular approaches, along with their pros and cons: ### 1. **MSXML ServerXMLHTTP** **Pros:** - Part of the Microsoft XML Core ...
12,572
[ { "from": "human", "value": "Note: not ASP.NET.\nI've read about various methods including using SOAPClient (is this part of the standard Windows 2003 install?), ServerXMLHTTP, and building up the XML from scratch and parsing the result manually.\nHas anyone ever done this? What did you use and would you r...
We use Hudson as a continuous integration system to execute automated builds (nightly and based on CVS polling) of a lot of our projects. Some projects poll CVS every 15 minutes, some others poll every 5 minutes and some poll every hour. Every few weeks we'll get a build that fails with the following output: FATAL: jav...
The error message you're encountering, `java.io.IOException: Too many open files`, suggests that your Hudson (now known as Jenkins) server is hitting the file descriptor limit set by the operating system. This issue can arise from several causes, especially in an environment with many concurrent jobs, like yours, where...
13,744
[ { "from": "human", "value": "We use Hudson as a continuous integration system to execute automated builds (nightly and based on CVS polling) of a lot of our projects.\nSome projects poll CVS every 15 minutes, some others poll every 5 minutes and some poll every hour.\nEvery few weeks we'll get a build that ...
is there an if statement when it comes to mysql query statements? when i am updating a table record, i want to only update certain columns if they have a value to be updated. for example, i want an update table function, and there is a table for volunteers and a table for people who just want email updates. i want to u...
Yes, you can use a single SQL query to conditionally update specific columns based on whether values are provided. While MySQL doesn't have a built-in `IF` statement that directly works for this within the `UPDATE` statement, you can achieve the desired effect by using `COALESCE` or `CASE` statements to handle optional...
17,030
[ { "from": "human", "value": "is there an if statement when it comes to mysql query statements?\nwhen i am updating a table record, i want to only update certain columns if they have a value to be updated.\nfor example, i want an update table function, and there is a table for volunteers and a table for peop...
Mac OS X ships with apache pre-installed, but the files are in non-standard locations. This question is a place to collect information about where configuration files live, and how to tweak the apache installation to do things like serve php pages.
Indeed, macOS (formerly known as Mac OS X) comes with Apache pre-installed, but the configuration files and directories are located in some non-standard locations compared to other Unix-like operating systems. Here’s a guide to help you understand the structure and tweak your Apache installation on macOS to serve PHP p...
8,079
[ { "from": "human", "value": "Mac OS X ships with apache pre-installed, but the files are in non-standard locations. This question is a place to collect information about where configuration files live, and how to tweak the apache installation to do things like serve php pages.\n" }, { "from": "gpt"...
I want to compare the current value of an in-memory Hibernate entity with the value in the database: HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id...
The problem you're encountering is a common issue when working with Hibernate sessions and entity state management. Let's break down the issues you're facing and offer a suitable solution. ### Issue 1: Same Entity Instance in Memory In your original code snippet, both `newEntity` and `oldEntity` are referring to the ...
16,156
[ { "from": "human", "value": "I want to compare the current value of an in-memory Hibernate entity with the value in the database:\nHibernateSession sess = HibernateSessionFactory.getSession();\nMyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id);\nnewEntity.setProperty(\"new value\");\nMyEntity old...
I've just got a fresh Drupal 6 install. The CSS didn't work. Then I realized that a "?U" was appended, and Drupal couldn't find it. Does anyone know where to unset this? <link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?U" /> <link type="text/css" rel="stylesheet" media="all" href="/m...
In Drupal 6, the "?U" appended to your CSS files indicates that the "cache" functionality is likely enabled. This is intended for performance reasons, allowing Drupal to serve cached versions of stylesheets and scripts. However, in some cases, this can lead to issues with the stylesheets not being found. Here are a fe...
17,757
[ { "from": "human", "value": "I've just got a fresh Drupal 6 install. The CSS didn't work. Then I realized that a \"?U\" was appended, and Drupal couldn't find it. Does anyone know where to unset this? \n<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"/modules/node/node.css?U\" />\n<link ...
How can we connect a PHP script to MS Access (.mdb) file? I tried by including following PHP code: $db_path = $_SERVER['DOCUMENT_ROOT'] . '\WebUpdate\\' . $file_name . '.mdb'; $cfg_dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" . $db_path; $odbcconnect = odbc_connect($cfg_dsn, '', ''); But it failed and I recei...
Connecting a PHP script to an MS Access (.mdb) file can be a bit tricky, especially since the PHP ODBC extension may not have the necessary drivers installed or properly configured on your server. Here’s a step-by-step approach to successfully connect to an MS Access database using PHP: ### 1. Ensure ODBC Driver is In...
13,991
[ { "from": "human", "value": "How can we connect a PHP script to MS Access (.mdb) file?\nI tried by including following PHP code:\n$db_path = $_SERVER['DOCUMENT_ROOT'] . '\\WebUpdate\\\\' . $file_name . '.mdb';\n$cfg_dsn = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" . $db_path;\n$odbcconnect = odbc_con...
Say I have a page that display search results. I search for stackoverflow and it returns 5000 results, 10 per page. Now I find myself doing this when building links on that page: <%=Html.ActionLink("Page 1", "Search", new { query=ViewData["query"], page etc..%> <%=Html.ActionLink("Page 2", "Search", new { query=ViewDat...
What you're looking to do is indeed a common requirement in web development, particularly when creating pagination links where you want to maintain the current search parameters while only changing a subset of them (like the page number). To achieve this in ASP.NET MVC, you can create a helper method that will build y...
15,063
[ { "from": "human", "value": "Say I have a page that display search results. I search for stackoverflow and it returns 5000 results, 10 per page. Now I find myself doing this when building links on that page:\n<%=Html.ActionLink(\"Page 1\", \"Search\", new { query=ViewData[\"query\"], page etc..%>\n<%=Html.A...
Ok I followed the steps for setting up ruby and rails on my Vista machine and I am having a problem connecting to the database. Contents of database.yml development: adapter: sqlserver database: APPS_SETUP Host: WindowsVT06\SQLEXPRESS Username: se Password: paswd Run rake db:migrate from myapp directory ----...
It looks like you're encountering issues connecting to SQL Server with your Ruby on Rails application, particularly with the ActiveRecord SQL Server adapter. Here are some steps and considerations to help you resolve the "no such file to load -- deprecated" error and potentially get your application up and running: 1....
14,278
[ { "from": "human", "value": "Ok I followed the steps for setting up ruby and rails on my Vista machine and I am having a problem connecting to the database.\nContents of database.yml\ndevelopment:\n adapter: sqlserver\n database: APPS_SETUP\n Host: WindowsVT06\\SQLEXPRESS\n Username: se\n Password: pas...
I'm using DirectMusic for MIDI playback in an application I'm developing. Does anyone know if it's possible to use DirectMusic to play individual notes? Currently, I'm converting an in-memory data structure that represents entire 'songs' into a MIDI buffer and playing it back through DirectMusic. I'd like to be able to...
DirectMusic is primarily designed for handling complex MIDI sequences and playback, which means it is typically focused on playing entire tracks or songs rather than individual notes directly. However, you can play individual notes using the `IDirectMusicPerformance` interface to send MIDI messages directly, which may ...
16,058
[ { "from": "human", "value": "I'm using DirectMusic for MIDI playback in an application I'm developing. Does anyone know if it's possible to use DirectMusic to play individual notes? Currently, I'm converting an in-memory data structure that represents entire 'songs' into a MIDI buffer and playing it back th...
I'm creating an XML Document in JavaScript on the client side, and then transforming it back to a string to send to the server. Mozilla has a handy method to accomplish this: XMLSerializer().serializeToString(), which I'm using. However, there seems to be a bug in this method: it returns all node names in uppercase and...
The behavior you're experiencing with `XMLSerializer().serializeToString()` in Firefox is indeed a quirk of that browser's implementation of the DOM. While the specification does not dictate that node names should be case-insensitive, some browsers handle XML in this manner. Unfortunately, there is no built-in workaro...
13,506
[ { "from": "human", "value": "I'm creating an XML Document in JavaScript on the client side, and then transforming it back to a string to send to the server. Mozilla has a handy method to accomplish this: XMLSerializer().serializeToString(), which I'm using. However, there seems to be a bug in this method: i...
I am trying to install newgem on my linux box (sudo gem install newgem) and i am getting the following error: Building native extensions. This could take a while... ERROR: Error installing newgem: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb install newgem extconf.rb:1:in `require': no su...
The error message indicates that the Ruby gem you're trying to install requires native extensions to be built, but it is failing due to a missing dependency. Specifically, the `LoadError` for `mkmf` suggests that the Ruby development libraries are not installed on your system. To resolve this issue, follow these steps...
16,669
[ { "from": "human", "value": "I am trying to install newgem on my linux box (sudo gem install newgem) and i am getting the following error:\nBuilding native extensions. This could take a while...\nERROR: Error installing newgem:\nERROR: Failed to build gem native extension.\n\n/usr/bin/ruby1.8 extconf.rb i...
What is the proper way to inject a data access dependency when I do lazy loading? For example I have the following class structure class CustomerDao : ICustomerDao public Customer GetById(int id) {...} class Transaction { int customer_id; //Transaction always knows this value Customer _customer = null; ICustom...
In your scenario, you are considering the proper way to inject a data access dependency while using lazy loading in the `Transaction` class. You're correct that there are several design considerations, and it's important to balance principles like Separation of Concerns (SoC) and keeping your classes clean and maintain...
13,406
[ { "from": "human", "value": "What is the proper way to inject a data access dependency when I do lazy loading?\nFor example I have the following class structure\nclass CustomerDao : ICustomerDao\n public Customer GetById(int id) {...}\n\nclass Transaction {\n int customer_id; //Transaction always knows th...
I need to convert a (possibly) null terminated array of ascii bytes to a string in C# and the fastest way I've found to do it is by using my UnsafeAsciiBytesToString method shown below. This method uses the String.String(sbyte*) constructor which contains a warning in it's remarks: "The value parameter is assumed to po...
You are right to be cautious about using the `String.String(sbyte*)` constructor due to the potential issues with system-dependent behavior and non-null-terminated strings. While it may provide performance benefits, it comes with significant risks, including possible access violations if the input isn't properly null-t...
12,174
[ { "from": "human", "value": "I need to convert a (possibly) null terminated array of ascii bytes to a string in C# and the fastest way I've found to do it is by using my UnsafeAsciiBytesToString method shown below. This method uses the String.String(sbyte*) constructor which contains a warning in it's remar...
Try running these two simple statements on Oracle 10.2: CREATE TABLE mytest (table_name varchar2(30), index_name varchar2(30), column_expression clob, column_position number); INSERT INTO mytest (table_name, index_name, column_expression, column_position) SELECT table_name, index_name, ...
The error you are encountering, `ORA-00932: inconsistent datatypes: expected - got LONG`, is due to the fact that the `column_expression` column in the `user_ind_expressions` view is of type `LONG`, while you are attempting to insert it into a `CLOB` column in your `mytest` table. Here's a breakdown of what's happenin...
15,495
[ { "from": "human", "value": "Try running these two simple statements on Oracle 10.2:\nCREATE TABLE mytest\n (table_name varchar2(30), \n index_name varchar2(30), \n column_expression clob,\n column_position number);\n\nINSERT INTO mytest \n (table_name,\n index_name,\n column_expression, \n c...
We're living in a golden age of databases, with numerous high quality commercial and free databases. This is great, but the downside is there's not a simple obvious choice for someone who needs a database for his next project. What are the constraints/criteria you use for selecting a database? How well do the various...
Selecting a database for a project can indeed be overwhelming given the wide variety of options available today. Here are some constraints and criteria you might consider when choosing a database, along with how different databases might meet these criteria and some recommendations based on experience. ### Constraints...
8,702
[ { "from": "human", "value": "We're living in a golden age of databases, with numerous high quality commercial and free databases. This is great, but the downside is there's not a simple obvious choice for someone who needs a database for his next project.\n\nWhat are the constraints/criteria you use for se...
I wanted to use fstream to read a txt file. I am using inFile >> characterToConvert, but the problem is that this omits any spaces and newline. I am writing an encryption program so I need to include the spaces and newlines. What would be the proper way to go about accomplishing this?
To read a text file while preserving spaces and newlines, you should use `std::getline()` instead of the extraction operator (`>>`). The extraction operator reads data up to whitespace, which is why you're losing spaces and newlines. Here's an example of how to read a text file line by line using `std::getline()`, whi...
13,967
[ { "from": "human", "value": "I wanted to use fstream to read a txt file.\nI am using inFile >> characterToConvert, but the problem is that this omits any spaces and newline.\nI am writing an encryption program so I need to include the spaces and newlines.\nWhat would be the proper way to go about accomplish...
Since I didn't do a good job writing the last question, and most of the answers were good, but not at all in the direction I intended for the question to go in, I deleted it and remade it as this question. I'm a solo developer on my own projects, generally very small things, but I have a few ideas that might turn into ...
As a solo developer, you have the flexibility to choose a process that best suits your working style, project type, and the goals you want to achieve. Here are some common approaches you can consider, along with their applicability to solo projects: ### 1. **Agile Methodologies** Agile practices can be particularly b...
15,616
[ { "from": "human", "value": "Since I didn't do a good job writing the last question, and most of the answers were good, but not at all in the direction I intended for the question to go in, I deleted it and remade it as this question.\nI'm a solo developer on my own projects, generally very small things, bu...
Given this data: CREATE TABLE tmpTable( fldField varchar(10) null); INSERT INTO tmpTable SELECT 'XXX' UNION ALL SELECT 'XXX' UNION ALL SELECT 'ZZZ' UNION ALL SELECT 'ZZZ' UNION ALL SELECT 'YYY' SELECT CASE WHEN fldField like 'YYY' THEN 'OTH' ELSE 'XXX' END AS newField FROM tmpTable The expected resultset is: XXX...
The behavior you're experiencing with your SQL query and the `LIKE` clause may depend on a few different factors in SQL Server 2000. While your SQL query looks correct and should return the expected results in most cases, here are some potential situations that could cause SQL Server not to match 'YYY' in the `LIKE` cl...
13,393
[ { "from": "human", "value": "Given this data:\nCREATE TABLE tmpTable(\nfldField varchar(10) null);\n\nINSERT INTO tmpTable\nSELECT 'XXX'\nUNION ALL \nSELECT 'XXX'\nUNION ALL\nSELECT 'ZZZ'\nUNION ALL\nSELECT 'ZZZ'\nUNION ALL\nSELECT 'YYY'\n\nSELECT\nCASE WHEN fldField like 'YYY' THEN 'OTH' ELSE 'XXX' END ...
I'm seeing this error several times an hour on my production site and am not quite sure how to fix it. I've grepped the source code and I am not using "../" anywhere in my code to generate a path. My application is running on IIS6 on Win2003 Server. It's using URLRewriter.Net to allow the site to have friendly URLs, an...
Based on the information you've provided, it seems like you're encountering path-related issues in your ASP.NET application, possibly due to how URLs are being rewritten by URLRewriter.Net or how certain resources are being referenced. Here are some steps you can take to diagnose and potentially resolve the issue: 1....
16,051
[ { "from": "human", "value": "I'm seeing this error several times an hour on my production site and am not quite sure how to fix it. I've grepped the source code and I am not using \"../\" anywhere in my code to generate a path.\nMy application is running on IIS6 on Win2003 Server. It's using URLRewriter.Net...
For example, Reductio (for Java/Scala) and QuickCheck (for Haskell). The kind of framework I'm thinking of would provide "generators" for built-in data types and allow the programmer to define new generators. Then, the programmer would define a test method that asserts some property, taking variables of the appropria...
Yes, what you're describing sounds very much like property-based testing, which is indeed a popular testing methodology used in functional programming languages and beyond. Property-based testing frameworks, like QuickCheck for Haskell and ScalaCheck for Scala, allow developers to define properties that their code shou...
17,277
[ { "from": "human", "value": "For example, Reductio (for Java/Scala) and QuickCheck (for Haskell). The kind of framework I'm thinking of would provide \"generators\" for built-in data types and allow the programmer to define new generators. Then, the programmer would define a test method that asserts some ...
I want the search box on my web page to display the word "Search" in gray italics. When the box receives focus, it should look just like an empty text box. If there is already text in it, it should display the text normally (black, non-italics). This will help me avoid clutter by removing the label. BTW, this is an on-...
To achieve the functionality you described for your search box, you can use HTML, CSS, and JavaScript. Below is a simple implementation that fulfills your requirements: ### HTML ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-sca...
8,666
[ { "from": "human", "value": "I want the search box on my web page to display the word \"Search\" in gray italics. When the box receives focus, it should look just like an empty text box. If there is already text in it, it should display the text normally (black, non-italics). This will help me avoid clutter...
I need to serialize the System.Configuration.SettingsContext and System.Configuration.SettingsPropertyCollection types as i am implementing my own profile provider. Any suggestions on how to do it in the most simplest way.
To serialize the `System.Configuration.SettingsContext` and `System.Configuration.SettingsPropertyCollection` types, you typically need to create a custom serialization process since these classes do not implement the `ISerializable` interface and thus can't be serialized directly. Below are the steps to serialize and ...
14,392
[ { "from": "human", "value": "I need to serialize the System.Configuration.SettingsContext and System.Configuration.SettingsPropertyCollection types as i am implementing my own profile provider. Any suggestions on how to do it in the most simplest way.\n" }, { "from": "gpt", "value": "To serializ...
A customer of ours has Quickbooks 2005 and is looking to have their web data (orders, customers, tax) sent as it is collected from the web in a format that can be imported into Quickbooks 2005 Pro. Does anyone have any experience with this? If so, what was your experience, and what component/method would you recomme...
Integrating web data with QuickBooks 2005 can be a challenge due to the software's age and limitations, especially regarding newer file formats and online APIs. However, here are some methods and components you might consider for importing web data (orders, customers, tax) into QuickBooks 2005 Pro: ### 1. **Exporting ...
13,916
[ { "from": "human", "value": "A customer of ours has Quickbooks 2005 and is looking to have their web data (orders, customers, tax) sent as it is collected from the web in a format that can be imported into Quickbooks 2005 Pro. \nDoes anyone have any experience with this? If so, what was your experience, a...
I've build my WinForm app on windows machine and the app is working ok. When I user nhibernate 1.2.1 the app also worked on linux machine using mono, but now when i upgraded app to nhibernate 2.0.1 it works only in windows. I've get error: NHibernate.InvalidProxyTypeException: The following types may not be used as pr...
The error you're encountering is due to NHibernate's requirement for certain methods to be declared as `virtual` in order to enable proxy creation. This is necessary for NHibernate to create dynamic proxies for lazy loading purposes. In your case, the error message specifically mentions that the method `obj_address` ...
14,873
[ { "from": "human", "value": "I've build my WinForm app on windows machine and the app is working\nok. When I user nhibernate 1.2.1 the app also worked on linux machine\nusing mono, but now when i upgraded app to nhibernate 2.0.1 it works\nonly in windows.\nI've get error:\n NHibernate.InvalidProxyTypeExcept...
Okay, that may not be the best subject... I am setting up an approval workflow within an application. I pass the username and the dollar amount to the subprocedure and figure out what workflow I need to use for the approval process. I thought I had this working until I try to handle the condition when the user hasn't b...
Your approach to handling the approval workflow for users is on the right track, but it looks like there might be some confusion in the logic related to handling the case when a user is not set up in your table. Here’s a clearer breakdown of how to accomplish what you need, especially when it comes to checking if a us...
15,863
[ { "from": "human", "value": "Okay, that may not be the best subject...\nI am setting up an approval workflow within an application. I pass the username and the dollar amount to the subprocedure and figure out what workflow I need to use for the approval process. I thought I had this working until I try to h...
What is the simplest way (least error-prone, least lines of code, however you want to interpret it) to open a file in C and read its contents into a string (char*, char[], whatever)?
The simplest way to open a file in C and read its contents into a string can be done using the standard library functions. Below is a concise example that accomplishes this task. It reads the entire file into a dynamically allocated string, ensuring that it handles error checking for file operations. Here’s a minimal ...
15,748
[ { "from": "human", "value": "What is the simplest way (least error-prone, least lines of code, however you want to interpret it) to open a file in C and read its contents into a string (char*, char[], whatever)?\n" }, { "from": "gpt", "value": "The simplest way to open a file in C and read its c...
I have a PDF file, which contains data that we need to import into a database. The files seem to be pdf scans of printed alphanumeric text. Looks like 10 pt. Times New Roman. Are there any tools or components that can will allow me to recognize and parse this text?
Yes, there are several tools and libraries that can help you recognize and parse text from scanned PDF files using Optical Character Recognition (OCR). Here are some options you can consider: 1. **Tesseract OCR**: - Tesseract is an open-source OCR engine developed by Google. It can recognize text in images and PDF ...
13,918
[ { "from": "human", "value": "I have a PDF file, which contains data that we need to import into a database. The files seem to be pdf scans of printed alphanumeric text. Looks like 10 pt. Times New Roman. \nAre there any tools or components that can will allow me to recognize and parse this text?\n" }, ...
I've got an application that is very graphics intensive and built on DirectX and Windows Forms. It has an automation and replay framework around which is built an automated testing system. Unfortunately, when the tests run unattended during a nightly build, the display is inactive or tied up with the screensaver, and o...
Capturing the output of a DirectX application without a physical display can be quite challenging, especially given the constraints of Windows Forms, DirectX, and security policies that prevent disabling screen savers. However, there are several potential solutions and workarounds you might consider: ### 1. Use a Virt...
16,297
[ { "from": "human", "value": "I've got an application that is very graphics intensive and built on DirectX and Windows Forms. It has an automation and replay framework around which is built an automated testing system. Unfortunately, when the tests run unattended during a nightly build, the display is inacti...
I'm well aware of Java tools for manipulating, generating, decompiling JVM bytecode (ASM, cglib, jad, etc). What similar tools exist for the CLR bytecode? Do people do bytecode manipulation for the CLR?
Yes, there are several tools available for manipulating, generating, and decompiling CLR bytecode (CIL - Common Intermediate Language). Just like in the Java ecosystem, the .NET community has developed various tools for these purposes, and yes, people do perform bytecode manipulation for the CLR. Here are some notable ...
15,308
[ { "from": "human", "value": "I'm well aware of Java tools for manipulating, generating, decompiling JVM bytecode (ASM, cglib, jad, etc). What similar tools exist for the CLR bytecode? Do people do bytecode manipulation for the CLR? \n" }, { "from": "gpt", "value": "Yes, there are several tool...
About 5000 computers will be making a call to a central server, and they will be passing in a GUID to the central server. The server will then return True/False back to the client. Is there a big difference in performance between a web service and a regular Http request to a Url on the server?
When considering the performance of a web service versus a regular HTTP request to a URL on a server, it's essential to clarify what you mean by "web service" and "regular HTTP request." 1. **Web Services**: This term often refers to APIs that allow applications to communicate over the web. These can use various prot...
17,524
[ { "from": "human", "value": "About 5000 computers will be making a call to a central server, and they will be passing in a GUID to the central server.\nThe server will then return True/False back to the client.\nIs there a big difference in performance between a web service and a regular Http request to a U...
I have inherited a monster. It is masquerading as a .NET 1.1 application processes text files that conform to Healthcare Claim Payment (ANSI 835) standards, but it's a monster. The information being processed relates to healthcare claims, EOBs, and reimbursements. These files consist of records that have an identifie...
Refactoring a deeply nested conditional structure, especially one as large as 715 lines, can seem daunting. However, several strategies can help you manage this complexity and improve maintainability without breaking the functionality. Here are some methods you can consider for refactoring this monster: ### 1. **Use P...
13,138
[ { "from": "human", "value": "I have inherited a monster.\nIt is masquerading as a .NET 1.1 application processes text files that conform to Healthcare Claim Payment (ANSI 835) standards, but it's a monster. The information being processed relates to healthcare claims, EOBs, and reimbursements. These files...
I'm looking for a piece of code that can tell me the offset of a field within a structure without allocating an instance of the structure. IE: given struct mstct { int myfield; int myfield2; }; I could write: mstct thing; printf("offset %lu\n", (unsigned long)(&thing.myfield2 - &thing)); And get offset 4 for ...
You can calculate the offset of a field within a structure in C without creating an instance of that structure by using the `offsetof` macro from the `stddef.h` header. This macro allows you to compute the offset of a field from the beginning of a structure at compile-time, which means you won't need to allocate any me...
14,945
[ { "from": "human", "value": "I'm looking for a piece of code that can tell me the offset of a field within a structure without allocating an instance of the structure.\nIE: given\nstruct mstct {\n int myfield;\n int myfield2;\n};\n\nI could write:\nmstct thing;\nprintf(\"offset %lu\\n\", (unsigned lon...
just wondering if anyone has ever tried embedding and actually integrating any js engine into the .net environment. I could find and actually use (after a LOT of pain and effort, since it's pretty outdated and not quite finished) spidermonkey-dotnet project. Anyone with experience in this area? Engines like SquirrelFis...
Integrating a JavaScript engine into the .NET environment is a common scenario, especially for applications that require scripting capabilities or the ability to extend functionality through user-defined scripts. While you've already explored SpiderMonkey through the spidermonkey-dotnet project, there are other options...
16,063
[ { "from": "human", "value": "just wondering if anyone has ever tried embedding and actually integrating any js engine into the .net environment. I could find and actually use (after a LOT of pain and effort, since it's pretty outdated and not quite finished) spidermonkey-dotnet project. Anyone with experien...