instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I am not a DBA by any means, but being a web developer means that I will have to install, setup, and administer databases. In the past, I have just followed the default installation for SQL Server. Over time, I have grown smarter and learned that default installations almost always leave doors open and leak. So...What ...
It's great that you're taking the initiative to learn about SQL Server installations and configurations! While you may not be a DBA, understanding the critical settings and best practices can significantly improve the security and performance of your SQL Server instance. Here are some critical settings and considerati...
46,409
[ { "from": "human", "value": "I am not a DBA by any means, but being a web developer means that I will have to install, setup, and administer databases. In the past, I have just followed the default installation for SQL Server. Over time, I have grown smarter and learned that default installations almost alw...
When developing an application wich will be used inside an intranet do you think Silverlight and WCF is a good solution ? Whould you use WCF Services or WCF Web Services to expose your model to the client ? When consuming a WCF Service the proxies will be generated under a reference and you can only have 1 service refe...
When considering whether to use Silverlight and WCF for an intranet application, there are several factors to take into account: ### Silverlight and WCF - **Silverlight**: Although Silverlight provided a rich internet application framework and was well-integrated with WCF, it has been deprecated since 2012, and suppor...
47,998
[ { "from": "human", "value": "When developing an application wich will be used inside an intranet do you think Silverlight and WCF is a good solution ?\nWhould you use WCF Services or WCF Web Services to expose your model to the client ?\nWhen consuming a WCF Service the proxies will be generated under a ref...
Hi I am trying to connect to a WSE2 web service (.Net 1.1) on the internet The client (also .Net 1.1) is inside my company LAN and has to go out through a proxy server to the internet. When I make the WSE2 call with the generated proxty it fails with the following Microsoft.Web.Services2.AsynchronousOperationException...
When working with .NET 1.1 and WSE 2.0 to connect to a web service through a proxy, you need to ensure that the proxy settings are correctly configured for your application. While the generated proxy class might not provide a direct way to set proxy settings, you can still configure the proxy settings using the `WebReq...
48,825
[ { "from": "human", "value": "Hi I am trying to connect to a WSE2 web service (.Net 1.1)\non the internet \nThe client (also .Net 1.1) is inside my company LAN and has to go out through a proxy server to the internet.\nWhen I make the WSE2 call with the generated proxty it fails with the following Microsoft....
Suppose someone is building you a CMS (Content Management System) from scratch. What are the most important features to include and why?
When building a Content Management System (CMS) from scratch, it’s essential to consider a range of features that cater to both end-users (content creators, editors) and administrators. Here are the most important features to include and the reasons why they are crucial: ### Core Features 1. **User Management** - ...
46,932
[ { "from": "human", "value": "Suppose someone is building you a CMS (Content Management System) from scratch. What are the most important features to include and why?\n" }, { "from": "gpt", "value": "When building a Content Management System (CMS) from scratch, it’s essential to consider a range...
Currently i'm using pretty much Unix + Mysql + Perl + Apache with some javascript to make it more ajax like. and i've been looking at sites which are web 2.0 and stackoverflow and really like the simple design and the smooth flow from pages and action, etc. i'm trying to decide if learning catalyst, mason and the likes...
Hi Steve, It's great to hear that you're exploring ways to improve your web development skills and the quality of your projects. Let's break down your considerations based on the three criteria you mentioned: career development, ease of building powerful Web 2.0 websites, and the comparison between Catalyst and LAMP. ...
48,699
[ { "from": "human", "value": "Currently i'm using pretty much Unix + Mysql + Perl + Apache with some javascript to make it more ajax like. and i've been looking at sites which are web 2.0 and stackoverflow and really like the simple design and the smooth flow from pages and action, etc.\ni'm trying to decide...
I've been using HInclude (http://www.mnot.net/javascript/hinclude/) for sometime now and its working great, but there is one problem though. The part of my site which is fetched using HInclude doesn't get refreshed everytime I hit the back button in Internet Exploer (6.x + and 7.0 also). It works fine on other browsers...
The issue you're facing with Internet Explorer (especially older versions like 6.x and 7.0) is due to the way these browsers handle caching. Even when you set `Cache-Control` and `Pragma` headers to "no-cache", IE might still cache AJAX responses in certain situations, especially for files fetched through JavaScript. ...
49,196
[ { "from": "human", "value": "I've been using HInclude (http://www.mnot.net/javascript/hinclude/) for sometime now and its working great, but there is one problem though. The part of my site which is fetched using HInclude doesn't get refreshed everytime I hit the back button in Internet Exploer (6.x + and 7...
My company is about to hire .NET developers. We work on a variety of .NET platforms: ASP.NET, Compact Framework, Windowsforms, Web Services. I'd like to compile a list/catalog of good questions, a kind of minimum standard to see if the applicants are experienced. So, my question is: What questions do you think should a...
Creating a comprehensive set of interview questions for .NET developers that covers both technical knowledge and problem-solving abilities is essential for identifying qualified candidates. Below is a categorized list of questions that can help you assess applicants' expertise in .NET technologies while also evaluating...
45,527
[ { "from": "human", "value": "My company is about to hire .NET developers. We work on a variety of .NET platforms: ASP.NET, Compact Framework, Windowsforms, Web Services. I'd like to compile a list/catalog of good questions, a kind of minimum standard to see if the applicants are experienced. So, my question...
I'm trying to figure out the best lower-budget home office development hardware setup. My laptop is aging. My latest idea is that I would like a very powerful desktop paired with a less-powerful laptop. The idea being that the desktop would do the heavy lifting while the laptop would allow me to work untethered (but wi...
Your idea of pairing a powerful desktop with a less powerful laptop to create a flexible and efficient home office setup is very feasible and can be a great way to extend the life of your devices while maximizing productivity. Here are some suggestions and considerations for implementing this setup: ### Desktop Setup ...
47,363
[ { "from": "human", "value": "I'm trying to figure out the best lower-budget home office development hardware setup. My laptop is aging.\nMy latest idea is that I would like a very powerful desktop paired with a less-powerful laptop. The idea being that the desktop would do the heavy lifting while the laptop...
I'm trying to write a simple program in VC++ which will just initialize the task scheduler. I'm following the example suggested at the MSDN site, but I get unresolved symbol errors from the linker. The error is on this line: hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, ...
The errors you are encountering, such as `LNK2001: unresolved external symbol _CLSID_CTaskScheduler` and similar for `IID_ITaskScheduler`, are likely due to missing definitions for these identifiers. While you may have included the appropriate headers, you also need to ensure that you are linking against the right libr...
42,244
[ { "from": "human", "value": "I'm trying to write a simple program in VC++ which will just initialize the task scheduler. I'm following the example suggested at the MSDN site, but I get unresolved symbol errors from the linker. \nThe error is on this line:\n hr = CoCreateInstance(CLSID_CTaskScheduler,\n ...
I have a team of developers distributed Globally over different time zones. what are the best tools to achieve maximum productivity in such a team? I am looking for: Source Control Bug Tracking Build Management Any other thing that may help Thanks
Managing a distributed team of developers across different time zones can be challenging, but with the right tools, you can maximize productivity and ensure smooth collaboration. Here’s a list of recommended tools for various aspects of the development process: ### Source Control 1. **GitHub**: A popular choice for v...
45,222
[ { "from": "human", "value": "I have a team of developers distributed Globally over different time zones.\nwhat are the best tools to achieve maximum productivity in such a team?\nI am looking for:\n\nSource Control\nBug Tracking\nBuild Management\nAny other thing that may help\n\nThanks\n" }, { "fro...
I am trying to build an Adobe AIR application that will run on Linux/Mac OS/Windows, which monitors user's browsing history. How can my AIR application find out which browsers are installed? In other words, the list of browsers' history to monitor. Also is there any way to know if a browser is running or not at run t...
Creating an Adobe AIR application to monitor browsing history across different operating systems and browsers requires several steps and considerations. Below, I’ll outline how to detect installed browsers, check if they are running, and provide information on accessing history files for common browsers. ### 1. Detect...
42,548
[ { "from": "human", "value": "I am trying to build an Adobe AIR application that will run on Linux/Mac OS/Windows, which monitors user's browsing history. \nHow can my AIR application find out which browsers are installed? In other words, the list of browsers' history to monitor. \nAlso is there any way to k...
How do you run a scheduled task with Quest powershell snap in?
Running a scheduled task with the Quest PowerShell Snap-in involves a few steps. Quest provides a set of cmdlets for managing Active Directory and other resources, and you can use these cmdlets within PowerShell scripts that can be scheduled using Windows Task Scheduler. ### Here’s how to do it: #### Step 1: Install ...
48,394
[ { "from": "human", "value": "How do you run a scheduled task with Quest powershell snap in? \n" }, { "from": "gpt", "value": "Running a scheduled task with the Quest PowerShell Snap-in involves a few steps. Quest provides a set of cmdlets for managing Active Directory and other resources, and yo...
I have a class 'Database' that works as a wrapper for ADO.net. For instance, when I need to execute a procedure, I call Database.ExecuteProcedure(procedureName, parametersAndItsValues). We are experiencing serious problems with Deadlock situations in SQL Server 2000. Part of our team is working on the sql code and tran...
Yes, you can handle deadlock situations inside the catch block of your `ExecuteQuery` method. When SQL Server encounters a deadlock, it will select one of the transactions to be the "deadlock victim" and throw a `SqlException`. To handle this scenario, you can catch the `SqlException` and check if the error code indica...
45,333
[ { "from": "human", "value": "I have a class 'Database' that works as a wrapper for ADO.net. For instance, when I need to execute a procedure, I call Database.ExecuteProcedure(procedureName, parametersAndItsValues).\nWe are experiencing serious problems with Deadlock situations in SQL Server 2000. Part of ou...
If I escape some code because I want it to display as the actual code in html (eg for an example code snippet), save it to the database and then pull it back to the editor (an html page), it is displayed as html, as opposed to the escaped text. My problem arises when I include a textarea tag in the text because it will...
Yes, the behavior you're observing is indeed intended and is a fundamental aspect of how browsers parse and render HTML. When you include HTML tags like `<textarea>` in your content, the browser interprets them as actual HTML elements, which can lead to unexpected behavior, such as closing the `<textarea>` before you'r...
45,615
[ { "from": "human", "value": "If I escape some code because I want it to display as the actual code in html (eg for an example code snippet), save it to the database and then pull it back to the editor (an html page), it is displayed as html, as opposed to the escaped text.\nMy problem arises when I include ...
I was wondering if there's a way I can automate the generation of XML files from XSD schemas given that I have the data and the labels. I'd like to do this in python/java. It seems very possible, yet I can't find any library that allows me to do this. I'm looking for a fairly quick solution.. Any ideas? See also: how-...
Generating XML files from XSD schemas using provided data and labels is definitely possible with both Python and Java. While there may not be a single library that does exactly what you’re asking for, you can combine a few tools and techniques to achieve this. Below, I provide solutions for both Python and Java. ### P...
48,762
[ { "from": "human", "value": "I was wondering if there's a way I can automate the generation of XML files from XSD schemas given that I have the data and the labels. I'd like to do this in python/java. It seems very possible, yet I can't find any library that allows me to do this. I'm looking for a fairly qu...
I'm using the asp:TreeView and would really rather just output it to a standard nested <HTML> list using <ul> and <li>, at the moment it produces some pretty ugly code using <div>s and <table>s. Has anyone got a decent workaround? I'm using <asp:XmlDataSource> to populate the TreeView This explains the current situatio...
Certainly! If you want to convert an `asp:TreeView` control to output a standard nested HTML list using `<ul>` and `<li>`, you might need to take a different approach since the default rendering of the TreeView control does not provide the output format you desire. ### Option 1: Custom Control/Rendering One way to ac...
47,604
[ { "from": "human", "value": "I'm using the asp:TreeView and would really rather just output it to a standard nested <HTML> list using <ul> and <li>, at the moment it produces some pretty ugly code using <div>s and <table>s.\nHas anyone got a decent workaround?\nI'm using <asp:XmlDataSource> to populate the ...
I've been using moq to mock objects in my unit tests and I've seen on the site about moq that it is able to mock both classes and interfaces. I had a discussion with one of my work mates the other day and they stated that there is never a reason to mock classes and I should only mock interfaces. I didn't really have an...
The debate about whether to mock classes or interfaces is a common one in unit testing and often centers around design principles and the goals of testing. Here are some key points to consider: ### Mocking Interfaces vs. Mocking Classes 1. **Design Intent**: - **Interfaces**: Mocking interfaces aligns with the pri...
46,782
[ { "from": "human", "value": "I've been using moq to mock objects in my unit tests and I've seen on the site about moq that it is able to mock both classes and interfaces.\nI had a discussion with one of my work mates the other day and they stated that there is never a reason to mock classes and I should onl...
I am modifying a Nant build script to run some unit tests. I have different targets for locally run tests and tests to be run on team city. <target name="run-unit-tests"> <property name="test.executable" value="tools\nunit\nunit-console.exe"/> <call target="do-unit-tests"/> </target> <target name="run-unit-tes...
In Nant, there's no direct way to check which target called the current target. However, you can work around this limitation by using properties that you set before calling the `do-unit-tests` target. This way, you can control the behavior based on whether you're running the tests locally or in TeamCity. Here’s a poss...
49,186
[ { "from": "human", "value": "I am modifying a Nant build script to run some unit tests. I have different targets for locally run tests and tests to be run on team city.\n<target name=\"run-unit-tests\"> \n <property name=\"test.executable\" value=\"tools\\nunit\\nunit-console.exe\"/>\n <call target=\"d...
How can I add an input form in an Excel sheet. I want to insert values into an Excel cell using the form.
Adding an input form to an Excel sheet can streamline data entry and help organize information. You can achieve this using Excel's built-in features like Form Controls or Data Validation, or you can create a UserForm using VBA (Visual Basic for Applications). Here’s how you can do it: ### Method 1: Using Form Controls...
42,298
[ { "from": "human", "value": "How can I add an input form in an Excel sheet. I want to insert values into an Excel cell using the form.\n" }, { "from": "gpt", "value": "Adding an input form to an Excel sheet can streamline data entry and help organize information. You can achieve this using Excel...
ORACLE does not permit NULL values in any of the columns that comprise a primary key. It appears that the same is true of most other "enterprise-level" systems. At the same time, most systems also allow unique contraints on nullable columns. Why is it that unique constraints can have NULLs but primary keys can not? Is ...
The difference in handling NULL values between primary keys and unique constraints in relational database systems, like Oracle, is primarily grounded in the definitions and roles of these constraints within the relational model, rather than being merely a technical limitation. Here's an explanation of the underlying lo...
48,447
[ { "from": "human", "value": "ORACLE does not permit NULL values in any of the columns that comprise a primary key. It appears that the same is true of most other \"enterprise-level\" systems.\nAt the same time, most systems also allow unique contraints on nullable columns.\nWhy is it that unique constraints...
Can a macro be written in Scheme (with define-syntax, for example) which will take expressions like this: (op a b c d e f g h i j) And yield expressions like this as output? (op (op (op (op (op (op (op (op (op a b) c) d) e) f) g) h) i) j) Of course, for arbitrary lengths. I can't think of a way to do it, given some ...
Yes, you can indeed write a macro in Scheme that will take an arbitrary number of arguments and produce the nested `op` expressions you described. This can be achieved using `define-syntax` and `syntax-rules` for pattern matching and recursion. Here's a step-by-step explanation and the implementation: 1. **Base Case*...
45,939
[ { "from": "human", "value": "Can a macro be written in Scheme (with define-syntax, for example) which will take expressions like this:\n(op a b c d e f g h i j)\n\nAnd yield expressions like this as output?\n(op (op (op (op (op (op (op (op (op a b) c) d) e) f) g) h) i) j) \n\nOf course, for arbitrary length...
I've recorded a few scripts with this tool, but when I run it, 100% of my results codes are either 404 (Not Found) or 501 (Not Implemented). How can this be?
If you are consistently receiving 404 (Not Found) and 501 (Not Implemented) status codes when running your scripts, here are a few potential causes and solutions to consider: ### 1. **Check the URL** - **404 Not Found**: This error indicates that the server could not find the requested resource. Make sure that the ...
49,477
[ { "from": "human", "value": "I've recorded a few scripts with this tool, but when I run it, 100% of my results codes are either 404 (Not Found) or 501 (Not Implemented).\nHow can this be?\n" }, { "from": "gpt", "value": "If you are consistently receiving 404 (Not Found) and 501 (Not Implemented)...
I have this routine that calculates the seconds-to-date for a struct tm. On Linux my implementation using mktime works fine, but mktime on windows VS2003/.NET 1.1 returns -1 for pre-epoch datetimes. How do I calculate meaningful time_t values (i.e. value + secondsToEpoch == secondsToDatetime ) from a for pre-epoch ...
To calculate `time_t` values for pre-epoch dates without relying on `mktime`, especially since `mktime` may not handle these dates correctly on some platforms like Windows, you can manually compute the seconds since the epoch (January 1, 1970) for a given `struct tm`. Here's how you can achieve this in ANSI C++: 1. ...
44,117
[ { "from": "human", "value": "I have this routine that calculates the seconds-to-date for a struct tm. On Linux my implementation using mktime works fine, but \nmktime on windows VS2003/.NET 1.1 returns -1 for pre-epoch datetimes.\nHow do I calculate meaningful time_t values (i.e. \n\nvalue + secondsToEpoch ...
how do i get a list of user that have completed or not completed or not responded to a survey. so i have a survey, lets say "survey A". in this survey i have a list of people or groups that must fill the survey. sharepoint already gives us a list of respondents, but i want to make a list of people that have not respon...
To generate a list of users who have completed, not completed, or not responded to a survey in SharePoint using C#, you can follow these general steps: 1. **Access SharePoint Site**: Use the SharePoint Client Object Model or REST API to access the SharePoint site. 2. **Retrieve the List of Participants**: Fetch the l...
47,093
[ { "from": "human", "value": "how do i get a list of user that have completed or not completed or not responded to a survey. \nso i have a survey, lets say \"survey A\". in this survey i have a list of people or groups that must fill the survey. sharepoint already gives us a list of respondents, but i want t...
Somebody used libapt or libept to list packages and get informations about package in a debian-like system? Libapt is not well-documented at all, and i've found few examples and tutorials about libept. Can someone explain me best methods to get a list of every packages in the apt-system get informations about single p...
Using `libapt` and `libept` in Debian-like systems can indeed be a bit challenging due to the lack of comprehensive documentation. However, I can provide you with some guidance on how to perform some common tasks using these libraries. ### Prerequisites Before you start, ensure you have the necessary development pack...
42,646
[ { "from": "human", "value": "Somebody used libapt or libept to list packages and get informations about package in a debian-like system?\nLibapt is not well-documented at all, and i've found few examples and tutorials about libept. Can someone explain me best methods to\n\nget a list of every packages in th...
I've got some MBean operations that I need to secure. I would like the users to be required to log in as the server admin and I would like this to be setup programmaticly or, preferably by a config file in the WAR, when the app is deployed. I want to avoid requiring the admin to set this up as a deployment step. We're...
To secure MBean operations in a Java application running on GlassFish, you can achieve this by configuring role-based security using a deployment descriptor or programmatically. Here's a step-by-step guide for both methods, focusing on a configuration approach that minimizes deployment steps. ### Using a Configuration...
45,586
[ { "from": "human", "value": "I've got some MBean operations that I need to secure. I would like the users to be required to log in as the server admin and I would like this to be setup programmaticly or, preferably by a config file in the WAR, when the app is deployed. I want to avoid requiring the admin to...
I am looking for a way to determine how much free disk space there is available to my application. I have tried using NSFileManager's fileSystemAttributesAtPath with NSFileSystemFreeSize, but this is giving me the total free space on the iPhone and not what is available to my application by the Sandbox. I believe appli...
To determine how much free disk space is available specifically to your application in the iOS sandbox, you can use the `NSFileManager` class to get the filesystem attributes of your application's documents directory. However, the total free space returned by `NSFileSystemFreeSize` indeed gives you the total free space...
48,177
[ { "from": "human", "value": "I am looking for a way to determine how much free disk space there is available to my application.\nI have tried using NSFileManager's fileSystemAttributesAtPath with NSFileSystemFreeSize, but this is giving me the total free space on the iPhone and not what is available to my a...
in a script when error comes i am just using "EXITGLOBALITERATION" command but its not going to the next iteration ....Is there any other alternative for this??
In scripting, the handling of errors can vary depending on the programming language and the context you are working in. The `EXITGLOBALITERATION` command seems specific to a certain framework or scripting environment, and its behavior may not allow continuing to the next iteration in case of an error. If you want to s...
49,308
[ { "from": "human", "value": "in a script when error comes i am just using \"EXITGLOBALITERATION\" command but its not going to the next iteration ....Is there any other alternative for this??\n" }, { "from": "gpt", "value": "In scripting, the handling of errors can vary depending on the programm...
In my index.php file I always load some classes used later. From profiler it states it sometimes can take about 20% of entire code. Is there any improvement that can make this process faster? I would try to make this list of classes shorter, but app is very big and checking all dependencies will be costly.
Loading classes in PHP, especially in a large application, can indeed contribute to the overall loading time if not managed properly. Here are several strategies you can consider to improve the performance of class loading without drastically changing your existing architecture: ### 1. **Autoloading** Make sure you ar...
44,730
[ { "from": "human", "value": "In my index.php file I always load some classes used later. From profiler it states it sometimes can take about 20% of entire code. Is there any improvement that can make this process faster?\nI would try to make this list of classes shorter, but app is very big and checking all...
When laying out a WinForm in Visual Studio you get the ability to resize and align your controls very easily with drag handles and border alignment hints. I'd like to do the same with a runtime control to enable the user to position an image on a page. For example, if the user has a photo and they want to place it as a...
Creating a custom layout editor similar to the built-in WinForms designer that includes docking, alignment hints, and resizing capabilities is indeed a complex task. Unfortunately, there is no direct way to inherit the standard WinForms layout editor behavior for runtime control manipulation out of the box. However, yo...
45,413
[ { "from": "human", "value": "When laying out a WinForm in Visual Studio you get the ability to resize and align your controls very easily with drag handles and border alignment hints.\nI'd like to do the same with a runtime control to enable the user to position an image on a page.\nFor example, if the user...
I'm curious to know if there is an easy way to mock an IMAP server (a la the imaplib module) in Python, without doing a lot of work. Is there a pre-existing solution? Ideally I could connect to the existing IMAP server, do a dump, and have the mock server run off the real mailbox/email structure. Some background into t...
If you're looking for a simple way to mock an IMAP server in Python, you can consider a couple of existing libraries that can help you without needing to implement a lot of work yourself. One of the most notable libraries for mocking IMAP servers is `aiomockimap`, which is built on `asyncio` but may require adapting to...
45,724
[ { "from": "human", "value": "I'm curious to know if there is an easy way to mock an IMAP server (a la the imaplib module) in Python, without doing a lot of work.\nIs there a pre-existing solution? Ideally I could connect to the existing IMAP server, do a dump, and have the mock server run off the real mailb...
A lot of times in code on the internet or code from my co-workers I see them creating an Object with just one method which only gets used once in the whole application. Like this: class iOnlyHaveOneMethod{ public function theOneMethod(){ //loads and loads of code, say 100's of lines // but it only gets us...
Your question addresses a common design decision in software development regarding organization and encapsulation of code. There are different approaches to structuring code, and each has its advantages and disadvantages. Let's explore the different scenarios you've presented and discuss their implications in terms of ...
48,297
[ { "from": "human", "value": "A lot of times in code on the internet or code from my co-workers I see them creating an Object with just one method which only gets used once in the whole application. Like this:\n class iOnlyHaveOneMethod{\n public function theOneMethod(){\n //loads and loads of code, sa...
If you have a pending operation, eg stream.BeginRead(_buffer, 0, _buffer.Length, _asyncCallbackRead, this); and you close the stream provider, eg serialPort.Close(); you unsurprisingly cause an exception. Is there an preferred method by which one might cancel a pending APM operation, prior to closing the port? The w...
Your approach to managing asynchronous read operations on a stream, particularly in the context of a serial port, is quite well thought out. Handling the potential for an exception during `EndRead` when closing the stream is critical to ensuring a clean shutdown of your application. Let's recap your solution and consid...
48,051
[ { "from": "human", "value": "If you have a pending operation, eg\nstream.BeginRead(_buffer, 0, _buffer.Length, _asyncCallbackRead, this);\n\nand you close the stream provider, eg\nserialPort.Close();\n\nyou unsurprisingly cause an exception.\nIs there an preferred method by which one might cancel a pending ...
Following are the PHP code lines which I am using to open a PDF file: $pdf_generartor = new PDFlib(); $doc = $pdf_generartor -> open_pdi_document("Report.pdf", "") or die ("ERROR: " . $pdf_generartor -> get_errmsg()); Though the file is at required location, every time I receive following error: ERROR: Couldn't open ...
The error you're encountering indicates that the PDFlib library is unable to locate the PDF file "Report.pdf". Here are some possible reasons and solutions you can try to resolve the issue: 1. **Check the file path**: Make sure that the file "Report.pdf" is located in the directory from where the script is being execu...
43,809
[ { "from": "human", "value": "Following are the PHP code lines which I am using to open a PDF file:\n$pdf_generartor = new PDFlib();\n\n$doc = $pdf_generartor -> open_pdi_document(\"Report.pdf\", \"\") or die (\"ERROR: \" . $pdf_generartor -> get_errmsg());\n\nThough the file is at required location, every t...
Is it possible to forward declare an standard container in a header file? For example, take the following code: #include <vector> class Foo { private: std::vector<int> container_; ... }; I want to be able to do something like this: namespace std { template <typename T> class vector; } class Foo { privat...
In C++, it is possible to forward declare a class, but it has limitations, especially for standard containers like `std::vector`. A forward declaration provides a way to inform the compiler that a class exists without providing its full definition, which can save compilation time and help to avoid circular dependencies...
46,444
[ { "from": "human", "value": "Is it possible to forward declare an standard container in a header file? For example, take the following code:\n#include <vector>\n\nclass Foo\n{\nprivate:\n std::vector<int> container_;\n ...\n};\n\nI want to be able to do something like this:\nnamespace std\n{\n tem...
I've always been one to simply use: List<String> names = new ArrayList<>(); I use the interface as the type name for portability, so that when I ask questions such as this, I can rework my code. When should LinkedList be used over ArrayList and vice-versa?
Both `ArrayList` and `LinkedList` are implementations of the `List` interface in Java, but they have different underlying data structures and performance characteristics. Choosing between them depends on your specific use case and the operations you need to perform on the list. Here’s a breakdown of when to use each: ...
49,149
[ { "from": "human", "value": "I've always been one to simply use:\nList<String> names = new ArrayList<>();\n\nI use the interface as the type name for portability, so that when I ask questions such as this, I can rework my code.\nWhen should LinkedList be used over ArrayList and vice-versa?\n" }, { "...
I need the tool for graphical representing of work flow in a program (like electronic circuits are described with graphical representation). The representation has to be like the following: functions are boxes and arrows between boxes are "messages". Like this: alt text http://img372.imageshack.us/img372/8471/functions...
It sounds like you have specific requirements for a graphical representation tool tailored for visualizing function calls and their connections. Since you want something free, simple, and capable of exporting to a real programming language, here are a few recommendations that you might find useful: 1. **Draw.io (now D...
45,757
[ { "from": "human", "value": "I need the tool for graphical representing of work flow in a program (like electronic circuits are described with graphical representation). The representation has to be like the following: functions are boxes and arrows between boxes are \"messages\". Like this:\nalt text http:...
I'm using the repository pattern to query our database using NHibernate. It makes it really easy to do things like: public T GetById(int id) {...} But that doesn't help much when someone start mucking with the querystrings to see things they aren't allowed to. To compound it, some objects are deeply nested children of...
Implementing authorization in a way that respects the hierarchy of your objects can be a complex task, especially when dealing with nested relationships like your example of a blog with authors, posts, and comments. There are several approaches you can take to enforce authorization using the repository pattern with NHi...
48,517
[ { "from": "human", "value": "I'm using the repository pattern to query our database using NHibernate. It makes it really easy to do things like:\npublic T GetById(int id) {...}\nBut that doesn't help much when someone start mucking with the querystrings to see things they aren't allowed to. \nTo compound it...
I want to do this, but haven't figured it quite out yet... $(document).ready(function() { $("a.whateverclass").click(function() { $("div.whateverclass").show(); return false; }); Basically when a link with a certain class is clicked all divs with that class are shown. The cl...
To achieve this functionality while keeping your code flexible enough to match any classes, you can use the `this` keyword in jQuery to refer to the clicked link and get its class names. You can then use those class names to find and show the corresponding `<div>` elements. Here's a modified version of your code: ```j...
49,204
[ { "from": "human", "value": "I want to do this, but haven't figured it quite out yet...\n $(document).ready(function() {\n $(\"a.whateverclass\").click(function() {\n $(\"div.whateverclass\").show();\n return false;\n });\n\nBasically when a link with a certain class i...
I'm currently working on desktop application which calls third party API. After authorizing against their "web service", a kind of user token is returned which should be stored locally (even if user closes application). So I'm looking for solution to encrypt this token with user specific key. Does Windows (and .NET) ...
Yes, Windows and .NET provide a standard way to securely store and encrypt sensitive data like tokens. For this use case, you can use the `DataProtectionProvider` class from the Windows Data Protection API (DPAPI), which is designed to protect data using the user's credentials. This ensures that only the user who encry...
46,654
[ { "from": "human", "value": "I'm currently working on desktop application which calls third party API. After authorizing against their \"web service\", a kind of user token is returned which should be stored locally (even if user closes application). \nSo I'm looking for solution to encrypt this token with...
Greetings, I'm in the middle of writing a Flash application which has multilingual support. My initial choice of font for this was Tahoma, for its Unicode support. The client prefers a non-standard font such as Lucida Handwriting. Lucida Handwriting doesn't have the same, say, Cyrillic support as Tahoma, which poses...
Hi Alexey, You've presented some thoughtful options for addressing the multilingual requirements in your Flash application, particularly with the font issues. Here’s a breakdown of your options along with my recommendations: ### 1. **Provide a List of Unicode-Compatible Fonts** This approach allows your client to cho...
44,530
[ { "from": "human", "value": "Greetings,\nI'm in the middle of writing a Flash application which has multilingual support. My initial choice of font for this was Tahoma, for its Unicode support. The client prefers a non-standard font such as Lucida Handwriting. Lucida Handwriting doesn't have the same, sa...
I'm currently thinking about a repository pattern for my data objects, where multiple IQueryable<> instances can be registered as data sources, but it seems its not so easy to get it running. Running a simple LINQ query with LINQ to entities and LINQ To Objects doesn't work. Do you think this is in general possible? Ma...
Using the Repository Pattern with multiple `IQueryable<>` instances can indeed be challenging, especially when combining different data sources like LINQ to Entities and LINQ to Objects. The issue you're experiencing with `Union` and the fact that one `IQueryable` seems to be ignored could be due to how LINQ translates...
47,609
[ { "from": "human", "value": "I'm currently thinking about a repository pattern for my data objects, where multiple IQueryable<> instances can be registered as data sources, but it seems its not so easy to get it running.\nRunning a simple LINQ query with LINQ to entities and LINQ To Objects doesn't work. Do...
Using the standard win32 api, what's the best way to detect more than one user is logged on? I have an upgrade to our software product that can't be run when more than one user is logged in. (I know this is something to be avoided because of its annoyance factor, but the product is very complicated. You'll have to t...
To detect whether more than one user is logged onto a Windows system using the Win32 API, you can utilize the `NetSessionEnum` function from the Windows Networking API. This function will allow you to enumerate all active user sessions on the machine. Here’s a brief outline of how to achieve this: 1. **Include necess...
45,257
[ { "from": "human", "value": "Using the standard win32 api, what's the best way to detect more than one user is logged on? I have an upgrade to our software product that can't be run when more than one user is logged in. (I know this is something to be avoided because of its annoyance factor, but the produ...
I am planning a fresh installation of SQL Server 2005 on a new machine, which I have to order. I know that tempdb tuning is very important to the overall performance of the SQL Server instance. I've read that it's best practice to create as many tempdb files as you have CPU's (or cores?). Is that correct? Are there any...
Yes, you are correct that tempdb tuning is important for the overall performance of your SQL Server instance. Here are some best practices related to tempdb configuration, including file count and disk setup: ### 1. **Number of TempDB Files**: - **File Count**: It is generally recommended to create one tempdb data ...
44,608
[ { "from": "human", "value": "I am planning a fresh installation of SQL Server 2005 on a new machine, which I have to order. I know that tempdb tuning is very important to the overall performance of the SQL Server instance.\nI've read that it's best practice to create as many tempdb files as you have CPU's (...
I'm a total newbie to SVN and haven't been able to find an answer for the following situation. I have an ASP .NET 2.0 web app that I am developing. I am using my local IIS as the development web server (i.e. not the Visual Studio web development server). My development environment is VS2005, Vista, IIS7, TortoiseSVN / ...
To effectively manage your ASP.NET web application development in SVN given your folder structure, you can follow these steps: ### 1. Use a Single Repository It's common to use a single repository for your project, so you can keep all relevant files in version control. Given your setup, you will want to structure you...
48,154
[ { "from": "human", "value": "I'm a total newbie to SVN and haven't been able to find an answer for the following situation.\nI have an ASP .NET 2.0 web app that I am developing. I am using my local IIS as the development web server (i.e. not the Visual Studio web development server). My development environm...
Is there any possibility how to enumerate AppDomains within Process?
In .NET, AppDomains are used to provide isolation between applications running within the same process. You can enumerate AppDomains in a process by using the `AppDomain` class. Here is a simple way to enumerate the AppDomains within the current process using C#. You need to ensure that you have the appropriate permis...
49,307
[ { "from": "human", "value": "Is there any possibility how to enumerate AppDomains within Process?\n" }, { "from": "gpt", "value": "In .NET, AppDomains are used to provide isolation between applications running within the same process. You can enumerate AppDomains in a process by using the `AppDo...
I am having some issues with using the OrderBy extension method on a LINQ query when it is operating on an enum type. I have created a regular DataContext using visual studio by simply dragging and dropping everything onto the designer. I have then created seperate entity models, which are simply POCO's, and I have use...
The issue you are encountering relates to how LINQ to SQL translates the query into SQL. When you use `OrderBy(c => c.Status)`, LINQ to SQL is attempting to order by an `enum` type, which can lead to type mismatch issues if the underlying database representation is not clearly understood by the LINQ provider. Here are...
49,689
[ { "from": "human", "value": "I am having some issues with using the OrderBy extension method on a LINQ query when it is operating on an enum type. I have created a regular DataContext using visual studio by simply dragging and dropping everything onto the designer. I have then created seperate entity models...
I would like to tie an action to a PocketPC button (biggest button at the center - don't know how it is called). I tried to tie the action to WM_GETTEXT message, but this message is sent on every key press and don't know how to add an action just to the specific button. Does anyone know how this could be done? Thanks!...
To tie an action to a specific button on a PocketPC device, you will typically handle the button press events rather than using `WM_GETTEXT`, which is used for text retrieval and not for button press handling. The button you are referring to (the biggest button in the center of the screen) is likely the "Enter" or "OK...
49,737
[ { "from": "human", "value": "I would like to tie an action to a PocketPC button (biggest button at the center - don't know how it is called). \nI tried to tie the action to WM_GETTEXT message, but this message is sent on every key press and don't know how to add an action just to the specific button.\nDoes ...
I'm trying to select more than 80,000 record in SQL Server in a table that has millions of records. The issue is that I've the correct Index, but it takes more than 15 minutes to return the recordset. I'm using MS SQL Server 2000, I found a pagination method using stored procedures but it uses a temporal table that I h...
Selecting a large dataset in SQL Server, especially with millions of records, can indeed be a performance challenge. Here are some strategies you could consider to improve the speed of your queries without resorting to using temporary tables for pagination: 1. **Optimize Your Indexes**: - Ensure that you have the c...
47,617
[ { "from": "human", "value": "I'm trying to select more than 80,000 record in SQL Server in a table that has millions of records. The issue is that I've the correct Index, but it takes more than 15 minutes to return the recordset.\nI'm using MS SQL Server 2000, I found a pagination method using stored proced...
Is there a way to control the number of displayed rows in a DropDownList control? I'd like it to only display 10 rows, but it defaults to 30. This causes the list to appear higher than the control instead of below it because of its position on the page.
To control the number of displayed rows in a `DropDownList` control, the approach may vary depending on the framework or technology stack you're using. Below are solutions for several common scenarios: ### ASP.NET Web Forms In ASP.NET Web Forms, the `DropDownList` does not have a property to directly control the numbe...
47,599
[ { "from": "human", "value": "Is there a way to control the number of displayed rows in a DropDownList control? I'd like it to only display 10 rows, but it defaults to 30. This causes the list to appear higher than the control instead of below it because of its position on the page.\n" }, { "from": "...
I deveploped a simple WCF service called CLSAPIService that it's Contract contains a method named UpdateLastOpenCloseCall: [OperationContract(Name = "UpdateLastOpenCloseCall", Action = "http://uniform.com/UpdateLastOpenCloseCall")] CallResult UpdateLastOpenCloseCall(int iSwitchID, int iAgentID, string strExtension, Bus...
The issue you're experiencing is likely related to the way the `BusinessDataField` structure is defined and serialized in WCF. In particular, structures in .NET are typically treated differently than classes when it comes to serialization, especially if they are being used as data contracts. Here are a few potential r...
49,548
[ { "from": "human", "value": "I deveploped a simple WCF service called CLSAPIService that it's Contract contains a method named UpdateLastOpenCloseCall:\n[OperationContract(Name = \"UpdateLastOpenCloseCall\", Action = \"http://uniform.com/UpdateLastOpenCloseCall\")]\nCallResult UpdateLastOpenCloseCall(int iS...
In a HTML page references to Javascript files are rewritten with one additional subdirectory at the end: /+sfgRmluamFuX1R5cGU9amF2YV9zY3JpcHQmRmluamFuX0xhbmc9dGV4dC9qYXZhc2NyaXB0+. Why is that and can it be a source to potential problems? In our source code we have Javascript includes like this one: On development mac...
The behavior you’re observing, where JavaScript file references are rewritten with an additional subdirectory added at the end, is often indicative of some kind of URL rewriting or processing that occurs on the server side or through an intermediary like a proxy server or content delivery network (CDN). Here are some p...
48,853
[ { "from": "human", "value": "In a HTML page references to Javascript files are rewritten with one additional subdirectory at the end:\n/+sfgRmluamFuX1R5cGU9amF2YV9zY3JpcHQmRmluamFuX0xhbmc9dGV4dC9qYXZhc2NyaXB0+. \nWhy is that and can it be a source to potential problems?\nIn our source code we have Javascrip...
I've got to set up temporary SSL security on my classic ASP application on Windows 2000 server, IIS5. What do I need to do to activate SSL? I won't be able to get an official cert for a little while so I think I have to make my own. Steps? Do I need access to the router or anything or can I just do this through IIS?
To set up temporary SSL security on your Classic ASP application running on Windows 2000 Server with IIS 5, you'll need to create a self-signed SSL certificate since you mentioned that you won't be able to get an official certificate right away. Below are the steps to do this, along with some notes on router access: #...
45,250
[ { "from": "human", "value": "I've got to set up temporary SSL security on my classic ASP application on Windows 2000 server, IIS5. What do I need to do to activate SSL? I won't be able to get an official cert for a little while so I think I have to make my own.\nSteps? Do I need access to the router or anyt...
I have a structure: struct pkt_ { double x; double y; double alfa; double r_kw; }; typedef struct pkt_ pkt; A table of these structures: pkt *tab_pkt; tab_pkt = malloc(ilosc_pkt * sizeof(pkt)); What I want to do is to sort tab_pkt by tab_pkt.alfa and tab_pkt.r: qsort(tab_pkt, ilosc_pkt, sizeof(pkt), porowna...
Your approach to implementing the comparison function for `qsort` is on the right track, but there are a few important points to address. First, you need to cast the `const void *` pointers to `const pkt *` so that you can access the members of the structure. Second, you'll need to adjust your comparison logic to sort ...
48,481
[ { "from": "human", "value": "I have a structure:\nstruct pkt_\n{\n double x;\n double y;\n double alfa;\n double r_kw;\n};\n\ntypedef struct pkt_ pkt;\n\nA table of these structures:\npkt *tab_pkt;\n\ntab_pkt = malloc(ilosc_pkt * sizeof(pkt));\n\nWhat I want to do is to sort tab_pkt by tab_pkt.alfa and ...
I'm still new to ROR, so pardon the simplicity of the question... So http://www.example.com/controller/:id displays a record in my table, with :id being a number (1,2,3 etc.). Is there a way I can have :id in the URL be the value of a field in the displayed record? Such that I can have http://www.example.com/controlle...
Welcome to Ruby on Rails (RoR)! Yes, it's definitely possible to use a human-friendly identifier in your URLs instead of just the numeric `:id`. This is a common practice known as "pretty URLs" or "slugs." To achieve this, you'll need to make a few adjustments to your Rails application, including changes to your model,...
46,968
[ { "from": "human", "value": "I'm still new to ROR, so pardon the simplicity of the question...\nSo http://www.example.com/controller/:id displays a record in my table, with :id being a number (1,2,3 etc.).\nIs there a way I can have :id in the URL be the value of a field in the displayed record? Such that ...
I have a WCF Service decorated with WebInvoke attributes and WebHttp binding for JSON enabling. The service can be accessed from JavaScript until we try to make it working cross domain. Can you please recommend how to get this to work cross domain? We've tried to create proxy web handler but it gives "Bad Request" ever...
To enable cross-domain requests to your WCF service using WebHttpBinding and WebInvoke attributes, you generally need to handle CORS (Cross-Origin Resource Sharing). Here are steps you can follow to get it working: ### 1. Enable CORS in WCF You need to configure your WCF service to allow CORS by adding necessary head...
44,101
[ { "from": "human", "value": "I have a WCF Service decorated with WebInvoke attributes and WebHttp binding for JSON enabling. The service can be accessed from JavaScript until we try to make it working cross domain. Can you please recommend how to get this to work cross domain?\nWe've tried to create proxy w...
I'm thinking it would be smart to setup the Entity object context in Application_BeginRequest, store it in Request.items, use it throughout the request and dispose it in Application_EndRequest. That way the context is always available and I can navigate the Entity Framework object graph in my views, lazy loading what I...
Using `Application_BeginRequest` and `Application_EndRequest` in ASP.NET MVC can be a bit different from traditional ASP.NET Web Forms. In ASP.NET MVC, the request lifecycle is handled by a series of filters and the MVC pipeline, which is why you may not see the `Application_BeginRequest` and `Application_EndRequest` m...
42,348
[ { "from": "human", "value": "I'm thinking it would be smart to setup the Entity object context in Application_BeginRequest, store it in Request.items, use it throughout the request and dispose it in Application_EndRequest. That way the context is always available and I can navigate the Entity Framework obje...
Let's pretend I have the following xaml... <UserControl.Resources> <local:ViewModel x:Name="viewModel" /> <local:LoadChildrenValueConverter x:Name="valueConverter" /> </UserControl.Resources> <UserControl.DataContext> <Binding Source="{StaticResource viewModel}" /> </UserControl.DataContext> <Grid x:Name...
Your concern about having both a ViewModel and a separate ValueConverter to load child items in your TreeView is valid. You can achieve a cleaner design by integrating the functionality of the converter into your ViewModel. Instead of using a converter, you can implement the logic directly within your ViewModel to mana...
48,288
[ { "from": "human", "value": "Let's pretend I have the following xaml...\n\n<UserControl.Resources>\n <local:ViewModel x:Name=\"viewModel\" />\n <local:LoadChildrenValueConverter x:Name=\"valueConverter\" />\n</UserControl.Resources>\n\n<UserControl.DataContext>\n <Binding Source=\"{StaticResource v...
Problem At work we have a department wiki (running Mediawiki). Unfortunately several persons edit without logging in, and that makes it very difficult to track down editors to ask questions about the content. There are two strategies to improve this encourage logged in editing discourage anonymous editing. Encouragin...
Improving the engagement of users in a department wiki while balancing accessibility for anonymous contributors can indeed be challenging. Below are some ideas based on your considerations, specifically focusing on the "Did you forget to log in?" and delay ideas, as well as additional suggestions. ### Encouraging Logg...
47,630
[ { "from": "human", "value": "Problem\nAt work we have a department wiki (running Mediawiki). Unfortunately several\npersons edit without logging in, and that makes it very difficult to track\ndown editors to ask questions about the content.\nThere are two strategies to improve this\n\nencourage logged in ed...
Using Java, I need to encode a Map<String, String> of name value pairs to store into a String, and be able to decode it again. These will be stored in a database column, and will probably usually be short and simple, so the common case should produce a simple nice looking line, but shouldn't corrupt the data, even if...
To encode and decode a `Map<String, String>` in Java for storage in a single string while ensuring that the result is human-readable, we can use a simple and lightweight approach that doesn't require large libraries. One common approach is to use JSON encoding, which is fairly human-readable, and can be easily encoded ...
48,400
[ { "from": "human", "value": "Using Java, I need to encode a Map<String, String> of name value pairs to store into a String, and be able to decode it again. These will be stored in a database column, and will probably usually be short and simple, so the common case should produce a simple nice looking line...
I'm still fairly new to ASP.NET development so bear with me. I'm going to start development on an updated version of an ASP.NET 1.1 website, which I will develop in ASP.NET 3.5. Currently, my development server allows me to run web sites on 1.1 and 2.0. I've had the 3.5 framework installed, but is there any other confi...
When you're working with multiple versions of ASP.NET on the same server, particularly if you want to run applications built on ASP.NET 1.1, 2.0, and 3.5 simultaneously, there are several steps you need to take to ensure everything works smoothly. Here’s how you can set up your environment: ### Steps to Configure IIS ...
47,853
[ { "from": "human", "value": "I'm still fairly new to ASP.NET development so bear with me.\nI'm going to start development on an updated version of an ASP.NET 1.1 website, which I will develop in ASP.NET 3.5. Currently, my development server allows me to run web sites on 1.1 and 2.0. I've had the 3.5 framewo...
Is there a way to programmatically disable usb storage devices from working while still keeping usb ports functional for other types of devices like keyboards and mice?
Yes, you can programmatically disable USB storage devices while keeping USB ports functional for other types of devices like keyboards and mice. Here are several methods to achieve this, depending on the operating system you are using: ### For Windows 1. **Group Policy (Windows Pro and Enterprise versions)**: - Pr...
45,367
[ { "from": "human", "value": "Is there a way to programmatically disable usb storage devices from working while still keeping usb ports functional for other types of devices like keyboards and mice?\n" }, { "from": "gpt", "value": "Yes, you can programmatically disable USB storage devices while k...
Sorry in advance for the long question. What I'm really interested in is a way to programmatically check if the executing windows identity has adequate windows privileges to write to a directory (or file) in an ASP.NET web services application. But I'll settle for retrieving effective delete (modify) privileges for a u...
Yes, checking effective permissions on files and directories programmatically without performing actual I/O operations can be quite complex in .NET. Fortunately, there is a way to accomplish this using the `WindowsIdentity` class in combination with the Windows API. One common approach to determine if a user has speci...
46,497
[ { "from": "human", "value": "Sorry in advance for the long question.\nWhat I'm really interested in is a way to programmatically check if the executing windows identity has adequate windows privileges to write to a directory (or file) in an ASP.NET web services application. But I'll settle for retrieving ef...
I have a dropdown box and a literal tag inside an Update Panel. On the selection change event of the dropdown up requery the database and repopulate the literal tag and then call UPdatePanel.Update(). below, is there are way i can avoid having to create a new Oledbconnection each time as this seems slow. Can i reuse ...
You can improve the performance of your ASP.NET application by reusing the database connection. One common way to achieve this is by utilizing a singleton pattern for your database connection, or using a connection pool. However, it's important to understand that in ASP.NET, it's typically best practice not to store d...
47,915
[ { "from": "human", "value": "I have a dropdown box and a literal tag inside an Update Panel. On the selection change event of the dropdown up requery the database and repopulate the literal tag and then call UPdatePanel.Update().\nbelow, is there are way i can avoid having to create a new Oledbconnection e...
I'm working on a little web project that needs to keeps to a NumViews counter for each object/row in a DB table. I'm concerning that all the updates to rows would start really degrade performance both the table grows in object count, and the site would grow in use. I'm using .NET 3.5 with MSSQL 2K5 if it matters. Any ...
Hi Joel, It's great that you're thinking ahead about the performance implications of maintaining a view counter in your database! Here are some suggestions and considerations for your project: ### 1. Separate Counter Table Creating a separate table for your NumViews counter is indeed a common practice. This approach ...
48,810
[ { "from": "human", "value": "I'm working on a little web project that needs to keeps to a NumViews counter for each object/row in a DB table. I'm concerning that all the updates to rows would start really degrade performance both the table grows in object count, and the site would grow in use.\nI'm using ....
I have been playing around with the iPhone SDK recently. At first I wasn't taking advantage of anything that required version SDK version 2.2. However, I recently started using some features that were added or modified in 2.1 and 2.2. I installed the new 2.2 SDK and changed my project settings to target SDK 2.2. Howeve...
It sounds like you're encountering a common issue with the iOS simulator in Xcode, where the version selected does not automatically match your target SDK. Here are a few steps you can follow to ensure that the simulator launches with the correct version: 1. **Check Project Settings**: - Open your project in Xcode....
49,159
[ { "from": "human", "value": "I have been playing around with the iPhone SDK recently.\nAt first I wasn't taking advantage of anything that required version SDK version 2.2.\nHowever, I recently started using some features that were added or modified in 2.1 and 2.2.\nI installed the new 2.2 SDK and changed m...
When using the Ajax.BeginForm() helper in ASP.Net MVC, I can pass options with names of different functions, for example one to run OnBegin, one for OnSuccess etc. How do these work "under the hood"? The reason I'm asking is that I'm extending this to provide a JQuery based alternative, and I need to figure out how to ...
To implement a jQuery-based alternative to `Ajax.BeginForm()` in ASP.NET MVC, while also dynamically calling the function names specified in your JSON object, you'll need to leverage the way JavaScript functions are handled in the browser. ### Understanding the Mechanism When you use `Ajax.BeginForm()` with options l...
45,154
[ { "from": "human", "value": "When using the Ajax.BeginForm() helper in ASP.Net MVC, I can pass options with names of different functions, for example one to run OnBegin, one for OnSuccess etc. How do these work \"under the hood\"?\nThe reason I'm asking is that I'm extending this to provide a JQuery based a...
I am trying to create a SQL server login and database user from within my application, along with a custom application user row. I want these users to be able to create other users - i.e. the application will control who can/can't create users but I need all users to have permissions for creating SQL server logins and ...
Creating users with the ability to create other users in SQL Server can indeed be a bit tricky due to the permissions required. Based on your description, it seems like you are on the right track by granting the `db_accessadmin` role, but you might have misunderstood a bit about how user creation and permissions work. ...
46,204
[ { "from": "human", "value": "I am trying to create a SQL server login and database user from within my application, along with a custom application user row. I want these users to be able to create other users - i.e. the application will control who can/can't create users but I need all users to have permis...
Answers provided have all been great, I mentioned in the comments of Alnitak's answer that I would need to go take a look at my CSV Generation script because for whatever reason it wasn't outputting UTF-8. As was correctly pointed out, it WAS outputting UTF-8 - the problem existed with Ye Olde Microsoft Excel which wa...
The issue you're experiencing with special characters like '£' appearing incorrectly in your MySQL database (as '£') is likely due to a mismatch in character encoding between your PHP script, MySQL database, and your HTML form inputs. Here's a breakdown of steps you can take to resolve this issue. ### 1. Ensure Datab...
48,639
[ { "from": "human", "value": "Answers provided have all been great, I mentioned in the comments of Alnitak's answer that I would need to go take a look at my CSV Generation script because for whatever reason it wasn't outputting UTF-8. \nAs was correctly pointed out, it WAS outputting UTF-8 - the problem exi...
I started dabbling in groovy yesterday. There's an example on the groovy website that I understand but I would like to know more about why it works the way it does. What's confusing me is who[1..-1]. Is this like saying who[1..who.length()-1]? I can't find any documentation on this syntax. Are there any good groovy...
You're diving into Groovy, which is a dynamic language for the Java platform. Let's break down the syntax you're confused about, specifically `who[1..-1]`. ### Understanding the Syntax: `who[1..-1]` In Groovy, the range operator (`..`) allows you to create a range of values. The syntax `start..end` is used to define ...
47,921
[ { "from": "human", "value": "I started dabbling in groovy yesterday. There's an example on the groovy website that I understand but I would like to know more about why it works the way it does. What's confusing me is who[1..-1]. Is this like saying who[1..who.length()-1]? I can't find any documentation ...
When I try this code: a, b, c = (1, 2, 3) def test(): print(a) print(b) print(c) c += 1 test() I get an error from the print(c) line that says: UnboundLocalError: local variable 'c' referenced before assignment in newer versions of Python, or UnboundLocalError: 'c' not assigned in some older version...
The behavior you're encountering is due to how Python handles variable scopes, particularly in relation to local and global variables. When you define a function in Python, the scope of that function includes its local variables, which are created when you assign to any variable within the function. If you attempt to ...
49,687
[ { "from": "human", "value": "When I try this code:\na, b, c = (1, 2, 3)\n\ndef test():\n print(a)\n print(b)\n print(c)\n c += 1\ntest()\n\nI get an error from the print(c) line that says:\nUnboundLocalError: local variable 'c' referenced before assignment\n\nin newer versions of Python, or\nUnb...
I am running Ubuntu8.041. Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch configured Can't get file uploading to work at all. Have tested locally on the Ubuntu box... and from my Vista Box. Ubuntu is running inside VMWare on the Vista box. Here is uploadTestBrowse.php <?php ?> <form enctype="multipart/...
It looks like there are a few issues with your file upload implementation. Let's go through them one by one. 1. **Form Input Name Mismatch**: In your `uploadTestBrowse.php`, you have the file input field named `fileName`: ```php <input type="file" name="fileName" /> ``` However, in `uploadTestSubmit.php...
49,389
[ { "from": "human", "value": "I am running Ubuntu8.041. Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch configured \nCan't get file uploading to work at all. Have tested locally on the Ubuntu box... and from my Vista Box. Ubuntu is running inside VMWare on the Vista box.\nHere is uploadTestBr...
I've been using Rainlendar for some time and I noticed that it has an option to put the window "on desktop". It's like a bottomMost window (as against topmost). How could I do this on a WPF app? Thanks
In a WPF application, if you want to create a window that behaves like a "bottomMost" window (i.e., it stays below other windows but is still visible on the desktop), you can achieve this by setting the window's owner to the desktop. WPF does not directly provide an option to create a "bottomMost" window like it does f...
45,285
[ { "from": "human", "value": "I've been using Rainlendar for some time and I noticed that it has an option to put the window \"on desktop\". It's like a bottomMost window (as against topmost).\nHow could I do this on a WPF app?\nThanks\n" }, { "from": "gpt", "value": "In a WPF application, if you...
Here is the idea: When the user wants to see /controller/action, then I want the page to have a "robots" meta tag with its value set to "all". When the user wants to see /controller/action?sort=hot&page=2 (i.e. it has a query string), then I want the page to have a "robots" meta tag with its value set to "noindex". Of ...
In an MVC architecture, you can implement this logic in a few different ways, but a common approach is to use a **controller action** and a **view model** or **view bag** to determine the content of the meta tags based on the incoming request. Here’s a step-by-step guide on how to do this: ### Step 1: Define a Logic ...
46,209
[ { "from": "human", "value": "Here is the idea:\nWhen the user wants to see /controller/action, then I want the page to have a \"robots\" meta tag with its value set to \"all\".\nWhen the user wants to see /controller/action?sort=hot&page=2 (i.e. it has a query string), then I want the page to have a \"robot...
I'm looking into a restful design and would like to use the HTTP methods (POST, GET, ...) and HTTP headers as much as possible. I already found out that the HTTP methods PUT and DELETE are not supported from the browser. Now I'm looking to get different representations of the same resource and would like to do this by ...
You're correct that standard HTTP methods like PUT and DELETE are not typically supported by standard HTML elements like `<form>` or `<a>` when used in a browser context. However, you can still work with different representations of a resource using the Accept header, but it does require a bit of JavaScript since HTML ...
47,371
[ { "from": "human", "value": "I'm looking into a restful design and would like to use the HTTP methods (POST, GET, ...) and HTTP headers as much as possible. I already found out that the HTTP methods PUT and DELETE are not supported from the browser.\nNow I'm looking to get different representations of the s...
I was wondering if something exists (in Java world) able to take an snapshot of the JVM current state with the following features: Do it while an exception is being thrown. Capture local variables, method's arguments, etc. Put it in a handy file which can be used to extract or reproduce in a IDE the situation in your ...
You're exploring a fascinating and complex area of Java development! While there may not be a widely adopted or production-ready tool that fully meets your specified requirements, here are some options and concepts you might consider: ### 1. **Java Agents and JVMTI** Java Agents, which can use the Java Virtual Machine...
46,021
[ { "from": "human", "value": "I was wondering if something exists (in Java world) able to take an snapshot of the JVM current state with the following features:\n\nDo it while an exception is being thrown.\nCapture local variables, method's arguments, etc.\nPut it in a handy file which can be used to extract...
Considering there are so many draconian firewalls in the world, is there any reason I shouldn't run server software on port 80 to guarantee greatest possible accessibility? It seems that the most common firewall exception is to allow outbound connections on port 80. I understand that any sort of packet inspection would...
Running server software on port 80 is indeed a common practice to maximize accessibility, especially in environments with stringent firewall configurations. Here’s a deeper look into your questions and considerations: ### Advantages of Using Port 80 1. **Widespread Accessibility**: As you mentioned, outbound connecti...
47,940
[ { "from": "human", "value": "Considering there are so many draconian firewalls in the world, is there any reason I shouldn't run server software on port 80 to guarantee greatest possible accessibility? It seems that the most common firewall exception is to allow outbound connections on port 80. I understand...
This sure seems like a simple error to fix. However, I somehow can't figure it out. Found some posts here and went thru them and couldn't get it to work. Sure seems like a famous error. The error I'm getting is : Unable to start debugging on the web server. An Authentication error occured while communicating with the w...
It sounds like you're encountering a common issue when trying to debug a web application in Visual Studio 2008. Here are several steps and considerations that may help you troubleshoot the "Unable to start debugging on the web server. An Authentication error occurred while communicating with the web server" error: 1. ...
48,772
[ { "from": "human", "value": "This sure seems like a simple error to fix. However, I somehow can't figure it out. Found some posts here and went thru them and couldn't get it to work. Sure seems like a famous error.\nThe error I'm getting is : Unable to start debugging on the web server. An Authentication er...
hI, I'm trying to get this code from Larry Nyhoff's book to compile in Bloodshed. It's actually been taken word for word from the author's website, though I declared it on .cpp instead of .h (the .h file ain't working with the tester application). http://cs.calvin.edu/activities/books/c++/ds/2e/SourcePrograms/Chap12/ ...
The error you're encountering in your C++ code appears to be related to the way you're declaring and using the `BinNodePointer` type. When you're defining the `search` function, the compiler doesn't recognize the `BinNodePointer` type because it needs to be fully qualified within the context of the template class. To...
45,342
[ { "from": "human", "value": "hI, I'm trying to get this code from Larry Nyhoff's book to compile in Bloodshed. It's actually been taken word for word from the author's website, though I declared it on .cpp instead of .h (the .h file ain't working with the tester application).\nhttp://cs.calvin.edu/activitie...
How can I do a script to catch strings as input and open them on a Firefox document? Each link would go to a different window or tab. Any ideas would be much appreciated. I just want to be able to take some links and open them. For example I have 50 Links. And copying and parsing those 50 Links take a really long time ...
Certainly! You can achieve this by writing a simple script in Python. You can use Python to read the links from a text file or directly from input, and then use a library called `webbrowser` to open them in Firefox. Here's a step-by-step guide to get you started: ### Step 1: Install Python Make sure you have Python in...
44,912
[ { "from": "human", "value": "How can I do a script to catch strings as input and open them on a Firefox document? Each link would go to a different window or tab. Any ideas would be much appreciated.\nI just want to be able to take some links and open them. For example I have 50 Links. And copying and parsi...
Winforms c# application running on terminal server. All images for buttons and menu items are stored as resources in the .resx file. After some heavy use, opening and closing windows while using the system, an "index out of range" exception is thrown and the window no longer opens. If the user attempts to navigate t...
The issue you're experiencing in your WinForms application, particularly the "Parameter is not valid" exception, when trying to load images stored in the `.resx` file can often be attributed to a few potential causes. Here are several suggestions that may help you identify and resolve the problem: ### Possible Causes ...
42,694
[ { "from": "human", "value": "Winforms c# application running on terminal server. All images for buttons and menu items are stored as resources in the .resx file. After some heavy use, opening and closing windows while using the system, an \"index out of range\" exception is thrown and the window no longer...
I am writing the results of certain checks on access table to a excel file. Sometimes the results exceed 65k that is more than excel can handle( excel 2002). How do i check the end of the file and open a new sheet for the continuation Thanks
If you're working with Excel 2002, the maximum number of rows is indeed 65,536. To handle results that exceed this limit, you can automate the process of checking how many rows are currently filled in the worksheet, and if it exceeds this limit, you can create a new worksheet and continue writing there. Below is a sa...
47,129
[ { "from": "human", "value": "I am writing the results of certain checks on access table to a excel file. Sometimes the results exceed 65k that is more than excel can handle( excel 2002). How do i check the end of the file and open a new sheet for the continuation\nThanks\n" }, { "from": "gpt", "...
I have an ASP.NET site that I'm developing. The layout is pretty basic. The master page has a header with a horizontal menu beneath the banner taking the entire width. On the left is a Navigation pane, 150 pixels wide with a picture and a few external links. The remainder of the width is the ContentPlaceholder. Be...
To achieve the desired layout where the deadlines and chart hold their ground on the right side, you can use CSS Flexbox or CSS Grid instead of relying solely on floats. Here's how to do it using CSS Flexbox, which will simplify your layout management and provide the desired behavior. ### Step 1: Update the HTML Struc...
49,537
[ { "from": "human", "value": "I have an ASP.NET site that I'm developing. The layout is pretty basic. The master page has a header with a horizontal menu beneath the banner taking the entire width. On the left is a Navigation pane, 150 pixels wide with a picture and a few external links. The remainder of...
I have a need to maintain the session state in the database. However I cannot access the database directly from the web server. The web server communicates with an app server which in turn has access to the database. Is there a way to configure this? Or does a custom component have to be written. The reason for this...
Yes, you can certainly configure a solution for maintaining session state in the database, even with the architecture you've described. However, it may require a combination of existing configurations and potentially writing some custom components or code. Below are some approaches to achieve this: ### Approaches to M...
48,398
[ { "from": "human", "value": "I have a need to maintain the session state in the database. However I cannot access the database directly from the web server. The web server communicates with an app server which in turn has access to the database. \n\nIs there a way to configure this? Or does a custom compone...
So I have an SQL dump file that needs to be loaded using mysql_query(). Unfortunately, it's not possible to execute multiple queries with it. -> It cannot be assumed that the mysql command-line client (mysql --help) is installed -- for loading the SQL file directly -> It cannot be assumed that the mysqli extension is i...
To process the SQL dump file without modifying its contents, we can read the file line-by-line instead of using `explode()` with a semicolon delimiter. This way, we can respect the context of each SQL command and ensure that semicolons used within values are not treated as delimiters for separate SQL statements. Here'...
49,668
[ { "from": "human", "value": "So I have an SQL dump file that needs to be loaded using mysql_query(). Unfortunately, it's not possible to execute multiple queries with it.\n-> It cannot be assumed that the mysql command-line client (mysql --help) is installed -- for loading the SQL file directly\n-> It canno...
Currently I have to uninstall the old version of my service before I install the new version. I am pretty sure this has something to do with it not being smart enough to update or remove the old service entries before adding the new ones. Is there a way to have the installer skip registering the service if it already e...
To manage service installation with MSI packages in Visual Studio, you can make a few adjustments to streamline the update process and ensure the service is handled correctly during install and uninstall operations. ### Skip Registering the Service if It Already Exists 1. **Custom Actions**: You can create a custom a...
48,669
[ { "from": "human", "value": "Currently I have to uninstall the old version of my service before I install the new version. I am pretty sure this has something to do with it not being smart enough to update or remove the old service entries before adding the new ones.\nIs there a way to have the installer sk...
I currently have an INSERT TRIGGER which in Oracle 10g runs a custom defined function that generates a funky alpha-numeric code that is used as part of the insert. I really need to make sure that the function (or even trigger) is thread safe so that if two users activate the trigger at once, the function used within th...
To ensure that your custom code generation function within the insert trigger is thread-safe, you are on the right track by considering locking mechanisms. However, locking the entire table in exclusive mode may lead to performance bottlenecks, especially in high-concurrency environments. Here are some alternative st...
48,732
[ { "from": "human", "value": "I currently have an INSERT TRIGGER which in Oracle 10g runs a custom defined function that generates a funky alpha-numeric code that is used as part of the insert.\nI really need to make sure that the function (or even trigger) is thread safe so that if two users activate the tr...
Normally I create web application projects and use code-behind, but I have a requirement to create an small throwaway demo app using code-inline. I added a global.asax file to the app, but for some odd reason, Visual Studio 2008 SP1 won't let me edit any of the code between the script tags i.e. add code to the event ha...
It sounds like you're encountering a common issue with editing the code within the `<script runat="server">` tags in the Global.asax file in Visual Studio 2008. Here are some potential solutions and workarounds to address the issue: 1. **File Type Recognition**: Make sure that your Global.asax file is recognized as...
49,521
[ { "from": "human", "value": "Normally I create web application projects and use code-behind, but I have a requirement to create an small throwaway demo app using code-inline.\nI added a global.asax file to the app, but for some odd reason, Visual Studio 2008 SP1 won't let me edit any of the code between the...
I was shocked to find out today that C# does not support dynamic sized arrays. How then does a VB.NET developer used to using ReDim Preserve deal with this in C#? At the beginning of the function I am not sure of the upper bound of the array. This depends on the rows returned from the database.
In C#, while it does not have a direct equivalent of VB.NET's `ReDim Preserve`, it does offer several alternative ways to handle dynamic sizing of arrays. You can use `List<T>` from the System.Collections.Generic namespace, which is a dynamic array that automatically resizes itself as elements are added or removed. Thi...
48,715
[ { "from": "human", "value": "I was shocked to find out today that C# does not support dynamic sized arrays. How then does a VB.NET developer used to using ReDim Preserve deal with this in C#?\nAt the beginning of the function I am not sure of the upper bound of the array. This depends on the rows returned f...
I have a block of code that basically intializes several classes, but they are placed in a sequential order, as later ones reference early ones. For some reason the last one initializes before the first one...it seems to me there is some sort of threading going on. What I need to know is how can I stop it from doing th...
In Python, class initialization is generally sequential, so you shouldn't encounter threading issues unless you are explicitly using multithreading or multiprocessing. If the initialization of your classes appears to be happening out of order, there are a few potential issues to consider. Let's explore some ways you ca...
48,648
[ { "from": "human", "value": "I have a block of code that basically intializes several classes, but they are placed in a sequential order, as later ones reference early ones.\nFor some reason the last one initializes before the first one...it seems to me there is some sort of threading going on. What I need ...
We want to build a library of c# snips for .NET. We are looking around to see if there is something similar out there. The library will be open source and free to use and distribute. I see there is a similar question here, but is more theoretical than practical, I want to have Good Source of .NET Dsg Patterns. Any...
Creating a library of C# code snippets focused on .NET is a great initiative, especially if it's open source and free to use! There are several resources and platforms where you can find design patterns, code snippets, and best practices for .NET development. Below are some suggestions on where to look and how to struc...
47,944
[ { "from": "human", "value": "We want to build a library of c# snips for .NET. We are looking around to see if there is something similar out there. The library will be open source and free to use and distribute. \nI see there is a similar question here, but is more theoretical than practical, I want to h...
What happens in the memory when a class instantiates the following object? public class SomeObject{ private String strSomeProperty; public SomeObject(String strSomeProperty){ this.strSomeProperty = strSomeProperty; } public void setSomeProperty(String strSomeProperty){ this.strSomePro...
When you instantiate a class in Java, like `SomeObject` in your example, the Java Virtual Machine (JVM) allocates memory for the object and its properties in several steps. Here’s a breakdown of what happens in memory when `SomeObject` is instantiated: ### Memory Allocation Process 1. **Class Definition and Metadata*...
49,373
[ { "from": "human", "value": "What happens in the memory when a class instantiates the following object? \npublic class SomeObject{\n\n private String strSomeProperty;\n\n public SomeObject(String strSomeProperty){\n this.strSomeProperty = strSomeProperty;\n }\n public void setSomeProperty...
As a "look under the covers" tutorial for myself I am building a PHP script to gather emails from a POP3 mailbox. While attempting to make use of binary attachments I am stuck trying to figure out what to do with the attachment information. Given a string that would be gathered from an email: ------=_Part_16735_17392...
To save binary attachments from an email in PHP, you'll need to follow these steps: 1. **Parse the email to extract the attachment information** (including the base64-encoded data). 2. **Decode the base64-encoded data**. 3. **Save the decoded data to a file on disk**. Here is a simplified example that shows you how t...
47,384
[ { "from": "human", "value": "As a \"look under the covers\" tutorial for myself I am building a PHP script to gather emails from a POP3 mailbox. While attempting to make use of binary attachments I am stuck trying to figure out what to do with the attachment information.\nGiven a string that would be gathe...
My query is: var query1 = from u in dc.Usage_Computers.AsEnumerable where u.DomainUser == s3 orderby u.OperationTime descending select new { u.ProgramVersion, u.OperationTime, u.IPaddress, u.ComputerN...
To convert the result set from your LINQ query (`query1`) into a `DataTable` or `DataSet`, you can follow these steps. Since you are using LINQ to Objects with `AsEnumerable`, you will need to create a `DataTable` manually and then populate it with the results of your query. Here's how you can do it: ### Creating a D...
48,459
[ { "from": "human", "value": "My query is:\nvar query1 = from u in dc.Usage_Computers.AsEnumerable\n where u.DomainUser == s3\n orderby u.OperationTime descending\n select new\n {\n u.ProgramVersion,\n u.OperationTime,\n ...
We have a large (about 580,000 loc) application which in Delphi 2006 builds (on my machine) in around 20 seconds. When you have build times in seconds, you tend to use the compiler as a tool. i.e. write a little code, build, write some more code and build some more etc etc As we move some of our stuff over to C#, does ...
When transitioning from Delphi to C#, you may notice some differences in build times, especially with a large application like the one you mentioned (580,000 lines of code). Here are some considerations and comparisons regarding build times and development style between Delphi and C#: ### Build Times 1. **Compilation ...
48,733
[ { "from": "human", "value": "We have a large (about 580,000 loc) application which in Delphi 2006 builds (on my machine) in around 20 seconds. When you have build times in seconds, you tend to use the compiler as a tool. i.e. write a little code, build, write some more code and build some more etc etc As we...
I've got this textBox which triggers off an ajax request using jQuery: <asp:TextBox ID="postcodeTextBox" runat="server" Text='<%# Bind("POSTAL_ZIP_CODE") %>'> $(document).ready(PageLoad); function PageLoad() { $(container + 'parentProjectTextBox').change(GetProjectName); } function GetProjectName() { var pro...
The issue you're encountering is common in ASP.NET Web Forms applications when working with dynamically populated controls via AJAX. ASP.NET relies on the view state to keep track of the values of controls, but if a control is populated or modified on the client side (as in your case with jQuery), the framework may los...
48,041
[ { "from": "human", "value": "I've got this textBox which triggers off an ajax request using jQuery:\n<asp:TextBox ID=\"postcodeTextBox\" runat=\"server\" Text='<%# Bind(\"POSTAL_ZIP_CODE\") %>'>\n\n$(document).ready(PageLoad);\n\nfunction PageLoad() {\n $(container + 'parentProjectTextBox').change(GetPro...
My MS Visual C# program was compiling and running just fine. I close MS Visual C# to go off and do other things in life. I reopen it and (before doing anything else) go to "Publish" my program and get the following error message: Program C:\myprogram.exe does not contain a static 'Main' method suitable for an entry po...
It sounds like you're encountering an issue that can sometimes arise due to configuration changes or project settings in Visual Studio. Given that your code appears correct, let's go through a series of troubleshooting steps to resolve the issue regarding the missing entry point. ### Steps to Troubleshoot 1. **Check ...
48,910
[ { "from": "human", "value": "My MS Visual C# program was compiling and running just fine.\nI close MS Visual C# to go off and do other things in life.\nI reopen it and (before doing anything else) go to \"Publish\" my program and get the following error message:\n\nProgram C:\\myprogram.exe does not contain...
I am running a windows machine have installed Python 2.5. I also used the windows installer to install NumPy. This all works great when I run the Python (command line) tool that comes with Python. However, if I run cygwin and then run Python from within, it cannot find the numpy package. What environment variable do ...
When using Cygwin, it has its own environment that may not recognize the packages installed with the Windows version of Python, including NumPy. To get NumPy working within Cygwin, you'll need to ensure that the Python interpreter in Cygwin is the one that can access NumPy. Here are a few steps you can follow to resol...
48,465
[ { "from": "human", "value": "I am running a windows machine have installed Python 2.5. I also used the windows installer to install NumPy. \nThis all works great when I run the Python (command line) tool that comes with Python.\nHowever, if I run cygwin and then run Python from within, it cannot find the n...
For very small teams, or an individual developer, is there a source code control tool which is a web service, or web based application, with no or very little cost? Ideally, it would work with Microsoft development. IDE Integration would be awesome, but a windows application that connects to the web service would also ...
Yes, there are several source code control tools that are web-based, affordable (or even free), and can be used effectively by small teams or individual developers, especially those working within the Microsoft ecosystem. Here are a few options to consider: ### 1. **GitHub** - **Cost**: Free for public repositories an...
49,910
[ { "from": "human", "value": "For very small teams, or an individual developer, is there a source code control tool which is a web service, or web based application, with no or very little cost?\nIdeally, it would work with Microsoft development. IDE Integration would be awesome, but a windows application th...
<?php $string = 'The quick brown fox jumped over the lazy dog.'; $patterns[0] = '/quick/'; $patterns[1] = '/brown/'; $patterns[2] = '/fox/'; $replacements[0] = 'slow'; $replacements[1] = 'black'; $replacements[2] = 'bear'; echo preg_replace($patterns, $replacements, $string); ?> Ok guys, Now I have the above code. It ...
Yes, you can certainly simplify your pattern declarations in PHP's `preg_replace` by combining multiple patterns into a single regular expression. Instead of declaring separate entries for each word you want to replace, you can use the pipe `|` operator to specify alternatives. Here's how you can modify your code to a...
49,859
[ { "from": "human", "value": "<?php\n$string = 'The quick brown fox jumped over the lazy dog.';\n$patterns[0] = '/quick/';\n$patterns[1] = '/brown/';\n$patterns[2] = '/fox/';\n$replacements[0] = 'slow';\n$replacements[1] = 'black';\n$replacements[2] = 'bear';\necho preg_replace($patterns, $replacements, $str...