instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Possible Duplicate: How can I develop for iPhone using a Windows development machine? Is there a way to develop iPhone (iOS) applications on Windows? I really don't want to get yet another machine. There is a project on http://code.google.com/p/winchain/wiki/HowToUse that seemed to work with iPhone 1.0, but had l...
Developing iPhone (iOS) applications on a Windows machine is quite challenging due to the reliance on macOS for the development environment, particularly for using Xcode, which is Apple's official IDE for iOS app development. However, there are some alternatives you can consider: 1. **Cross-Platform Development Framew...
18,012
[ { "from": "human", "value": "\nPossible Duplicate:\nHow can I develop for iPhone using a Windows development machine? \n\nIs there a way to develop iPhone (iOS) applications on Windows? I really don't want to get yet another machine. \nThere is a project on http://code.google.com/p/winchain/wiki/HowToUse ...
I'm trying to iterate all the controls on a form and enable ClearType font smoothing. Something like this: procedure TForm4.UpdateControls(AParent: TWinControl); var I: Integer; ACtrl: TControl; tagLOGFONT: TLogFont; begin for I := 0 to AParent.ControlCount-1 do begin ACtrl:= AParent.Controls[I]; // ...
In Delphi, you can check if a control has a `Font` property by using `TControl` as a base class. However, not all controls derived from `TControl` will have a `Font` property. You can simply check if the control is an instance of a class that has a `Font` property (like `TLabel`, `TButton`, `TEdit`, etc.) using a combi...
14,102
[ { "from": "human", "value": "I'm trying to iterate all the controls on a form and enable ClearType font smoothing. Something like this:\nprocedure TForm4.UpdateControls(AParent: TWinControl);\nvar\n I: Integer;\n ACtrl: TControl;\n tagLOGFONT: TLogFont;\nbegin\n for I := 0 to AParent.ControlCount-1 do\n...
We are setting up a Selenium test campaign on a big web application. The first thing we've done was to build a framework which initialize SQL data in database before the test, launch the test, archive results and then clear data. We've integrate that in a Maven 2 process, run every day by TeamCity on a dedicated databa...
User interface (UI) testing, especially with tools like Selenium, can indeed be challenging but also successful if managed properly. Many organizations have successfully implemented UI testing frameworks, and they typically achieve this success through a combination of strategies. Here are some of the key reasons for s...
14,632
[ { "from": "human", "value": "We are setting up a Selenium test campaign on a big web application.\nThe first thing we've done was to build a framework which initialize SQL data in database before the test, launch the test, archive results and then clear data.\nWe've integrate that in a Maven 2 process, run ...
I work for a company whose primary business is not software related. Most documentation for using source control is written with a development team writing for commercial or open source projects in mind. As someone who writes in house software I can say that work is done differently then it would be in a commercial or ...
Structuring a repository for in-house software, especially in a business that doesn’t primarily focus on software development, requires careful consideration to ensure that it meets the needs of your team while accommodating the specific workflows and practices of your organization. Here are some suggestions to help yo...
9,564
[ { "from": "human", "value": "I work for a company whose primary business is not software related. Most documentation for using source control is written with a development team writing for commercial or open source projects in mind. As someone who writes in house software I can say that work is done differe...
I'm working on an application for a charitable student organization. The application will track participation and fund-raising for (primarily) student participants in an event. One of the things we'd like to do is collect some demographic information about students who register for the event from our enterprise direc...
It sounds like you are working on an important application with various considerations for storing demographic information. You've already identified two reasonable approaches for managing this data. Here are some additional options, along with considerations for each: ### 1. Hybrid Approach Combine the first two opti...
15,682
[ { "from": "human", "value": "I'm working on an application for a charitable student organization. The application will track participation and fund-raising for (primarily) student participants in an event. One of the things we'd like to do is collect some demographic information about students who registe...
For a new project with Flash I was looking for something along the lines of standard libraries for basic programming needs, along the lines of Python or Ruby standard libraries. But the only thing I found was a dead project on Sourceforge. Thus is there no standard library for flash? Does everyone reinvent the wheel ea...
Flash, particularly in its earlier years, didn't have a comprehensive standard library like those found in Python or Ruby. Instead, developers often relied on a mix of built-in ActionScript features, third-party libraries, and custom code. While ActionScript itself provides a range of functionalities for graphics, soun...
17,836
[ { "from": "human", "value": "For a new project with Flash I was looking for something along the lines of standard libraries for basic programming needs, along the lines of Python or Ruby standard libraries. But the only thing I found was a dead project on Sourceforge.\nThus is there no standard library for ...
I'm trying to find/make an algorithm to compute the intersection (a new filled object) of two arbitrary filled 2D objects. The objects are defined using either lines or cubic beziers and may have holes or self-intersect. I'm aware of several existing algorithms doing the same with polygons, listed here. However, I'd li...
Computing the intersection of arbitrary filled 2D objects, particularly when those objects are represented by cubic Bezier curves and may include holes and self-intersections, is indeed a complex problem. Here are some strategies and approaches you might consider for implementing an intersection algorithm for your requ...
7,643
[ { "from": "human", "value": "I'm trying to find/make an algorithm to compute the intersection (a new filled object) of two arbitrary filled 2D objects. The objects are defined using either lines or cubic beziers and may have holes or self-intersect. I'm aware of several existing algorithms doing the same wi...
I'm referring to distinctions such as in this answer: ...bash isn't for writing applications it's for, well, scripting. So sure, your application might have some housekeeping scripts but don't go writing critical-business-logic.sh because another language is probably better for stuff like that. As programmer who's wo...
The distinction between scripting languages (like Bash) and compiled languages (like C or Java) often revolves around several technical differences, each of which can influence the suitability of a language for different types of tasks. Here are some key points to consider: ### 1. **Execution Model** - **Compiled Lan...
11,775
[ { "from": "human", "value": "I'm referring to distinctions such as in this answer:\n\n...bash isn't for writing applications it's for, well, scripting. So sure, your application might have some housekeeping scripts but don't go writing critical-business-logic.sh because another language is probably better f...
I'm using: FileInfo( System.Environment.GetFolderPath( System.Environment.SpecialFolder.ProgramFiles) + @"\MyInstalledApp" In order to determine if a program is detected on a users machine (it's not ideal, but the program I'm looking for is a right old kludge of a MS-DOS application, and I couldn't th...
Yes, you can programmatically determine the path to the `Program Files (x86)` directory on a 64-bit version of Windows using the `Environment.GetFolderPath` method along with `Environment.SpecialFolder`. However, `Environment.SpecialFolder.ProgramFiles` will return the path for the 64-bit folder on a 64-bit system. To...
18,074
[ { "from": "human", "value": "I'm using:\nFileInfo(\n System.Environment.GetFolderPath(\n System.Environment.SpecialFolder.ProgramFiles) \n + @\"\\MyInstalledApp\"\n\nIn order to determine if a program is detected on a users machine (it's not ideal, but the program I'm looking for is a right old...
How would I go about writing some code to allow access to a Java class in my webapp from the command line. E.g. I have a java class with command line interface, that can runs code in the context of the webapp, with access to the DB etc. I want to log on the machine hosting my WARred app in tomcat and be able to interac...
To allow access to a Java class in your web application from the command line, you can implement a couple of approaches depending on your use case and requirements. Below are two common approaches: using a command-line interface (CLI) tool and creating a RESTful API. ### Approach 1: Command-Line Interface (CLI) Tool ...
10,099
[ { "from": "human", "value": "How would I go about writing some code to allow access to a Java class in my webapp from the command line.\nE.g. I have a java class with command line interface, that can runs code in the context of the webapp, with access to the DB etc. I want to log on the machine hosting my W...
I have a method that periodically (e.g. once in every 10 secs) try to connect to a server and read some data from it. The server might not be available all the time. If the server is not available the method throws an exception. What would be the best way to implement a wrapper method that doesn't throw an exception ex...
To implement a wrapper method that does not throw an exception unless the server is unavailable for at least one minute, you can use a combination of a timer and a retry mechanism. Here's a general approach: 1. **Keep Track of Availability**: Use a boolean flag to indicate whether the server has been reachable. 2. **S...
15,652
[ { "from": "human", "value": "I have a method that periodically (e.g. once in every 10 secs) try to connect to a server and read some data from it. The server might not be available all the time. If the server is not available the method throws an exception.\nWhat would be the best way to implement a wrapper...
I use a System.Timers.Timer in my Asp.Net application and I need to use the HttpServerUtility.MapPath method which seems to be only available via HttpContext.Current.Server.MapPath. The problem is that HttpContext.Current is null when the Timer.Elapsed event fires. Is there another way to get a reference to a HttpServe...
When you're working with `System.Timers.Timer` in an ASP.NET application, the issue of `HttpContext.Current` being null is a common challenge because the `Elapsed` event of the timer runs on a separate thread that is not associated with any specific HTTP request. ### Solutions to Access `HttpServerUtility` 1. **Inje...
15,284
[ { "from": "human", "value": "I use a System.Timers.Timer in my Asp.Net application and I need to use the HttpServerUtility.MapPath method which seems to be only available via HttpContext.Current.Server.MapPath.\nThe problem is that HttpContext.Current is null when the Timer.Elapsed event fires.\nIs there an...
Is there a function in Python to split a string without ignoring the spaces in the resulting list? E.g: s="This is the string I want to split".split() gives me >>> s ['This', 'is', 'the', 'string', 'I', 'want', 'to', 'split'] I want something like ['This',' ','is',' ', 'the',' ','string', ' ', .....]
Yes, you can achieve this by using the `re` (regular expression) module in Python. The `re.split()` function allows you to split a string while retaining the delimiters (in your case, spaces) in the resulting list. Here’s how you can do it: ```python import re s = "This is the string I want to split" result = re.spl...
17,968
[ { "from": "human", "value": "Is there a function in Python to split a string without ignoring the spaces in the resulting list? \nE.g:\ns=\"This is the string I want to split\".split()\n\ngives me\n>>> s\n['This', 'is', 'the', 'string', 'I', 'want', 'to', 'split']\n\nI want something like\n['This',' ','is',...
What role is Spring taking in Struts + Spring + Hibernate?
In a typical architecture that involves Struts, Spring, and Hibernate, each framework plays a specific role, and they can be integrated together to take advantage of their respective strengths. Here's how Spring fits into the overall architecture: ### 1. **Struts**: - **Role**: Struts is primarily a web application fr...
14,234
[ { "from": "human", "value": "What role is Spring taking in Struts + Spring + Hibernate?\n" }, { "from": "gpt", "value": "In a typical architecture that involves Struts, Spring, and Hibernate, each framework plays a specific role, and they can be integrated together to take advantage of their res...
I have created the following stored procedure.. CREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP] ( @CODE CHAR(5) , @DESC VARCHAR(255) OUTPUT ) AS DECLARE @SERVERNAME nvarchar(30) DECLARE @DBASE nvarchar(30) DECLARE @SQL nvarchar(2000) SET @SERVERNAME = Convert(nvarchar, (SELECT spData FROM dbSpecificData WH...
To correctly utilize the output of the stored procedure within your SQL query, you need to modify a couple of things. Specifically, you need to ensure that you are correctly capturing the output parameter from your stored procedure and then using that value in your `SELECT` statement. Here's an updated version of you...
17,650
[ { "from": "human", "value": "I have created the following stored procedure..\nCREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP]\n(\n @CODE CHAR(5)\n , @DESC VARCHAR(255) OUTPUT\n)\nAS\nDECLARE @SERVERNAME nvarchar(30)\nDECLARE @DBASE nvarchar(30)\nDECLARE @SQL nvarchar(2000)\n\nSET @SERVERNAME = \n Conv...
Assume the following: models.py class Entry(models.Model): title = models.CharField(max_length=50) slug = models.CharField(max_length=50, unique=True) body = models.CharField(max_length=200) admin.py class EntryAdmin(admin.ModelAdmin): prepopulated_fields = {'slug':('title',)} I want the slug to be pr...
To make the `slug` field pre-populated by the `title` but not editable in the Django admin, you can indeed use `editable=False` on the `slug` field in your model. However, if you do that, you will not be able to see the field in the admin interface at all, which is why it stops rendering. Instead, you can achieve you...
15,858
[ { "from": "human", "value": "Assume the following:\nmodels.py\nclass Entry(models.Model):\n title = models.CharField(max_length=50)\n slug = models.CharField(max_length=50, unique=True)\n body = models.CharField(max_length=200)\n\nadmin.py\nclass EntryAdmin(admin.ModelAdmin):\n prepopulated_fiel...
I am trying to implement a custom "broken image" icon to appear if I cannot load an image. To accomplish this, I used the brokenImageSkin parameter, but it renders the image at its true resolution, which ends up cutting off the image if the size of the control is constrained. <mx:Image brokenImageSkin="@Embed('/as...
To scale the `brokenImageSkin` in an MX Image component to a custom width and height, you can wrap the `Image` component in a `Group` and set the dimensions of the `brokenImageSkin` using `scaleContent` and `percentWidth` and `percentHeight` attributes. Here’s an example of how to implement this: ```xml <mx:Group wid...
18,784
[ { "from": "human", "value": "I am trying to implement a custom \"broken image\" icon to appear if I cannot load an image. To accomplish this, I used the brokenImageSkin parameter, but it renders the image at its true resolution, which ends up cutting off the image if the size of the control is constrained....
Does any one know of an opensource Java VNC server, that can be run from a web page, so requiring no installation on the server end, possibley applet based.
While there are several open-source Java VNC servers and clients, running a VNC server directly from a web page without any server-side installation is quite complex due to the need for handling network connections, and security considerations. However, here are a few options that might suit your needs: 1. **Java VN...
16,304
[ { "from": "human", "value": "Does any one know of an opensource Java VNC server, that can be run from a web page, so requiring no installation on the server end, possibley applet based.\n" }, { "from": "gpt", "value": "While there are several open-source Java VNC servers and clients, running a V...
In a C# Windows Forms application I want to detect if another instance of the application is already running. If so, activate the main form of the running instance and exit this instance. What is the best way to achieve this?
To detect if another instance of a C# Windows Forms application is already running, you can use a `Mutex`. A `Mutex` allows you to create a synchronization primitive that can be used to manage access to a resource across different instances of an application. Here's a basic implementation to achieve this: 1. First, y...
14,908
[ { "from": "human", "value": "In a C# Windows Forms application I want to detect if another instance of the application is already running.\nIf so, activate the main form of the running instance and exit this instance.\nWhat is the best way to achieve this?\n" }, { "from": "gpt", "value": "To det...
I have a several webapps which use java.util.logging. Tomcat 5.5 is configured to use the Juli logger so that each webapp has its own log file. The problem is that Juli does not have properties for maximum file size and file count. Using Juli the files will grow unbounded and only roll at the end of the day. Also, ...
It sounds like you found a good solution by switching from the Apache Juli logger to the standard `java.util.logging` (JUL) FileHandler. This approach allows you to define file size limits and the number of log files to retain, which is essential for preventing unbounded log growth. To implement this solution effectiv...
15,254
[ { "from": "human", "value": "I have a several webapps which use java.util.logging. Tomcat 5.5 is configured to use the Juli logger so that each webapp has its own log file. The problem is that Juli does not have properties for maximum file size and file count. Using Juli the files will grow unbounded and...
Suppose I have one long long int and want to take its bits and construct four unsigned short ints out of it. Particular order doesn't matter much here. I generally know that I need to shift bits and truncate to the size of unsigned short int. But I think I may make some weird mistake somewhere, so I ask.
To extract four `unsigned short int` values from a `long long int` (which is typically 64 bits) by taking its bits, you can follow a simple approach that involves bit shifting and masking. Each `unsigned short int` is typically 16 bits, so you will be able to extract four of them from a 64-bit integer. Here's how you ...
16,054
[ { "from": "human", "value": "Suppose I have one long long int and want to take its bits and construct four unsigned short ints out of it.\nParticular order doesn't matter much here.\nI generally know that I need to shift bits and truncate to the size of unsigned short int. But I think I may make some weird...
Is it possible to run a macro in Visual Studio 2008 the moment a solution is closed? I would like to delete the .suo-files of that solution, so that the current user settings are not presented to me the next time I open the solution.
In Visual Studio 2008, there is no direct way to run a macro or an automated action immediately when a solution is closed. The macro environment in Visual Studio does not support event-driven programming for solution-level events like closing. However, you can work around this limitation using a few different methods....
16,053
[ { "from": "human", "value": "Is it possible to run a macro in Visual Studio 2008 the moment a solution is closed? I would like to delete the .suo-files of that solution, so that the current user settings are not presented to me the next time I open the solution.\n" }, { "from": "gpt", "value": "...
How does one check if a directory is already present in the PATH environment variable? Here's a start. All I've managed to do with the code below, though, is echo the first directory in %PATH%. Since this is a FOR loop you'd think it would enumerate all the directories in %PATH%, but it only gets the first one. Is ther...
Your current approach is very close to what you want, but there are a couple of issues with the `FOR /F` command and how you're processing the `PATH` variable. The `delims` option is correctly set to `;` since `PATH` entries are separated by semicolons, but the way you're passing the `PATH` variable is not allowing you...
17,913
[ { "from": "human", "value": "How does one check if a directory is already present in the PATH environment variable? Here's a start. All I've managed to do with the code below, though, is echo the first directory in %PATH%. Since this is a FOR loop you'd think it would enumerate all the directories in %PATH%...
Internet Explorer 8 breaks what must be every 3rd page I look at. The point of this early release was, I presume, to give website owners the chance to update their sites so it wouldn't be such a hassle for the final release. Has anyone actually done this? Is anyone even planning on doing this? I have yet to notice any ...
Internet Explorer 8 (IE8) introduced several features and standards changes that could cause issues with websites designed primarily for IE7 or earlier. The challenge for developers was to ensure compatibility across different versions of Internet Explorer, particularly if a significant portion of their audience was st...
13,926
[ { "from": "human", "value": "Internet Explorer 8 breaks what must be every 3rd page I look at. The point of this early release was, I presume, to give website owners the chance to update their sites so it wouldn't be such a hassle for the final release.\nHas anyone actually done this?\nIs anyone even planni...
This is a sample (edited slightly, but you get the idea) of my XML file: <HostCollection> <ApplicationInfo /> <Hosts> <Host> <Name>Test</Name> <IP>192.168.1.1</IP> </Host> <Host> <Name>Test</Name> <IP>192.168.1.2</IP> </Host> </Hosts> </HostCollection> When my application ...
Using `XPathNodeIterator` in VB.NET to parse XML is a great way to handle the data in your XML file. Below is a step-by-step guide on how you can load your XML file, use `XPathNodeIterator` to loop through the list of hosts, and then store the relevant information into a collection. Here’s a sample implementation: 1....
14,251
[ { "from": "human", "value": "This is a sample (edited slightly, but you get the idea) of my XML file:\n<HostCollection>\n <ApplicationInfo />\n <Hosts>\n <Host>\n <Name>Test</Name>\n <IP>192.168.1.1</IP>\n </Host>\n <Host>\n <Name>Test</Name>\n <IP>192.168.1.2</IP>\n </Host...
I'm trying to create with Delphi a component inherited from TLabel, with some custom graphics added to it on TLabel.Paint. I want the graphics to be on left side of text, so I overrode GetClientRect: function TMyComponent.GetClientRect: TRect; begin result := inherited GetClientRect; result.Left := 20; end; This s...
In order to create a custom component in Delphi that can handle painting graphics on the left side of a label and still be able to handle mouse events (including clicks) over the entire area, you'll need to take a few additional steps beyond just overriding `GetClientRect`. Here are the steps you can follow: 1. **Ove...
15,052
[ { "from": "human", "value": "I'm trying to create with Delphi a component inherited from TLabel, with some custom graphics added to it on TLabel.Paint. I want the graphics to be on left side of text, so I overrode GetClientRect:\nfunction TMyComponent.GetClientRect: TRect;\nbegin\n result := inherited GetC...
I have written a log shipping program a number of times. It is a simple program that is used to maintain a warm fail over box for SQL Server. It has two pieces. On the live dB server it: Does full and transaction backups and removes old files On the backup server it: Copies the backups from the live box Restores t...
There are several open-source and low-cost tools that can help you implement log shipping for SQL Server. Here are a few options that you may find useful: ### 1. **SQL Server Agent Jobs** While not an external tool, you can use SQL Server Agent Jobs in SQL Server to automate the log shipping process. You can create jo...
16,207
[ { "from": "human", "value": "I have written a log shipping program a number of times. It is a simple program that is used to maintain a warm fail over box for SQL Server.\nIt has two pieces. On the live dB server it:\n\nDoes full and transaction backups and removes old files\n\nOn the backup server it:\n\...
Imagine I have a chunk of initialisation code at the top of a stored procedure with a number of variable assignments: SET @proc = 'sp_madeupname' SET @magic_number = 42 SET @tomorrows_date = DATEADD(dd, 1, GETDATE()) ... Clearly doing all of the above as one SELECT would be faster: SELECT @proc = 'sp_madeupname' ...
When evaluating the performance difference between multiple `SET` statements and a single `SELECT` statement for variable assignments in SQL Server, there are a few considerations to take into account: 1. **Overhead of Multiple Statements**: Using multiple `SET` statements incurs a bit of overhead for each statement e...
16,827
[ { "from": "human", "value": "Imagine I have a chunk of initialisation code at the top of a stored procedure with a number of variable assignments:\nSET @proc = 'sp_madeupname'\nSET @magic_number = 42\nSET @tomorrows_date = DATEADD(dd, 1, GETDATE())\n...\n\nClearly doing all of the above as one SELECT would ...
We are using Visual Studio 2008 as our primary development IDE. Our security team has set up McAfee to scan files in our \Local Settings\Temp folder. Unfortunately VS uses this directory during code builds which is slowing the developers down. We've reached an impasse with the security team on this, and wonder if an...
In Visual Studio 2008, there isn't a built-in setting specifically to change the location of the temporary files generated during builds. However, you can work around this issue by changing the default location of the build output and intermediate files. Here’s how you can do that: ### Change the Output Directory 1. ...
16,343
[ { "from": "human", "value": "We are using Visual Studio 2008 as our primary development IDE. Our security team has set up McAfee to scan files in our \\Local Settings\\Temp folder. Unfortunately VS uses this directory during code builds which is slowing the developers down. We've reached an impasse with ...
Does anyone know how to access ALSA (low-level audio API) in Linux using Mono? NOTE: I'm hoping to access ALSA using PInvoke.
Accessing ALSA (Advanced Linux Sound Architecture) using Mono and PInvoke requires you to define the necessary PInvoke signatures for the ALSA functions you want to use. Below is a simplified example of how to get started with ALSA in Mono using PInvoke. ### Step 1: Install ALSA Development Packages Ensure you have t...
15,623
[ { "from": "human", "value": "Does anyone know how to access ALSA (low-level audio API) in Linux using Mono?\nNOTE: I'm hoping to access ALSA using PInvoke.\n" }, { "from": "gpt", "value": "Accessing ALSA (Advanced Linux Sound Architecture) using Mono and PInvoke requires you to define the neces...
Each cell contains some text and a background color. So I have some cells that are blue and some that are red. What function do I use to count the number of red cells? I have tried =COUNTIF(D3:D9,CELL("color",D3)) with no success (Where D3 is red).
In Excel, the `CELL` function does not return the color of the cell in a way that can be directly used with `COUNTIF`. Excel doesn't have a built-in function to count cells by background color. However, you can achieve this using a couple of methods: ### Method 1: Using VBA You can create a custom function in VBA to ...
17,345
[ { "from": "human", "value": "Each cell contains some text and a background color. So I have some cells that are blue and some that are red. What function do I use to count the number of red cells?\nI have tried =COUNTIF(D3:D9,CELL(\"color\",D3)) with no success (Where D3 is red).\n" }, { "from": "gp...
I understand there is a HTTP response header directive to disable page caching: Cache-Control:no-cache I can modify the header by "hand": <%response.addHeader("Cache-Control","no-cache");%> But is there a "nice" way to make the JSP interpreter return this header line in the server response? (I checked the <%@page .....
In JSP, while the `<%@ page ... %>` directive does not provide a specific attribute to directly set HTTP headers like `Cache-Control`, you can use the `<% %>` scriptlet to set the header programmatically, as you already mentioned. However, if you want a more declarative and cleaner approach, you can utilize a filter or...
13,656
[ { "from": "human", "value": "I understand there is a HTTP response header directive to disable page caching:\nCache-Control:no-cache\n\nI can modify the header by \"hand\":\n <%response.addHeader(\"Cache-Control\",\"no-cache\");%>\n\nBut is there a \"nice\" way to make the JSP interpreter return this header...
When Instantiating a class, Windsor by default treats all public properties of the class as optional dependencies and tries to satisfy them. In my case, this creates a rather complicated circular dependency which causes my application to hang. How can I explicitly tell Castle Windsor that it should not be trying to ...
In Castle Windsor, you can control the behavior of dependency injection using a few different approaches, including attributes, XML configuration, or Fluent API code configuration. ### Using Attributes If you decide to use attributes, you can apply the `[DoNotWire]` attribute from the `Castle.MicroKernel.Registration...
18,018
[ { "from": "human", "value": "When Instantiating a class, Windsor by default treats all public properties of the class as optional dependencies and tries to satisfy them. In my case, this creates a rather complicated circular dependency which causes my application to hang. \nHow can I explicitly tell Castl...
Is there a way to prevent someone from faking a mime type on a file upload and then running a php/exe/etc... I have to make the file upload directory writeable and executable so that the files can be stored, but this allows anyone to run a script after. One thing I can do is add random data to the file name so they ca...
When implementing file uploads in PHP, it's crucial to take several measures to mitigate the risk of malicious file uploads and execution. Here are some strategies you can employ to prevent users from uploading potentially harmful files such as PHP scripts or executables: ### 1. Validate File Types Only allow specific...
10,707
[ { "from": "human", "value": "Is there a way to prevent someone from faking a mime type on a file upload and then running a php/exe/etc...\nI have to make the file upload directory writeable and executable so that the files can be stored, but this allows anyone to run a script after. One thing I can do is a...
If I have a control, within a FormView, that is bound using a <% #Bind(...)%> expression. At run time, is there any way of retrieving the name of the field the control is bound to. To be clear, if the expression is <% #Bind("UserName") %> I want to return the string "UserName".
In ASP.NET, when you bind a control within a `FormView` using the `<%# Bind(...) %>` syntax, the string "UserName" used in the binding expression is not directly accessible at runtime. However, you can achieve your goal by using reflection to inspect the `BindingExpression` associated with the control. Here’s an appro...
17,834
[ { "from": "human", "value": "If I have a control, within a FormView, that is bound using a <% #Bind(...)%> expression. At run time, is there any way of retrieving the name of the field the control is bound to.\nTo be clear, if the expression is <% #Bind(\"UserName\") %>\nI want to return the string \"UserN...
It sounds like Mozilla is having good luck improving JavaScript performance with TraceMonkey. See also Andreas Gal's paper on Trace Trees. Are these improvements available to other interpreters/compilers and if so, does this mean we'll see a cascade of improvements in other interpreted languages?
TraceMonkey was indeed a significant step forward in JavaScript performance, introducing tracing JIT (Just-In-Time) compilation, which dynamically optimized frequently executed paths in JavaScript code. This technique is based on the concept of trace trees, which allows the interpreter to focus on optimizing hot code p...
18,347
[ { "from": "human", "value": "It sounds like Mozilla is having good luck improving JavaScript performance with TraceMonkey. See also Andreas Gal's paper on Trace Trees.\nAre these improvements available to other interpreters/compilers and if so, does this mean we'll see a cascade of improvements in other int...
The JPEG compression encoding process splits a given image into blocks of 8x8 pixels, working with these blocks in future lossy and lossless compressions. [source] It is also mentioned that if the image is a multiple 1MCU block (defined as a Minimum Coded Unit, 'usually 16 pixels in both directions') that lossless alte...
When dealing with JPEG images and their compression, the impact of dimensions being a multiple of certain sizes, particularly 8 pixels, is relevant to how the JPEG compression algorithm operates. However, when considering dimensions beyond the minimum units, such as 16 pixels, it's essential to understand how these dim...
14,673
[ { "from": "human", "value": "The JPEG compression encoding process splits a given image into blocks of 8x8 pixels, working with these blocks in future lossy and lossless compressions. [source]\nIt is also mentioned that if the image is a multiple 1MCU block (defined as a Minimum Coded Unit, 'usually 16 pixe...
i just wondering how the .net wcf application caching is implemented ?? It's single thread or multiple thread?? and if it's multiple thread how we enforce application caching to be single thread. Thank You :)
In a .NET WCF (Windows Communication Foundation) application, caching can be implemented in various ways, and it can be thread-safe depending on how you design it. WCF itself is a framework for building service-oriented applications and does not dictate a specific caching mechanism. Here are some key points regarding c...
10,567
[ { "from": "human", "value": "i just wondering how the .net wcf application caching is implemented ?? It's single thread or multiple thread?? and if it's multiple thread how we enforce application caching to be single thread. Thank You :)\n" }, { "from": "gpt", "value": "In a .NET WCF (Windows Co...
I've been unsuccessfully searching for a way to install make utility on my CentOS 5.2. I've looked through some RPM repositories and online, with no avail. Installing gcc, gcc-c++ didn't help! Package build-essential is not made for CentOS/RHEL. I have RPMFORGE repo enabled in YUM.
To install `make` on CentOS 5.2, you typically want to install the `make` package using `yum`. Since you mentioned that you have the RPMFORGE repository enabled, you should be able to install `make` directly. Here are the steps you can follow: 1. **Update YUM repository information** (optional but recommended): ``...
14,865
[ { "from": "human", "value": "I've been unsuccessfully searching for a way to install make utility on my CentOS 5.2. I've looked through some RPM repositories and online, with no avail. Installing gcc, gcc-c++ didn't help! Package build-essential is not made for CentOS/RHEL. I have RPMFORGE repo enabled in Y...
Suppose you have a large file made up of a bunch of fixed size blocks. Each of these blocks contains some number of variable sized records. Each record must fit completely within a single block and then such records by definition are never larger than a full block. Over time, records are added to and deleted from these...
To achieve efficient compaction of the records within the file while adhering to your requirements, we can employ a systematic block-shuffling algorithm. Below is a high-level outline of a suitable approach: ### Algorithm Steps: 1. **Identify Blocks**: First, we need to traverse the file and identify all the blocks a...
13,348
[ { "from": "human", "value": "Suppose you have a large file made up of a bunch of fixed size blocks. Each of these blocks contains some number of variable sized records. Each record must fit completely within a single block and then such records by definition are never larger than a full block. Over time, re...
In Sharepoint designer's workflow editor I wish to retrieve the username/name of the work flow initiator (i.e. who kicked it off or triggered the workflow) - this is relatively easy to do using 3rd party products such as Nintex Workflow 2007 (where I would use something like {Common:Initiator}) - but I can't seem to fi...
It looks like you've already implemented a custom activity to retrieve the workflow initiator's user information in SharePoint Designer workflows for MOSS 2007. This is a common approach since out-of-the-box functionality in SharePoint Designer lacks direct access to the initiator's details. Your custom activity, `Loo...
14,596
[ { "from": "human", "value": "In Sharepoint designer's workflow editor I wish to retrieve the username/name of the work flow initiator (i.e. who kicked it off or triggered the workflow) - this is relatively easy to do using 3rd party products such as Nintex Workflow 2007 (where I would use something like {Co...
How can I generate UML diagrams (especially sequence diagrams) from existing Java code?
Generating UML diagrams, particularly sequence diagrams, from existing Java code can be accomplished using various tools and techniques. Here are some methods you can use: ### 1. **Using UML Tools** Several UML modeling tools can automatically generate UML diagrams from code, including sequence diagrams. Here are som...
14,327
[ { "from": "human", "value": "How can I generate UML diagrams (especially sequence diagrams) from existing Java code?\n" }, { "from": "gpt", "value": "Generating UML diagrams, particularly sequence diagrams, from existing Java code can be accomplished using various tools and techniques. Here are ...
I'm looking for some succinct, modern C# code to generate a random date between Jan 1 1995 and the current date. I'm thinking some solution that utilizes Enumerable.Range somehow may make this more succinct.
You can indeed use `Enumerable.Range` to create a succinct solution for generating a random date within a specified range. Below is a modern C# code snippet that accomplishes this by generating a random number of days from the starting date to the current date and then adding that to the starting date: ```csharp using...
18,592
[ { "from": "human", "value": "I'm looking for some succinct, modern C# code to generate a random date between Jan 1 1995 and the current date.\nI'm thinking some solution that utilizes Enumerable.Range somehow may make this more succinct.\n" }, { "from": "gpt", "value": "You can indeed use `Enume...
Is DirectSound the best audio abstraction layer for Windows? Switching my app from a very bad sound implementation, built to a specific chipset, to an abstration layer. App is native Winform, .net 3.5. DirectX/DirectSound is the likely choice, but a little concerned about the overhead. Any other options? Or is it si...
When considering an audio abstraction layer for a Windows application, especially one built on .NET 3.5 and WinForms, DirectSound is indeed one option, but there are several factors to consider, along with other alternatives. ### DirectSound - **Pros**: DirectSound is well-integrated with the DirectX suite and allows ...
13,817
[ { "from": "human", "value": "Is DirectSound the best audio abstraction layer for Windows?\nSwitching my app from a very bad sound implementation, built to a specific chipset, to an abstration layer.\nApp is native Winform, .net 3.5. DirectX/DirectSound is the likely choice, but a little concerned about the...
Is there a way in Firebug to start a new script file to apply to page? Basically I want to do work like I'd normally do on the Firebug console but be able to to paste in multi-line functions, etc. It doesn't seem like the console is amenable to that.
Firebug has been discontinued and replaced by the built-in Developer Tools available in modern browsers like Firefox and Chrome. However, if you are still using Firebug or a similar environment, there are ways to work with multi-line scripts. In Firebug, you cannot directly create and save a script file from the conso...
13,694
[ { "from": "human", "value": "Is there a way in Firebug to start a new script file to apply to page? Basically I want to do work like I'd normally do on the Firebug console but be able to to paste in multi-line functions, etc. It doesn't seem like the console is amenable to that.\n" }, { "from": "g...
Given a table structure like this: CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(32) NOT NULL, `username` varchar(16) NOT NULL, `password` char(32) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ); Is there any use in using the LIMIT keyword when sea...
In the context of your query against the `user` table, there are a couple of important points regarding the use of the `LIMIT` keyword when searching by a unique indexed column (in this case, `username`). 1. **DB Behavior**: When you execute the query `SELECT * FROM user WHERE username = 'nick';`, the database will ut...
17,194
[ { "from": "human", "value": "Given a table structure like this:\nCREATE TABLE `user` (\n `id` int(10) unsigned NOT NULL auto_increment,\n `name` varchar(32) NOT NULL,\n `username` varchar(16) NOT NULL,\n `password` char(32) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `username` (`username`)\n);\n\nI...
In multi-threaded code, when an instance may be read or written by multiple threads, they need to be locked on to perform these operations safely. To avoid the repetition of creating an object to lock on and writing a bunch of lock statements through code, I've created a generic class to handle the locking. Am I missi...
Your `Locked<T>` class is a good start for thread-safe access to a value. However, there are some important considerations and potential improvements you might want to think about: ### Conceptual Considerations 1. **Thread Safety in Get**: The `Get` method in your current implementation returns the stored value direc...
14,984
[ { "from": "human", "value": "In multi-threaded code, when an instance may be read or written by multiple threads, they need to be locked on to perform these operations safely.\nTo avoid the repetition of creating an object to lock on and writing a bunch of lock statements through code, I've created a generi...
Ok, so I'm an idiot. So I was working on a regex that took way to long to craft. After perfecting it, I upgraded my work machine with a blazing fast hard drive and realized that I never saved the regex anywhere and simply used RegexBuddy's autosave to store it. Dumb dumb dumb. I sent a copy of the regex to a cowo...
Don't worry, it happens to the best of us! The good news is that RegexBuddy does have a way to recover or locate your saved work, even from a previous installation. Here are some steps you can try to find the auto-saved data on your old hard drive: 1. **Check Default Save Locations**: RegexBuddy usually saves its a...
14,462
[ { "from": "human", "value": "Ok, so I'm an idiot. \nSo I was working on a regex that took way to long to craft. After perfecting it, I upgraded my work machine with a blazing fast hard drive and realized that I never saved the regex anywhere and simply used RegexBuddy's autosave to store it. Dumb dumb du...
Are there good efficiency savings using Sql Server 2005 over Sql Server 2000? Or does it just have more services etc Has anyone seen their system work any quicker after making the upgrade?
Upgrading from SQL Server 2000 to SQL Server 2005 can indeed provide several efficiency savings and performance improvements, as well as access to new features and enhancements. While SQL Server 2005 does come with more services and capabilities, it also includes numerous optimizations that can lead to improved system ...
12,097
[ { "from": "human", "value": "Are there good efficiency savings using Sql Server 2005 over Sql Server 2000?\nOr does it just have more services etc\nHas anyone seen their system work any quicker after making the upgrade?\n" }, { "from": "gpt", "value": "Upgrading from SQL Server 2000 to SQL Serve...
I am using VS 2008 with a very simple UpdatePanel scenario. But i cannot get UpdatePanel to work and cant seem to find out why I have in fact reverted to a very simple example to validate it is not my code: http://ajax.net-tutorials.com/controls/updatepanel-control/ In this example I click on either button and both te...
It sounds like you're facing an issue with the `UpdatePanel` not working in your IIS environment, even though it works in the Visual Studio Development Server (Cassini). Here are some things to check to troubleshoot the issue: ### 1. **AJAX Extensions Installation** Make sure that the ASP.NET AJAX extensions are insta...
16,176
[ { "from": "human", "value": "I am using VS 2008 with a very simple UpdatePanel scenario. \nBut i cannot get UpdatePanel to work and cant seem to find out why\nI have in fact reverted to a very simple example to validate it is not my code:\nhttp://ajax.net-tutorials.com/controls/updatepanel-control/\nIn this...
In the installation documentation to RoR it mentions that there are many limitations to running Ruby on Rails on Windows, and in some cases, whole libraries do not work. How bad are these limitations, should I always default to Linux to code / run RoR, and is Iron Ruby expected to fix these limitations or are they core...
Running Ruby on Rails (RoR) on Windows has indeed presented various challenges and limitations over the years, primarily due to how Ruby, Rails, and many of their dependencies are designed to function in Unix-like environments. Here’s a breakdown of the limitations and considerations: ### Limitations of Running RoR on...
16,180
[ { "from": "human", "value": "In the installation documentation to RoR it mentions that there are many limitations to running Ruby on Rails on Windows, and in some cases, whole libraries do not work.\nHow bad are these limitations, should I always default to Linux to code / run RoR, and is Iron Ruby expected...
What is the maximum length in characters a CString object can hold?
In MFC (Microsoft Foundation Classes), a `CString` object can hold a maximum length determined by its internal implementation, which is typically limited by the available memory rather than a fixed maximum. However, it's important to note that the maximum length for a `CString` is constrained by the size of a `DWORD`, ...
17,967
[ { "from": "human", "value": "What is the maximum length in characters a CString object can hold?\n" }, { "from": "gpt", "value": "In MFC (Microsoft Foundation Classes), a `CString` object can hold a maximum length determined by its internal implementation, which is typically limited by the avail...
Is it frowned upon to release your software with a version number high than 1? For example, some non tech-savy people might see a competitor's product with a higher version number as meaning my software is not as good.
Releasing your software with a version number higher than 1 is generally acceptable and often depends on your marketing strategy and product development philosophy. Here are some considerations: 1. **User Perception**: As you mentioned, some users might interpret a higher version number as an indicator of a more matur...
18,092
[ { "from": "human", "value": "Is it frowned upon to release your software with a version number high than 1?\nFor example, some non tech-savy people might see a competitor's product with a higher version number as meaning my software is not as good.\n" }, { "from": "gpt", "value": "Releasing your...
I've set the MaxDate and MinDate properties of a DateTimePicker. However, when I test the control at runtime, there is no way to tell the invalid dates from the valid ones. The only difference is that clicking on an invalid date does nothing. This is not very intuitive for the user. I want to be able to tell at a glanc...
To provide a better user experience in your WinForms application when using a `DateTimePicker`, you may find that the default behavior of this control does not visually indicate which dates are valid or invalid. Unfortunately, the `DateTimePicker` does not directly support highlighting or dimming invalid dates. Howev...
14,618
[ { "from": "human", "value": "I've set the MaxDate and MinDate properties of a DateTimePicker. However, when I test the control at runtime, there is no way to tell the invalid dates from the valid ones. The only difference is that clicking on an invalid date does nothing.\nThis is not very intuitive for the ...
I'm having a problem using the java.text.MessageFormat object. I'm trying to create SQL insert statements. The problem is, when I do something like this: MessageFormat messageFormat = "insert into {0} values ( '{1}', '{2}', '{3}', {4} )"; Object[] args = { str0, str1, str2, str3, str4 }; String result = messageFormat...
The issue you are encountering stems from the way you're creating the `MessageFormat` object. The `MessageFormat` constructor expects a format string, and it doesn't directly process single quotes as part of the format. To properly use `MessageFormat` for generating SQL insert statements with values enclosed in single...
17,036
[ { "from": "human", "value": "I'm having a problem using the java.text.MessageFormat object.\nI'm trying to create SQL insert statements. The problem is, when I do something like this:\nMessageFormat messageFormat = \"insert into {0} values ( '{1}', '{2}', '{3}', {4} )\";\nObject[] args = { str0, str1, str...
I've just built a basic ASP MVC web site for deployment on our intranet. It expects users to be on the same domain as the IIS box and if you're not an authenticated Windows User, you should not get access. I've just deployed this to IIS6 running on Server 2003 R2 SP2. The web app is configured with it's own pool with i...
The issue you are encountering is related to Kerberos authentication when accessing your ASP.NET MVC web application via the server's name or FQDN, rather than via `localhost`. This typically arises due to a problem with the service principal name (SPN) or issues with the machine account in Active Directory. Here are ...
12,223
[ { "from": "human", "value": "I've just built a basic ASP MVC web site for deployment on our intranet. It expects users to be on the same domain as the IIS box and if you're not an authenticated Windows User, you should not get access.\nI've just deployed this to IIS6 running on Server 2003 R2 SP2. The web a...
What's the ASP equivalent to PHP's .= when concatenating strings? I'm referring to asp NOT asp.net. I meant to specify that I'm in a for-loop. So I want to know the equivalent for .= (in php) not standard concatenation. Example: For Each Item In Request.Form If (Item = "service") then For x=1 To Request.Fo...
In classic ASP, the equivalent of PHP's `.=` operator for concatenating strings is to simply use the `&` operator with assignment. You can concatenate the strings by using `=` with the current value of the variable and the new value you want to append. Here’s how you can adjust your code to achieve the same result: `...
19,904
[ { "from": "human", "value": "What's the ASP equivalent to PHP's .= when concatenating strings? I'm referring to asp NOT asp.net.\nI meant to specify that I'm in a for-loop. So I want to know the equivalent for .= (in php) not standard concatenation.\nExample:\nFor Each Item In Request.Form\n If (Item = \...
I need to setup a blog using wordpress engine but i need it support multi languages (3 languages), currently i am thinking of using custom field to identify the language of current post though i knew thats not a best practices, does anyone has better suggestions?
Using custom fields to manage multi-language content in WordPress is certainly a valid approach, but as you've noted, there are more effective and efficient methods to handle multilingual sites. Here are a few better practices you might consider: ### 1. **Multilingual Plugins** Using a dedicated multilingual plugin is...
15,431
[ { "from": "human", "value": "I need to setup a blog using wordpress engine but i need it support multi languages (3 languages), currently i am thinking of using custom field to identify the language of current post though i knew thats not a best practices, does anyone has better suggestions?\n" }, { ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GenericCount { class Program { static int Count1<T>(T a) where T : IEnumerable<T> { return a.Count(); } static void Main(string[] args) { List<string>...
The code you provided is almost correct, but the generic constraint in the `Count1` method is not set up properly to accept types like `List<string>` or an array. Instead, you should change the constraint so that it accepts any type that implements `IEnumerable<T>`. Here’s how you can modify the `Count1` method: 1. R...
18,772
[ { "from": "human", "value": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace GenericCount\n{\n class Program\n {\n static int Count1<T>(T a) where T : IEnumerable<T>\n {\n return a.Count();\n }\n\n static void...
Image a Button on your windows form that does something when being clicked. The click events thats raised is typically bound to a method such as protected void Button1_Click(object sender, EventArgs e) { } What I see sometimes in other peoples' code is that the implementation of the buttons' behaviour is not put in...
Yes, it is generally a good design decision to encapsulate the behavior associated with an event (like a button click) in its own method, rather than putting the logic directly into the event handler. Here are several reasons why this approach is beneficial: 1. **Separation of Concerns**: By separating the event handl...
13,247
[ { "from": "human", "value": "Image a Button on your windows form that does something when being clicked.\nThe click events thats raised is typically bound to a method such as\n\nprotected void Button1_Click(object\n sender, EventArgs e) {\n}\n\nWhat I see sometimes in other peoples' code is that the implem...
I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the .project and .classpath files for Eclipse. When the dependency downloaded does not have attached javadoc I manually add a link for the javadoc in the ...
To have Maven's Eclipse plugin automatically add Javadoc URLs in the `.classpath` file for dependencies without attached Javadoc, you'll need to set up some custom configuration since the default behavior does not include this feature out of the box. Unfortunately, the Maven Eclipse plugin itself doesn't provide a stra...
11,954
[ { "from": "human", "value": "I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the .project and .classpath files for Eclipse. When the dependency downloaded does not have attached javadoc I ma...
In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work beforehand), this button is enabled only in some well-defined moments, i...
Handling `Thread.Abort()` in a C# application can be tricky, particularly because using `Thread.Abort()` to terminate threads can lead to `ThreadAbortException` occurring at unpredictable moments, which might disrupt the execution of critical sections of your code. Instead of directly using `Thread.Abort()`, it's gener...
14,408
[ { "from": "human", "value": "In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled \"Interrupt execution\". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work beforehand), this button is e...
I'd like to use the camera in my Macbook in a program. I'm fairly language agnostic - C, Java, Python etc are all fine. Could anyone suggest the best place to look for documents or "Hello world" type code?
Certainly! You can use various programming languages to access the camera on your MacBook. Below are suggestions for using C, Java, and Python, along with resources and sample code. ### Python One of the easiest ways to access your MacBook's camera in Python is by using the `OpenCV` library. Here's a simple example t...
7,439
[ { "from": "human", "value": "I'd like to use the camera in my Macbook in a program. I'm fairly language agnostic - C, Java, Python etc are all fine. Could anyone suggest the best place to look for documents or \"Hello world\" type code?\n" }, { "from": "gpt", "value": "Certainly! You can use var...
Is there a way set flags on a per-file basis with automake? In particular, if I have a c++ project and want to compile with -WAll all the files except one for which I want to disable a particular warning, what could I do? I tried something like: CXXFLAGS = -WAll ... bin_PROGRAMS = test test_SOURCES = main.cpp utility.c...
Automake does not provide a built-in way to set flags on a per-file basis directly in the `Makefile.am`. However, you can achieve this by using the `AM_CPPFLAGS` or `AM_CXXFLAGS` variables and adding specific compiler flags for each source file. To set different compiler flags for specific source files, you can define...
18,075
[ { "from": "human", "value": "Is there a way set flags on a per-file basis with automake?\nIn particular, if I have a c++ project and want to compile with -WAll all the files except one for which I want to disable a particular warning, what could I do?\nI tried something like:\nCXXFLAGS = -WAll ...\nbin_PROG...
I have an application which is a portal application and I want to allow other users add their applications to it. In order to do this I need some way to be able to access their applications in mine. Is this possible?
Yes, it is possible to allow other users to add their applications to your portal application. There are several architectural approaches you can take to achieve this. Here are some common methods: 1. **Plugin Architecture**: You can design your portal to support plugins. Other users can develop their applications as ...
17,877
[ { "from": "human", "value": "I have an application which is a portal application and I want to allow other users add their applications to it. In order to do this I need some way to be able to access their applications in mine. Is this possible?\n" }, { "from": "gpt", "value": "Yes, it is possib...
I'm looking for a regex that will allow me to validate whether or not a string is the reference to a website address, or a specific page in that website. So it would match: http://google.com ftp://google.com http://google.com/ http://lots.of.subdomains.google.com But not: http://google.com/search.whatever ftp://googl...
To validate a string as a reference to a website address or a specific page in that website, while ensuring it does not include paths beyond the domain name, you can use the following regular expression: ```regex ^(https?|ftp):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(/)?$ ``` ### Explanation: - `^` - Asserts the start of t...
17,029
[ { "from": "human", "value": "I'm looking for a regex that will allow me to validate whether or not a string is the reference to a website address, or a specific page in that website. \nSo it would match:\nhttp://google.com\nftp://google.com\nhttp://google.com/\nhttp://lots.of.subdomains.google.com\n\nBut no...
Is there a specfic Gang Of Four Design Pattern that you frequently use, yet hardly see used in other peoples designs? If possible, please describe a simple example where this pattern can be useful. It doesn't have to necessarily be a Gang Of Four pattern, but please include a hyperlink to the pattern's description if...
One design pattern that is often overlooked yet can be incredibly useful in certain scenarios is the **Mediator Pattern**. While it's part of the Gang of Four (GoF) design patterns, it doesn't get as much attention as others like Singleton or Observer. ### Mediator Pattern The Mediator Pattern is a behavioral design ...
10,965
[ { "from": "human", "value": "Is there a specfic Gang Of Four Design Pattern that you frequently use, yet hardly see used in other peoples designs? If possible, please describe a simple example where this pattern can be useful. It doesn't have to necessarily be a Gang Of Four pattern, but please include a ...
Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode?
In Access 2003, you can run a query while in Design View or SQL View by using the keyboard shortcut **Ctrl + R**. Here's how you can do it: 1. Open your query in Design View or SQL View. 2. Press **Ctrl + R** to run the query. Alternatively, if you're in SQL View, you can also use **F5** to run the query. These s...
20,064
[ { "from": "human", "value": "Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode?\n" }, { "from": "gpt", "value": "In Access 2003, you can run a query while in Design View or SQL View by using the keyboard shortcut **Ctrl + R**. \n\nHere's how you can do...
I have a C# application where I create a Crystal Reports ReportDocument, with the line CrystalDecisions.CrystalReports.Engine.ReportDocument document = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); This line takes 3-4 seconds to execute. This seems very slow, especially since the ...
Creating a `CrystalDecisions.CrystalReports.Engine.ReportDocument` instance may seem relatively straightforward, but there are various factors that could contribute to the delay you are experiencing. Here are some suggestions to improve performance when instantiating `ReportDocument`: 1. **Check for Unnecessary Initia...
15,268
[ { "from": "human", "value": "I have a C# application where I create a Crystal Reports ReportDocument, with the line\nCrystalDecisions.CrystalReports.Engine.ReportDocument document =\n new CrystalDecisions.CrystalReports.Engine.ReportDocument();\nThis line takes 3-4 seconds to execute....
XP-specific answers preferred, but others are welcome too.
Absolutely! Feel free to ask any questions you have about Extreme Programming (XP), and I'll do my best to provide XP-specific answers. Whether it's about practices, principles, or any other aspect of XP, I'm here to help!
21,032
[ { "from": "human", "value": "XP-specific answers preferred, but others are welcome too.\n" }, { "from": "gpt", "value": "Absolutely! Feel free to ask any questions you have about Extreme Programming (XP), and I'll do my best to provide XP-specific answers. Whether it's about practices, principle...
How can I extract the list of available SQL servers in an SQL server group? I'm planning to put that list in a combo box in VB.NET.
To extract the list of available SQL Servers in a SQL Server group, you can use the SQL Server Management Objects (SMO) library in your VB.NET application. SMO provides a way to programmatically interact with SQL Server instances, allowing you to enumerate servers and their properties. Here’s a step-by-step guide on h...
14,506
[ { "from": "human", "value": "How can I extract the list of available SQL servers in an SQL server group? I'm planning to put that list in a combo box in VB.NET.\n" }, { "from": "gpt", "value": "To extract the list of available SQL Servers in a SQL Server group, you can use the SQL Server Managem...
Do anyone do this in ANT Build. Meaning everytimie a certain target is called e.g. build-sit. A tag will be created in the svn respositoyr to reference to that particular sit version. Any idea how to do about doing that?
To create a tag in an SVN repository every time a specific Ant target is called (such as `build-sit`), you can utilize the Apache Ant `svn` task. You will need to set up your build script (usually `build.xml`) to include an Ant target that performs the tagging operation after the build process is complete. Below is an...
15,190
[ { "from": "human", "value": "Do anyone do this in ANT Build. Meaning everytimie a certain target is called e.g. build-sit. A tag will be created in the svn respositoyr to reference to that particular sit version.\nAny idea how to do about doing that?\n" }, { "from": "gpt", "value": "To create a ...
I’m trying to create an instance of: java.awt.geom.Point2D.Double in ColdFusion. Point2D.Double is a nested class inside of the abstract class Point2D. I have tried to instantiate the class using: <cfset PointClass = createObject("java", "java.awt.geom.Point2D.Double")> This fails because ColdFusion cannot find the c...
In ColdFusion 8, when dealing with Java classes that are nested (like `java.awt.geom.Point2D.Double`), you need to be careful about how you refer to those classes. The problem you're encountering is that ColdFusion has specific ways of referencing nested classes that can be slightly different from standard Java syntax....
19,448
[ { "from": "human", "value": "I’m trying to create an instance of: java.awt.geom.Point2D.Double in ColdFusion.\nPoint2D.Double is a nested class inside of the abstract class Point2D. I have tried to instantiate the class using:\n<cfset PointClass = createObject(\"java\", \"java.awt.geom.Point2D.Double\")>\n...
I have created an end user model and deployed it. Any report that I create and run gives me an error: Report execution error The report might not be valid or the server could not process the data. Semantic query execution failed. Invalid column name 'rowguid'. Query execution failed for data set 'dataSet'. An error ha...
Hi Daniel, It sounds like you're encountering a common issue when deploying reports that involve models with certain fields, especially with the `rowguid` column that's typically used as a unique identifier for rows. The error message suggests that the report is still trying to reference the `rowguid` column, which ma...
15,718
[ { "from": "human", "value": "I have created an end user model and deployed it. Any report that I create and run gives me an error:\nReport execution error\nThe report might not be valid or the server\ncould not process the data.\nSemantic query execution failed. Invalid column name 'rowguid'.\nQuery execut...
Sometimes coloring a logfile or other gives a good overview when looking for stuff and behaviors I just saw that grep have a coloring feature grep -C 99999 --color <regexp> <filename> What other methods are there?
Coloring and highlighting log files or text outputs can certainly make it easier to identify patterns, errors, or specific entries. In addition to `grep`'s coloring feature, there are various tools and techniques you can use to achieve a similar effect. Here are several methods: ### 1. **`awk` with ANSI Color Codes** ...
11,812
[ { "from": "human", "value": "Sometimes coloring a logfile or other gives a good overview when looking for stuff and behaviors\nI just saw that grep have a coloring feature\ngrep -C 99999 --color <regexp> <filename>\n\nWhat other methods are there?\n" }, { "from": "gpt", "value": "Coloring and hi...
I have a Dictionary<string, someobject>. EDIT: It was pointed out to me, that my example was bad. My whole intention was not to update the references in a loop but to update different values based on differnt threads need to update/get the data. I changed the loop to a method. I need to update items in my dictionary - ...
Locking on the key value of your `Dictionary` object as shown in your pseudocode is not a good approach for several reasons: 1. **Key Identity**: The `Key` you are locking on is a string, which can lead to issues if different threads happen to lock on the same string key simultaneously. Since string interning can caus...
13,403
[ { "from": "human", "value": "I have a Dictionary<string, someobject>.\nEDIT: It was pointed out to me, that my example was bad. My whole intention was not to update the references in a loop but to update different values based on differnt threads need to update/get the data. I changed the loop to a method.\...
I'm trying to grok the purpose of .NET's SecureString. From MSDN: An instance of the System.String class is both immutable and, when no longer needed, cannot be programmatically scheduled for garbage collection; that is, the instance is read-only after it is created and it is not possible to predict when the instance...
You're right that the key advantage of using `SecureString` is its ability to store sensitive information (like passwords) in a way that provides better protection than regular strings. However, there are several important aspects of `SecureString` that you should consider to fully understand its purpose and functional...
17,040
[ { "from": "human", "value": "I'm trying to grok the purpose of .NET's SecureString. From MSDN:\n\nAn instance of the System.String class is both immutable and, when no longer needed, cannot be programmatically scheduled for garbage collection; that is, the instance is read-only after it is created and it i...
I am using StringReplace to replace &gt and &lt by the char itself in a generated XML like this: StringReplace(xml.Text,'&gt;','>',[rfReplaceAll]) ; StringReplace(xml.Text,'&lt;','<',[rfReplaceAll]) ; The thing is it takes way tooo long to replace every occurence of &gt. Do you purpose any better idea to make it faste...
If you're finding that using `StringReplace` with `rfReplaceAll` is slow for replacing `&gt;` and `&lt;` in a large XML string, there are a few alternatives you can consider to optimize the process. ### 1. Use a Single Pass with a Regular Expression Instead of calling `StringReplace` twice, you can use regular expres...
15,508
[ { "from": "human", "value": "I am using StringReplace to replace &gt and &lt by the char itself in a generated XML like this:\nStringReplace(xml.Text,'&gt;','>',[rfReplaceAll]) ;\nStringReplace(xml.Text,'&lt;','<',[rfReplaceAll]) ;\n\nThe thing is it takes way tooo long to replace every occurence of &gt.\nD...
Whenever I'm at a break point in a certain C#.NET application in Visual Studio 2008 and I fire up Microsoft Word 2007, word will fail to open until I restart the C# application. I have a few theories about why, but does anyone know for sure?
The issue you're experiencing with Microsoft Word 2007 not opening while you have a C#.NET application paused at a breakpoint in Visual Studio 2008 could be related to several factors, including how Visual Studio interacts with COM components, resource allocation, or threading issues. Here are a few potential explanati...
17,260
[ { "from": "human", "value": "Whenever I'm at a break point in a certain C#.NET application in Visual Studio 2008 and I fire up Microsoft Word 2007, word will fail to open until I restart the C# application. I have a few theories about why, but does anyone know for sure?\n" }, { "from": "gpt", "v...
I need to test a site with a dynamic menu in Mac Firefox, but I'm running in Windows. A simple browsershot.com test won't help; I need to actually use the site. How can I acquire a method of doing Mac emulation without physically having a Mac? Is there some kind of remote VM product out there?
Yes, there are several methods to test a site on a Mac environment without owning a Mac device. Here are some options you can consider: 1. **MacStadium**: MacStadium offers Mac hardware as a service, allowing you to rent a Mac in the cloud. You can access it remotely and install Firefox or any other browser you need f...
17,529
[ { "from": "human", "value": "I need to test a site with a dynamic menu in Mac Firefox, but I'm running in Windows. A simple browsershot.com test won't help; I need to actually use the site.\nHow can I acquire a method of doing Mac emulation without physically having a Mac? Is there some kind of remote VM pr...
We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected to or disconnected from the customer's server. Has anyone done this? If so, how did you do it? (Technology, architecture, etc.) Background: We develop and sell an enterprise browser-based application used by cons...
Creating an occasionally-connected application requires a well-thought-out architecture to ensure smooth data synchronization between the client and server when the connection becomes available. Here are some strategies and technologies you could consider for your ASP.NET/NHibernate application: ### 1. **Client-Side D...
15,864
[ { "from": "human", "value": "We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected to or disconnected from the customer's server. Has anyone done this? If so, how did you do it? (Technology, architecture, etc.)\nBackground:\nWe develop and sell an enterp...
Let's say I want to represent \q (or any other particular "backslash-escaped character"). That is, I want to match \q but not \\q, since the latter is a backslash-escaped backslash followed by a q. Yet \\\q would match, since it's a backslash-escaped backslash followed by a backslash-escaped q. (Well, it would match...
To match the pattern `\q` but not `\\q`, while allowing for additional backslashes preceding `\q`, you can use a combination of a negative lookbehind and a regular expression that properly escapes the backslashes. Here's how you can construct the regex: ```regex (?<!\\)(\\\\)*\\q ``` ### Explanation: 1. **Negative ...
18,419
[ { "from": "human", "value": "Let's say I want to represent \\q (or any other particular \"backslash-escaped character\"). That is, I want to match \\q but not \\\\q, since the latter is a backslash-escaped backslash followed by a q. Yet \\\\\\q would match, since it's a backslash-escaped backslash followe...
Can I set timeouts for JSP pages in tomcat either on a per page or server level?
Yes, you can set timeouts for JSP pages in Tomcat, but it needs to be done in a way that aligns with how Tomcat handles requests rather than directly at the JSP level. Here are the main options available for setting timeouts in Tomcat: ### 1. **Connector Timeout Configuration** You can configure the timeout settings f...
19,341
[ { "from": "human", "value": "Can I set timeouts for JSP pages in tomcat either on a per page or server level?\n" }, { "from": "gpt", "value": "Yes, you can set timeouts for JSP pages in Tomcat, but it needs to be done in a way that aligns with how Tomcat handles requests rather than directly at ...
When stepping a program in Delphi 7, the CPU window sometimes pops up and then steps through that instructions. I find this an annoyance as I wish to only step Pascal Code. Does anyone know how to disable this CPU pop-up? I would not be sorry if this window never ever shows. It did not happen on Delphi 5 which was m...
In Delphi 7, the CPU window can pop up when you step into certain routines or if there are issues with the debug information. Unfortunately, there isn't a specific option to completely disable the CPU window from appearing while debugging. However, you can try a few strategies to reduce its occurrence: 1. **Debug Info...
17,242
[ { "from": "human", "value": "When stepping a program in Delphi 7, the CPU window sometimes pops up and then steps through that instructions. I find this an annoyance as I wish to only step Pascal Code. \nDoes anyone know how to disable this CPU pop-up? \nI would not be sorry if this window never ever shows....
Could anyone recommend a good BAML Decompiler / Viewer besides BAML Viewer plugin for Reflector, which doesn't handle path geometry/data?
If you're looking for a BAML decompiler or viewer that can handle path geometry and other complex data better than the BAML Viewer plugin for Reflector, here are a few alternatives you can consider: 1. **ILSpy**: ILSpy is an open-source .NET assembly browser and decompiler. It supports BAML files and provides better h...
18,726
[ { "from": "human", "value": "Could anyone recommend a good BAML Decompiler / Viewer besides BAML Viewer plugin for Reflector, which doesn't handle path geometry/data?\n" }, { "from": "gpt", "value": "If you're looking for a BAML decompiler or viewer that can handle path geometry and other comple...
I have a user control in a repeater that I need to pass data to during the databound event, so I've created two public properties in the control. How do I access these properties from the page's codebehind class?
To pass data to a user control that is contained within a Repeater during the `ItemDataBound` event, you'll need to access the user control's properties after binding the data to the repeater item. Here's how you can achieve this: ### 1. Create the User Control Assuming you have a user control named `MyUserControl`, ...
15,899
[ { "from": "human", "value": "I have a user control in a repeater that I need to pass data to during the databound event, so I've created two public properties in the control. How do I access these properties from the page's codebehind class?\n" }, { "from": "gpt", "value": "To pass data to a use...
Usually when I need to fork in C, I do something like this: pid_t p = fork(); if(p == 0) { /* do child stuff */ } else { /* do parent stuff and pray there wasn't an error */ } It occured to me that I could ditch the extra variable and use: if(fork() == 0) { /* child */ } else { /* parent/pray */ } Improper error hand...
Your code snippet using `fork()` without an intermediate variable is indeed valid and works as expected. When you call `fork()`, it creates a new child process, and the return value of `fork()` is crucial in differentiating between the child and parent process: - In the child process, `fork()` returns `0`. - In the pa...
17,458
[ { "from": "human", "value": "Usually when I need to fork in C, I do something like this:\npid_t p = fork();\nif(p == 0) { /* do child stuff */ }\nelse { /* do parent stuff and pray there wasn't an error */ }\n\nIt occured to me that I could ditch the extra variable and use:\nif(fork() == 0) { /* child */ }\...
How do you perform a CROSS JOIN with LINQ to SQL?
In LINQ to SQL, a CROSS JOIN can be performed using the `SelectMany` method. A CROSS JOIN produces a Cartesian product of the two data sets, meaning that it combines every row from the first data set with every row from the second data set. Here’s an example of how to perform a CROSS JOIN using LINQ to SQL: Suppose y...
18,417
[ { "from": "human", "value": "How do you perform a CROSS JOIN with LINQ to SQL?\n" }, { "from": "gpt", "value": "In LINQ to SQL, a CROSS JOIN can be performed using the `SelectMany` method. A CROSS JOIN produces a Cartesian product of the two data sets, meaning that it combines every row from the...
It seems that in some cases, if you end up with nested modalPopups wrapped with updatePanels (not ideal I know, and should probably be refactored, but that's what we're working with because of how some of the user controls we wanted to re-use were written), when you fire a postback that should open the nested modalPopu...
You've run into a common issue when dealing with nested `UpdatePanels` and `ModalPopupExtenders` in ASP.NET. As you've described, when a postback occurs, the parent `UpdatePanel` may re-evaluate its state and reset the visibility of the modal popups, causing unintended behavior where the nested modal is closed when you...
16,536
[ { "from": "human", "value": "It seems that in some cases, if you end up with nested modalPopups wrapped with updatePanels (not ideal I know, and should probably be refactored, but that's what we're working with because of how some of the user controls we wanted to re-use were written), when you fire a postb...
I'm looking for an add-in to VS2008 that can enable structural highlighting (vertical lines in blocks of code) in the C# code editor. I tried out CodeRush, but while the structural highlighting was great, I was annoyed with all the other stuff in CodeRush. No matter how much I disabled in the options, I couldn't quite...
While Visual Studio 2008 is quite an old version and options are limited compared to newer versions, there are still a few add-ins that you could consider for structural highlighting in the C# editor. Here are a couple of suggestions: 1. **Visual Assist X**: This is a popular productivity tool for Visual Studio that e...
18,891
[ { "from": "human", "value": "I'm looking for an add-in to VS2008 that can enable structural highlighting (vertical lines in blocks of code) in the C# code editor. \nI tried out CodeRush, but while the structural highlighting was great, I was annoyed with all the other stuff in CodeRush. No matter how much I...
I have a Windows Installer MSI package that installs drivers which sometimes require a restart before they can be upgraded; the drivers are installed by a deferred custom action after WriteRegistryValues. When a reboot IS needed there's a rollback and the user is told to reboot and run the install again. In the Insta...
Automating a reboot and resuming an installation can be a bit tricky, especially when dealing with driver installations that have specific requirements. Here are some best practices and pointers to help you accomplish this while minimizing potential issues: ### 1. Modify the Install Sequence - **Revisit Install Sequen...
14,933
[ { "from": "human", "value": "I have a Windows Installer MSI package that installs drivers which sometimes require a restart before they can be upgraded; the drivers are installed by a deferred custom action after WriteRegistryValues. When a reboot IS needed there's a rollback and the user is told to reboot ...
Is there any way to output the contents of an XDocument without the BOM? When reading the output with Flash, it causes errors.
Yes, you can output the contents of an `XDocument` without a Byte Order Mark (BOM) in C#. The BOM is typically included when writing out a UTF-8 encoded document using certain stream writers. To avoid this, you can specify a `UTF8Encoding` that does not emit the BOM when creating your output stream. Here's an example ...
16,570
[ { "from": "human", "value": "Is there any way to output the contents of an XDocument without the BOM? When reading the output with Flash, it causes errors.\n" }, { "from": "gpt", "value": "Yes, you can output the contents of an `XDocument` without a Byte Order Mark (BOM) in C#. The BOM is typica...
Is there an easy way of finding out the host name of a machine that generated a user mode dump file via WinDbg? Or at least any piece of identifying information to try and confirm that two dump files came from the same system.
Yes, you can extract host name and other identifying information from a user-mode dump file using WinDbg. Here are some steps you can follow to find this information: 1. **Open the Dump File in WinDbg**: Start WinDbg and open the dump file you want to analyze by selecting `File -> Open Crash Dump`. 2. **Use the `!pro...
8,083
[ { "from": "human", "value": "Is there an easy way of finding out the host name of a machine that generated a user mode dump file via WinDbg? \nOr at least any piece of identifying information to try and confirm that two dump files came from the same system.\n" }, { "from": "gpt", "value": "Yes, ...
We have a windows application that contains an ActiveX WebBrowser control. As part of the regular operation of this application modifications are made to the pages that are displayed by the ActiveX WebBrowser control. Part of these modifications involve setting a JavaScript variable in a web page being loaded into the ...
It sounds like you're trying to inject a new value into a JavaScript variable defined in an HTML document that is loaded in an ActiveX WebBrowser control using C#. Your issue arises when you reload the page after setting the variable. The JavaScript context is reset when you reload the page, which is why you can set th...
14,874
[ { "from": "human", "value": "We have a windows application that contains an ActiveX WebBrowser control. As part of the regular operation of this application modifications are made to the pages that are displayed by the ActiveX WebBrowser control. Part of these modifications involve setting a JavaScript vari...
Is it possible to initialize an array of pointers to structs? Something like: struct country_t *countries[] = { {"United States of America", "America"}, {"England", "Europe"}, {"Ethiopia", "Africa"} } I want to do that in order to get the entities in not-contiguous memory, and the pointer...
In C, when you want to create an array of pointers to structs and you want to initialize the structs at the same time, you cannot directly initialize the structs like you've done in your example, because you are trying to use the struct literals to initialize pointers. Instead, you should define the structs first and t...
18,576
[ { "from": "human", "value": "Is it possible to initialize an array of pointers to structs?\nSomething like:\nstruct country_t *countries[] = {\n {\"United States of America\", \"America\"},\n {\"England\", \"Europe\"},\n {\"Ethiopia\", \"Africa\"} \n }\n\nI want to do that in order ...
I recently bought a Windows Mobile device and since I'm a developer I want to use it as a development platform. Yes, it's not supposed to be used like that but it's always with me and my laptop isn't. I know cke is a good editor for code but how can I run JavaScript/Ruby code without too much of a headache? I probably ...
Using a Windows Mobile device as a development platform is definitely a unique approach! While options are limited compared to desktop environments, there are still ways to run JavaScript and Ruby code directly on your device with some workarounds. Here are a few suggestions: ### For JavaScript: 1. **Web Development ...
12,611
[ { "from": "human", "value": "I recently bought a Windows Mobile device and since I'm a developer I want to use it as a development platform. Yes, it's not supposed to be used like that but it's always with me and my laptop isn't. I know cke is a good editor for code but how can I run JavaScript/Ruby code wi...
I have a structure in C#: public struct UserInfo { public string str1 { get; set; } public string str2 { get; set; } } The only rule is that UserInfo(str1="AA", str2="BB").Equals(UserInfo(str1="BB", str2="AA")) How to override the GetHashCode function for this structure?
To ensure that `UserInfo(str1="AA", str2="BB").Equals(UserInfo(str1="BB", str2="AA"))` returns true, you need to override both the `Equals` method and the `GetHashCode` method in your `UserInfo` struct. Since the equality is based on a combination of the `str1` and `str2` fields where the order does not matter, you ca...
8,161
[ { "from": "human", "value": "I have a structure in C#:\npublic struct UserInfo\n{\n public string str1\n {\n get;\n set;\n }\n\n public string str2\n {\n get;\n set;\n } \n}\n\nThe only rule is that UserInfo(str1=\"AA\", str2=\"BB\").Equals(UserInfo(str1=\"BB\", str2=\"AA\"))\...
I have a dict, which I need to pass key/values as keyword arguments.. For example.. d_args = {'kw1': 'value1', 'kw2': 'value2'} example(**d_args) This works fine, but if there are values in the d_args dict that are not accepted by the example function, it obviously dies.. Say, if the example function is defined as def...
Yes, you can programmatically list the keyword arguments that a specific function takes in Python by using the `inspect` module. The `inspect.signature` function can provide you with the function's signature, which includes information about its parameters. Here is how you can do it: 1. Import the `inspect` module. 2...
19,002
[ { "from": "human", "value": "I have a dict, which I need to pass key/values as keyword arguments.. For example..\nd_args = {'kw1': 'value1', 'kw2': 'value2'}\nexample(**d_args)\n\nThis works fine, but if there are values in the d_args dict that are not accepted by the example function, it obviously dies.. S...
I have a char array in a C application that I have to split into parts of 250 so that I can send it along to another application that doesn't accept more at one time. How would I do that? Platform: win32.
To split a `char` array into parts of 250 bytes in a C application for Windows, you can write a simple function that iterates over the original array and extracts sub-arrays (chunks) of the desired size. Here’s an example implementation that demonstrates how to achieve this: ```c #include <stdio.h> #include <string.h>...
15,290
[ { "from": "human", "value": "I have a char array in a C application that I have to split into parts of 250 so that I can send it along to another application that doesn't accept more at one time. \nHow would I do that? Platform: win32. \n" }, { "from": "gpt", "value": "To split a `char` array in...
Summary Is that possible for webapps deployed on linux + tomcat5.5 to use/see all /usr/share/java/ jars automatically? Details I'm packaging my java webapp for Ubuntu (yet the question is related to any linux-based distro) and going to make it depend on tomcat. I'm going to put context descriptor (an xml file) to /usr/...
To enable your Java web application deployed on Tomcat 5.5 to use JARs located in `/usr/share/java`, you have a few options, although there isn't a straightforward way to automatically include all JARs from that directory without some maintenance. Below are some approaches to consider: ### 1. Modify the `CLASSPATH` Yo...
15,593
[ { "from": "human", "value": "Summary\nIs that possible for webapps deployed on linux + tomcat5.5 to use/see all /usr/share/java/ jars automatically?\nDetails\nI'm packaging my java webapp for Ubuntu (yet the question is related to any linux-based distro) and going to make it depend on tomcat.\nI'm going to ...