instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I am adding a custom background for my UINavigationBar. It works fine as long as the phone is in portrait mode. As soon as I switch to landscape mode, half the bar appears blue (the default navbar color) and half of it has my image How can I stretch the image for landscape mode and make it small again for portrait mode...
To handle the issue of having a custom background for your `UINavigationBar` that adjusts based on the device orientation (portrait or landscape), you can use a combination of constraints and layout updates. Instead of directly adding an `UIImageView` to the navigation bar, you might consider subclassing the `UINaviga...
47,103
[ { "from": "human", "value": "I am adding a custom background for my UINavigationBar. It works fine as long as the phone is in portrait mode. As soon as I switch to landscape mode, half the bar appears blue (the default navbar color) and half of it has my image\nHow can I stretch the image for landscape mode...
I have a repeater control with a check box, if I check the box then my delete functionality will delete an item in the underlying table. When I test the delete functionality on an aspx page with a code behind page, everything works fine. Hooray! However, when I take the repeater and put it into a User Control, the dele...
It seems you're experiencing an issue where your repeater control is not retaining its items in a user control when you attempt to delete items using checkboxes. This is a common issue with ASP.NET Web Forms where controls do not maintain their state after postback unless certain conditions are met. Here are some sugge...
47,191
[ { "from": "human", "value": "I have a repeater control with a check box, if I check the box then my delete functionality will delete an item in the underlying table.\nWhen I test the delete functionality on an aspx page with a code behind page, everything works fine. Hooray!\nHowever, when I take the repeat...
Generally, I like to keep an application completely ignorant of the IoC container. However I have ran into problems where I needed to access it. To abstract away the pain I use a basic Singleton. Before you run for the hills or pull out the shotgun, let me go over my solution. Basically, the IoC singleton does abso...
Your approach to managing the IoC container via a static singleton wrapper is certainly pragmatic, especially if you want to maintain a level of abstraction over the specifics of your dependency injection (DI) implementation. The use of an interface (`IDependencyResolver`) for delegation is a positive aspect of your de...
46,611
[ { "from": "human", "value": "Generally, I like to keep an application completely ignorant of the IoC container. However I have ran into problems where I needed to access it. To abstract away the pain I use a basic Singleton. Before you run for the hills or pull out the shotgun, let me go over my solution...
I'm looking for a VM management solution that will allow me to easily maintain VMs in a single repository accessible on the corporate intranet. I'm currently looking into VMware's vCenter, HP's Manager, Microsoft's VM Manager. vCenter seems to require an ESX server, which I'm not very happy about. I haven't looked in...
If you're looking for a simpler VM management solution without the overhead of a full ESX server or similar, there are several options you might consider: 1. **Proxmox VE**: Proxmox Virtual Environment is an open-source platform that combines two virtualization technologies: KVM (for virtual machines) and LXC (for con...
47,868
[ { "from": "human", "value": "I'm looking for a VM management solution that will allow me to easily maintain VMs in a single repository accessible on the corporate intranet.\nI'm currently looking into VMware's vCenter, HP's Manager, Microsoft's VM Manager. vCenter seems to require an ESX server, which I'm ...
It seems very easy to deploy new reports to a reporting server directly from visual studio, however when these are to be pushed into our web farm (where developers have no access), this either needs to be done manually, report by report, through microsoft's web front end, or into an MSI. However, from time to time we m...
Hi Chris, Managing report deployment and configuration in a Reporting Services environment can be quite challenging, especially in a web farm setup where direct access is restricted. Fortunately, there are several tools and methods that can help you manage multiple reports and update their configurations more efficien...
49,948
[ { "from": "human", "value": "It seems very easy to deploy new reports to a reporting server directly from visual studio, however when these are to be pushed into our web farm (where developers have no access), this either needs to be done manually, report by report, through microsoft's web front end, or int...
I just don't get it. I use cocos2d for development of a small game on the iPhone/Pod. The framework is just great, but I fail at touch detection. I read that you just need to overwrite the proper functions (e.g. "touchesBegan" ) in the implementation of a class which subclasses CocosNode. But it doesn't work. What coul...
It sounds like you're on the right track by overriding the `touchesBegan:withEvent:` method in your subclass. However, there are a few key points you should check to ensure that touch detection works correctly in Cocos2d. Here are some troubleshooting steps and tips to help you resolve the issue: 1. **Make Sure Your N...
49,093
[ { "from": "human", "value": "I just don't get it.\nI use cocos2d for development of a small game on the iPhone/Pod. The framework is just great, but I fail at touch detection. I read that you just need to overwrite the proper functions (e.g. \"touchesBegan\" ) in the implementation of a class which subclass...
I need to parse some known file formats, one of them is the CUSCAR format, i strongly believe that RegEx will do the job ,any suggestions ?
Parsing file formats using regular expressions can be effective, but it depends on the structure and complexity of the format you're dealing with. CUSCAR, which stands for “Commonly Used Standard for Computer Aided Research”, is a specific format, and details about its structure would be necessary to provide specific r...
46,456
[ { "from": "human", "value": "I need to parse some known file formats, one of them is the CUSCAR format, i strongly believe that RegEx will do the job ,any suggestions ? \n" }, { "from": "gpt", "value": "Parsing file formats using regular expressions can be effective, but it depends on the struct...
I've had a lot of users complain that the little "i" info button is difficult to touch on the iPhone. Ok, simple enough -- I just stuck a big-fat invisible button behind it that you can't miss even with the sloppiest of finger touches and, when you touch it, it does the infoButtonAction. Thing is, I'd like to flash th...
To achieve the flashing effect for the "i" button on the iPhone, you'll want to use a combination of animations. The approach you're currently using by simply setting the highlighted state isn't sufficient for creating the visual feedback you’re looking for. Instead, you should use `UIView` animations to make the butto...
46,317
[ { "from": "human", "value": "I've had a lot of users complain that the little \"i\" info button is difficult to touch on the iPhone. Ok, simple enough -- I just stuck a big-fat invisible button behind it that you can't miss even with the sloppiest of finger touches and, when you touch it, it does the infoB...
In my Dev C++, I am trying to create a 2D Array class that acts like a Grid. But one of the problem is I am unsure what do for the constructor. When I try to compile, I get the following errors: In constructor 'Grid::Grid(int,int)': 'sqaures' is not a type 'yPos' cannot appear in a constant-expression [Build Error] [gr...
To create a 2D array in a class like your `Grid`, you need to modify the way you're defining the member variable. The main issues in your implementation are: 1. The `squares` variable is declared as `int squares;`, which is just a single integer and not a 2D array. 2. You cannot use `new` like that. You should define ...
49,098
[ { "from": "human", "value": "In my Dev C++, I am trying to create a 2D Array class that acts like a Grid.\nBut one of the problem is I am unsure what do for the constructor.\nWhen I try to compile, I get the following errors:\nIn constructor 'Grid::Grid(int,int)':\n'sqaures' is not a type\n'yPos' cannot app...
I've written a script to backup my server's HD every night. At the end of the script, I sync, wait a couple of minutes, sync and then I issue sg_start --stop to stop the device. The idea is to extend the lifetime of the device by switching the HD off after ten minutes of incremental backup (desktop disks will survive s...
To monitor the power state of your USB drive and determine whether it is spinning up or not, you can use several methods. Since `hdparm` and `sg_inq` are giving you issues, consider these options: ### 1. Check Drive Status with `udevadm` You can use `udevadm` to get information about the USB device. Run the following...
49,500
[ { "from": "human", "value": "I've written a script to backup my server's HD every night. At the end of the script, I sync, wait a couple of minutes, sync and then I issue sg_start --stop to stop the device. The idea is to extend the lifetime of the device by switching the HD off after ten minutes of increme...
I have a table in a SQL 2005 database that contains a column defined as a xml datatype. I'm trying to write stored proc that queries the xml and returns a resultset from a select statement. I've seen examples of returning scalar values or xml but not how to return a resultset. Am I going to have to use openxml or is ...
In SQL Server 2005, you can query XML data types directly using the built-in XML methods such as `nodes()` and `value()` instead of using `OPENXML`. Using these methods can be more efficient and easier to read. Here’s how you can create a stored procedure that returns a result set from an XML column. Assuming you have...
46,830
[ { "from": "human", "value": "I have a table in a SQL 2005 database that contains a column defined as a xml datatype. I'm trying to write stored proc that queries the xml and returns a resultset from a select statement. I've seen examples of returning scalar values or xml but not how to return a resultset....
I've been working on some data transformation tasks in SSIS. Visual Studio has gotten better in 2008 in it's usability, but I find there are some things that annoy me (i.e. When I delete something in the Package Explorer it refreshs the whole screen bringing me back to the top of the tree. Also, lack of some keyboard s...
Yes, working with SSIS (SQL Server Integration Services) can sometimes be frustrating, especially with the quirks of Visual Studio, as you mentioned. While there are limitations to the built-in SSIS designer in Visual Studio 2008, there are some alternatives and plugins that you might find helpful. ### Alternative SSI...
48,798
[ { "from": "human", "value": "I've been working on some data transformation tasks in SSIS. Visual Studio has gotten better in 2008 in it's usability, but I find there are some things that annoy me (i.e. When I delete something in the Package Explorer it refreshs the whole screen bringing me back to the top o...
A class has a property (and instance var) of type NSMutableArray with synthesized accessors (via @property). If you observe this array using: [myObj addObserver:self forKeyPath:@"theArray" options:0 context:NULL]; And then insert an object in the array like this: [myObj.theArray addObject:NSString.string]; An observe...
In Objective-C, synthesized accessors for properties (like `NSMutableArray` in your case) do not automatically return a proxy that handles Key-Value Observing (KVO) when you're directly mutating the contents of the mutable array. This means that if you directly manipulate the array (e.g., adding an object) using the ac...
49,745
[ { "from": "human", "value": "A class has a property (and instance var) of type NSMutableArray with synthesized accessors (via @property). If you observe this array using:\n[myObj addObserver:self forKeyPath:@\"theArray\" options:0 context:NULL];\n\nAnd then insert an object in the array like this:\n[myObj.t...
In vs team system 2008 unit test, how can i load an application configuration file in the test itself? i have an app.config in the test project, referenced System.Configuration but when running the test, it doesn't see the app.config
When working with unit tests in Visual Studio Team System 2008, the unit test framework does not automatically use the `app.config` file from your test project as it would in a standard application. However, you can still load your configuration settings during the test execution by following a few steps. Here's how yo...
47,459
[ { "from": "human", "value": "In vs team system 2008 unit test, how can i load an application configuration file in the test itself?\ni have an app.config in the test project, referenced System.Configuration but when running the test, it doesn't see the app.config\n" }, { "from": "gpt", "value": ...
I'm using Flex Builder 3 now and it suddenly refuses to start debugging session. I've reinstalled debugger versions of Flash Player: both 9 and 10 versions. Then I've reinstalled Flex Builder itself allowing it to install it's native Flash Player version. And finally, I've tried to use both IE and Firefox as host for p...
Debugging issues with Flex Builder 3 can be frustrating, especially if you've already tried several common solutions. Here are some additional steps you can take to troubleshoot the debugging issue: 1. **Check Configuration Settings**: Ensure that your project is correctly configured for debugging. Right-click your pr...
49,694
[ { "from": "human", "value": "I'm using Flex Builder 3 now and it suddenly refuses to start debugging session. I've reinstalled debugger versions of Flash Player: both 9 and 10 versions. Then I've reinstalled Flex Builder itself allowing it to install it's native Flash Player version. And finally, I've tried...
I recently took my Db initiating code out of the __construct of my Page class and placed it just after I initiate the Page class. I removed it from within the Page class because I want to be able to access it from anywhere (other classes for example). It also takes server, username, password and database arguments to i...
It sounds like you're looking for a way to maintain a single database connection that can be easily accessed from various classes in your application, including your `Page` class. In object-oriented programming, a common design pattern for this purpose is the Singleton pattern. This pattern ensures that a class has onl...
48,140
[ { "from": "human", "value": "I recently took my Db initiating code out of the __construct of my Page class and placed it just after I initiate the Page class. I removed it from within the Page class because I want to be able to access it from anywhere (other classes for example). It also takes server, usern...
I have created a mutli-column combobox in VB.net 2008 using windows forms 2.0. I am having trouble accessing data once selected to use in the remainder of the form. There does not seem to be a selected event to use in conjunction with the winform 2.0 combobox. Does anyone have any experience using winforms 2.0? Also I ...
Working with multi-column ComboBoxes in Windows Forms can be a bit tricky, especially in older versions like .NET 2.0. By default, the ComboBox control does not have an event specifically called `SelectedIndexChanged` that you might expect from other controls, but it does have a few alternatives that you can use. ### ...
47,714
[ { "from": "human", "value": "I have created a mutli-column combobox in VB.net 2008 using windows forms 2.0. I am having trouble accessing data once selected to use in the remainder of the form. There does not seem to be a selected event to use in conjunction with the winform 2.0 combobox.\nDoes anyone have ...
Do you have any experience with T4 and T4 Editor? Can you compare it to CodeSmith or MyGeneration? What code generators do you use? What do you recommend? I want to use it for generatig of SPs. Is there anything else you find code generation useful?
T4 (Text Template Transformation Toolkit) is a powerful code generation feature built into Visual Studio that allows developers to generate code and other text files based on templates. T4 templates use a combination of C# (or VB.NET) and text to produce output files, making it flexible and widely applicable for variou...
45,351
[ { "from": "human", "value": "Do you have any experience with T4 and T4 Editor? Can you compare it to CodeSmith or MyGeneration?\nWhat code generators do you use? What do you recommend?\nI want to use it for generatig of SPs. Is there anything else you find code generation useful?\n" }, { "from": "gp...
Is it possible to set the DataContext property of a usercontrol after the user control has been loaded, and force the usercontrol to rebind?
Yes, it is possible to set the `DataContext` property of a UserControl after it has been loaded and force it to rebind. In WPF, when you change the `DataContext` of a UserControl, it should automatically propagate the change to all the bindings within that UserControl. However, there are some nuances to be aware of. #...
48,092
[ { "from": "human", "value": "Is it possible to set the DataContext property of a usercontrol after the user control has been loaded, and force the usercontrol to rebind?\n" }, { "from": "gpt", "value": "Yes, it is possible to set the `DataContext` property of a UserControl after it has been load...
As I've increasingly absorbed Agile thinking into the way I work, yagni ("you aren't going to need it") seems to become more and more important. It seems to me to be one of the most effective rules for filtering out misguided priorities and deciding what not to work on next. Yet yagni seems to be a concept that is bare...
Your emphasis on YAGNI ("You Aren't Gonna Need It") as an essential principle in Agile development is certainly valid, and it resonates deeply with many developers and teams striving to deliver value efficiently. While it may not be a frequently discussed concept on certain forums, its relevance in practical software d...
48,116
[ { "from": "human", "value": "As I've increasingly absorbed Agile thinking into the way I work, yagni (\"you aren't going to need it\") seems to become more and more important. It seems to me to be one of the most effective rules for filtering out misguided priorities and deciding what not to work on next.\n...
Has anyone out there written their own IOC Container in C#? Or do the vast majority of folks use the various frameworks such as Spring. What are the pro's and con's of each?
Yes, many developers have indeed written their own Inversion of Control (IoC) Containers in C#. However, the vast majority of developers tend to use existing frameworks like Microsoft.Extensions.DependencyInjection, Autofac, Ninject, or others. Here’s a look at the pros and cons of both approaches: ### Writing Your Ow...
48,718
[ { "from": "human", "value": "Has anyone out there written their own IOC Container in C#? Or do the vast majority of folks use the various frameworks such as Spring. What are the pro's and con's of each?\n" }, { "from": "gpt", "value": "Yes, many developers have indeed written their own Inversion...
I am trying to generate a html page with css that works as an image preview kind of thing. An example of this is here: http://www.nomorepasting.com/getpaste.php?pasteid=22463 however this approach has several drawbacks. One of which is the text must always be smaller than the images. I tried using a different attempt h...
To create an image preview HTML page with CSS that allows text to be positioned freely and maintains the aesthetic appeal of the images, you can use a combination of HTML for the structure and CSS for styling. Below is a simple example based on your description that allows for the display of images with text overlays a...
46,709
[ { "from": "human", "value": "I am trying to generate a html page with css that works as an image preview kind of thing. An example of this is here:\nhttp://www.nomorepasting.com/getpaste.php?pasteid=22463\nhowever this approach has several drawbacks. One of which is the text must always be smaller than the ...
I have two models (users and courses) and a JOIN table that allows enrollments in the course: class User < ActiveRecord::Base has_many :enrollments, :dependent => :destroy has_many :courses, :through => :enrollments end class Course < ActiveRecord::Base has_many :enrollments, :dependent => :destroy has_many :u...
Yes, you can create an enrollment in the background without needing to change the default RESTful `EnrollmentsController#new` action. Instead, you can define a method in your `User` model to handle the enrollment logic. This method can be called when the user clicks the "enroll" link, and it will create the enrollment ...
47,509
[ { "from": "human", "value": "I have two models (users and courses) and a JOIN table that allows enrollments in the course:\nclass User < ActiveRecord::Base\n has_many :enrollments, :dependent => :destroy\n has_many :courses, :through => :enrollments\nend\n\nclass Course < ActiveRecord::Base\n has_many :...
Just wondering if there is any best practice for DAL to represent null value (from a nullable column). We currently have our own in-house DAL and are representing null value with int.MinValue. However, this rise concerns with developers thinking that when comparing values, we are purposely imposing another "added" val...
Handling null values in a Data Access Layer (DAL) can indeed be challenging, and using unconventional representations (like `int.MinValue`) can lead to confusion and potential bugs. Here are some best practices and common approaches used by well-known Object-Relational Mappers (ORMs) to deal with null values: ### 1. *...
48,721
[ { "from": "human", "value": "Just wondering if there is any best practice for DAL to represent null value (from a nullable column).\nWe currently have our own in-house DAL and are representing null value with int.MinValue. However, this rise concerns with developers thinking that when comparing values, we ...
<?php function data_info($data) { if ($data) { while (!feof($data)) { $buffer = fgets($data); if (file_exists($buffer)) { $bufferArray[$buffer]['Exists'] = (file_exists($buffer)); $bufferArray[$buffer]['Readable'] = (is_readable($buffer)); $buffer...
The issue with your code stems from how you're checking for file existence and how you're handling the array storage. Specifically, you're not handling the line endings properly, and you're also missing a step to initialize your `$bufferArray` variable. Here's an updated version of your code that addresses these issues...
46,303
[ { "from": "human", "value": "<?php\n\nfunction data_info($data)\n{\n if ($data) {\n while (!feof($data)) {\n $buffer = fgets($data);\n if (file_exists($buffer)) {\n $bufferArray[$buffer]['Exists'] = (file_exists($buffer));\n $bufferArray[$buffer]['Readab...
I'm getting this error in a PHP (Drupal) application: (104)Connection reset by peer: FastCGI: comm with server "/opt/php-5.2.5/bin/php-cgi" aborted: read failed It is often followed by this error: FastCGI: incomplete headers (0 bytes) received from server "/opt/php-5.2.5/bin/php-cgi" The basic Apache configuration f...
The "Connection reset by peer" error and "incomplete headers" messages you are encountering with FastCGI in your PHP application can be caused by several issues. Here are some common causes and suggestions for debugging: 1. **Resource Limitations**: - **Memory Limit**: Check the memory limit setting in your `php.in...
46,408
[ { "from": "human", "value": "I'm getting this error in a PHP (Drupal) application:\n(104)Connection reset by peer: FastCGI: comm with server \"/opt/php-5.2.5/bin/php-cgi\" aborted: read failed\n\nIt is often followed by this error:\nFastCGI: incomplete headers (0 bytes) received from server \"/opt/php-5.2....
ANSWER: If you ever see these lines and are mistified like I was, here's what they mean. Thread[AWT-EventQueue-0] (Suspended (exception NullPointerException)) EventDispatchTread.run() line: not available [local variables unavailable] It's not that the variables are unavailable because they are lurking behind a shroud o...
The error you're encountering, `NullPointerException`, is a common issue in Java when you're trying to use an object that hasn't been initialized (i.e., it is `null`). In your case, it appears that the error occurs when you call the method `display.updateDiscard(rules.zoneList("Discard"));`. Let's break down what migh...
49,062
[ { "from": "human", "value": "ANSWER:\nIf you ever see these lines and are mistified like I was, here's what they mean.\nThread[AWT-EventQueue-0] (Suspended (exception NullPointerException))\nEventDispatchTread.run() line: not available [local variables unavailable]\nIt's not that the variables are unavailab...
I'm researching game development in Flash and Flex. I've downloaded the Flex Builder trial and have worked with older versions of Flash. I see that generally, Flex Builder is a developer's tool, and Flash is a designer's tool. It's not clear to me whether one is better suited to game development than the other, or i...
When it comes to game development in the context of Flash and Flex, both tools have their own strengths and weaknesses, and their suitability largely depends on the type of game you're developing and your own workflow preferences. ### Flash (Adobe Animate) **Strengths:** - **Art and Animation:** Flash is primarily de...
47,254
[ { "from": "human", "value": "I'm researching game development in Flash and Flex. I've downloaded the Flex Builder trial and have worked with older versions of Flash. I see that generally, Flex Builder is a developer's tool, and Flash is a designer's tool. It's not clear to me whether one is better suited...
Imagine the following solution: Website ABC.com (not Web Application) BLL (business logic layer in a seperate assembly) DTO (dto objects in their own assembly) DAL (data access layer in it's own assembly as well). The BLL has a reference to the DAL. The BLL has a reference to the DTO layer. The Website project refere...
Your question revolves around the way .NET handles assembly references and how ASP.NET Web Projects manage these references, particularly in the context of a multi-project solution involving a Business Logic Layer (BLL), Data Access Layer (DAL), and Data Transfer Objects (DTO). ### Understanding References 1. **Assem...
49,918
[ { "from": "human", "value": "Imagine the following solution:\n\nWebsite ABC.com (not Web Application)\nBLL (business logic layer in a seperate assembly)\nDTO (dto objects in their own assembly)\nDAL (data access layer in it's own assembly as well).\n\nThe BLL has a reference to the DAL.\nThe BLL has a refer...
I was asked to manage and develop a project. The client does not really care if I hire people who would do it or I do it myself. Thus, I've decided to be more manager than developer. Are there any (free / low cost) web projects that could help me to communicate with each "sub-developer" outta there on Internet? What I...
Certainly! Managing a project with a distributed team can be challenging, but there are several free or low-cost tools that can help facilitate communication, collaboration, and project management. Here’s a list of tools and strategies you might find helpful: ### Project Management Tools 1. **Trello**: - A visual t...
49,456
[ { "from": "human", "value": "I was asked to manage and develop a project. The client does not really care if I hire people who would do it or I do it myself. Thus, I've decided to be more manager than developer. \nAre there any (free / low cost) web projects that could help me to communicate with each \"sub...
Does anybody have an idea what SOA Governance is all about? What is the difference (or correlation) between SOA Governance and IT Governance? and How can it be applied using SOA platforms available in the market? Can a project built on SOA platform be successful without applying SOA Governance? How? I am talking here f...
**Service-Oriented Architecture (SOA) Governance** refers to the framework and processes that ensure the effective management of services within an SOA environment. It encompasses policies, standards, and practices that guide the design, implementation, management, and retirement of services to align with an organizati...
48,963
[ { "from": "human", "value": "Does anybody have an idea what SOA Governance is all about? What is the difference (or correlation) between SOA Governance and IT Governance? and How can it be applied using SOA platforms available in the market?\nCan a project built on SOA platform be successful without applyin...
I want to convert a string into a series of Keycodes, so that I can then send them via PostMessage to a control. I need to simulate actual keyboard input, and I'm wondering if a massive switch statement is the only way to convert a character into the correct keycode, or if there's a simpler method. ==== Got my solutio...
It looks like you've found a solution using `VkKeyScan`, which is a great approach for converting characters to virtual key codes. `VkKeyScan` can simplify the process significantly compared to a massive switch statement. Here's a brief overview of how you can use `VkKeyScan`: 1. **Include the necessary headers**: Ma...
48,694
[ { "from": "human", "value": "I want to convert a string into a series of Keycodes, so that I can then send them via PostMessage to a control. I need to simulate actual keyboard input, and I'm wondering if a massive switch statement is the only way to convert a character into the correct keycode, or if ther...
in a small c# project, I'm trying to create a simple custom configsection. I followed the instructions in CodeProject: Unraveling the Mysteries of .NET 2.0 Configuration and everything work nicely... apart from the fact that I don't get xsd validation and intellisense on the config. My config is shown below. <configura...
Creating a custom configuration section in C# that supports XSD validation and IntelliSense can be tricky, especially when dealing with collections. It looks like you're on the right track with the use of tools like XSDExtractor, but the problem with collections can be a common issue. Here are some suggestions and too...
43,134
[ { "from": "human", "value": "in a small c# project, I'm trying to create a simple custom configsection.\nI followed the instructions in CodeProject: Unraveling the Mysteries of .NET 2.0 Configuration and everything work nicely... apart from the fact that I don't get xsd validation and intellisense on the co...
I have seen the ASP.NET community buzzing about MVC. I know the basics of its origin, and that there are many sites (unless I am mistaken, stack overflow itself) based on ASP.NET MVC. From everything I have heard and read about MVC it seems to be the future of ASP.NET development. But since I don't usually dabble in ...
The Model-View-Controller (MVC) design pattern has indeed gained significant traction in the ASP.NET community, particularly with the advent of ASP.NET MVC and its subsequent evolution into ASP.NET Core MVC. Understanding when to use MVC and when it might not be the best fit can help developers make informed decisions ...
46,036
[ { "from": "human", "value": "I have seen the ASP.NET community buzzing about MVC. I know the basics of its origin, and that there are many sites (unless I am mistaken, stack overflow itself) based on ASP.NET MVC. \nFrom everything I have heard and read about MVC it seems to be the future of ASP.NET develop...
This seems to go against every design guideline. A static method that accepts a single argument of type T should usually just be a member method. It's so bizzare I actually had to post a StackOverflow question to understand IsUpper exists (as it didn't show up in auto-completion) Edit I understand my earlier statement ...
Your observation touches on a key principle in object-oriented design: the importance of context and the role of instance methods versus static methods. In your example, you're contrasting two different approaches: instance methods (like `String.ToLower()`) and static methods (like `char.IsLower()`). Both have their u...
49,705
[ { "from": "human", "value": "This seems to go against every design guideline.\nA static method that accepts a single argument of type T should usually just be a member method.\nIt's so bizzare I actually had to post a StackOverflow question to understand IsUpper exists (as it didn't show up in auto-completi...
Well i need to make it so any user can have a foo.com/username in my site where i user a Zend framework. The thing is that i want foo.com/login and other controllers to keep working as they do, so i already validate that no user can be named as one of the controllers im going to use. The htaccess cant be changed or t...
To achieve your goal of routing user profiles to `foo.com/username` without affecting existing controllers like `foo.com/login`, while keeping your routing clean and without listing all controllers explicitly, you can use a combination of a default route and a more specific catch-all route. This way, you can handle use...
47,965
[ { "from": "human", "value": "Well i need to make it so any user can have a foo.com/username in my site where i user a Zend framework. \nThe thing is that i want foo.com/login and other controllers to keep working as they do, so i already validate that no user can be named as one of the controllers im going ...
What tips and "standards" do you use in your Redmine project management process? Do you have a standard wiki insert template you could share or a standard way to work a project using bugs features tasks and support issues? Do you let issues and updates get emailed into Redmine? Do you use the forums? Do you use SVN re...
Transitioning to a web-based project management (PM) tool like Redmine can significantly improve organization, communication, and transparency within your team. Here are some tips, standards, and best practices for using Redmine effectively: ### General Tips for Using Redmine: 1. **Project Structure**: - **Define ...
44,158
[ { "from": "human", "value": "What tips and \"standards\" do you use in your Redmine project management process?\nDo you have a standard wiki insert template you could share or a standard way to work a project using bugs features tasks and support issues?\nDo you let issues and updates get emailed into Redmi...
Ok another WPF question, well I guess this is just general .NET. I have an xml document retreived from a URL. I want to get multiple values out of the document (weather data, location, some other strings). When I use the XmlTextReader I can call my method to pull the values out. The first time I pass the method to sear...
The issue you're facing is due to the fact that `XmlTextReader` is designed to be a forward-only reader. Once you read through it, you can't reset it or go back to a previous point unless you reinitialize it or recreate the reader. When you create an `XPathDocument` from the `XmlTextReader`, the `XmlTextReader` is cons...
46,262
[ { "from": "human", "value": "Ok another WPF question, well I guess this is just general .NET. I have an xml document retreived from a URL.\nI want to get multiple values out of the document (weather data, location, some other strings).\nWhen I use the XmlTextReader I can call my method to pull the values ou...
I want to change color of a panel according to current selected Windows theme. I have set the prop EnableVisStyles. It changes things like toolbar and Windows form's title bar. However the panel color remains same. Is there any way to achieve this?. Regards, Harsh Suman
To change the color of a panel in a Windows Forms application based on the current selected Windows theme, you need to set the panel's background color dynamically. The `EnableVisualStyles` method only affects certain controls and does not automatically change the colors of panels. Here’s a simple way to adjust the ba...
49,734
[ { "from": "human", "value": "I want to change color of a panel according to current selected Windows theme. I have set the prop EnableVisStyles. It changes things like toolbar and Windows form's title bar. However the panel color remains same. Is there any way to achieve this?.\nRegards,\nHarsh Suman\n" }...
I have a simple form form action="email.jsp" method="post" <label for="firstname">Your Name: </label> input type="text" id="name"<br/> <label for="email">Your Email: </label> input type="text" id="address"<br/> <label for="message">Message: </label> textare...
It looks like there are a few issues with both your HTML form and your JSP code. Here are the main problems and their solutions: ### 1. HTML Form Issues In your form, the `input` and `textarea` tags are improperly closed or formed. Here's a corrected version of your form: ```html <form action="email.jsp" method="post...
46,982
[ { "from": "human", "value": "I have a simple form \nform action=\"email.jsp\" method=\"post\"\n <label for=\"firstname\">Your Name: </label>\n input type=\"text\" id=\"name\"<br/>\n <label for=\"email\">Your Email: </label>\n input type=\"text\" id=\"address\"<br/>\n ...
The software development team in my organization (that develops API's - middleware) is gearing to adopt atleast one best practice at a time. The following are on the list: Unit Testing (in its real sense), Automated unit testing, Test Driven Design & Development, Static code analysis, Continuous integration capabilitie...
Certainly! While I can't point you to a specific study published after October 2023, I can provide an overview of some widely recognized studies and literature that support the implementation of best practices in software development, particularly regarding their ROI and impact on software quality. 1. **"The Economics...
49,191
[ { "from": "human", "value": "The software development team in my organization (that develops API's - middleware) is gearing to adopt atleast one best practice at a time. The following are on the list:\nUnit Testing (in its real sense),\nAutomated unit testing,\nTest Driven Design & Development,\nStatic code...
I have a little project with some jsp deployed on an Tomcat 5.5. Recently the Servlets which are also deployed with the jsp files (one war archive) stopped working. I also checked out a previous version from my svn which should work. What I noticed that the displayname (I use a german version of Tomcat , so I guess tha...
It sounds like you're experiencing an issue with your JSP and servlet deployment on Tomcat 5.5. The fact that the display name for your application has disappeared in the Tomcat Manager and that your servlets are not functioning could be indicative of several potential issues. Here are some steps and troubleshooting ti...
47,983
[ { "from": "human", "value": "I have a little project with some jsp deployed on an Tomcat 5.5. Recently the Servlets which are also deployed with the jsp files (one war archive) stopped working. I also checked out a previous version from my svn which should work. What I noticed that the displayname (I use a ...
I have a JPEG "image" (actually a BLOB in a database) which I want to import/convert into a "Bitmap" structure in memory. The reason is that I use a third party library which is unable to work with JPEG images and I need to pass an uncompressed bitmap (as a pointer). All I found so far are ways to convert between diffe...
To convert a JPEG stored as a BLOB in a database directly into a `System.Drawing.Bitmap` in memory, you can use the `MemoryStream` class alongside the `Bitmap` class from the `System.Drawing` namespace. This approach allows you to create the `Bitmap` object from the JPEG data without needing to write it to disk. Below ...
47,189
[ { "from": "human", "value": "I have a JPEG \"image\" (actually a BLOB in a database) which I want to import/convert into a \"Bitmap\" structure in memory. The reason is that I use a third party library which is unable to work with JPEG images and I need to pass an uncompressed bitmap (as a pointer). All I f...
A few years ago, it was proven that PRIMES is in P. Are there any algorithms implementing their primality test in Python? I wanted to run some benchmarks with a naive generator and see for myself how fast it is. I'd implement it myself, but I don't understand the paper enough yet to do that.
Yes, the result that PRIMES is in P refers to a polynomial-time algorithm for testing primality, specifically the AKS primality test. While it is true that PRIMES is in P, the AKS algorithm is not typically the fastest method in practice compared to other probabilistic tests like the Miller-Rabin or deterministic tests...
44,811
[ { "from": "human", "value": "A few years ago, it was proven that PRIMES is in P. Are there any algorithms implementing their primality test in Python? I wanted to run some benchmarks with a naive generator and see for myself how fast it is. I'd implement it myself, but I don't understand the paper enough ye...
Is it possible to view the mapping configurations / mapping xml files passed from activerecord to nhibernate?
In the context of using ActiveRecord with NHibernate, the mapping configurations and XML files play a crucial role in defining how your object-oriented domain models map to the database tables. However, the ActiveRecord pattern itself abstracts some of the underlying details of NHibernate, making it less straightforwar...
48,302
[ { "from": "human", "value": "Is it possible to view the mapping configurations / mapping xml files passed from activerecord to nhibernate?\n" }, { "from": "gpt", "value": "In the context of using ActiveRecord with NHibernate, the mapping configurations and XML files play a crucial role in defini...
I've a HTML page with several Div's that will show the time difference between now and each given date. <div class="dated" onEvent="calculateHTML(this, 'Sat Jun 09 2007 17:46:21')"> 30 Minutes Ago</div> I want that time difference to be dynamic (calculated to all elements when the page loads and also within a time int...
Your approach of calculating the time difference and updating the HTML dynamically is a good one. Here's a structured way to implement it: 1. **Store the Date in a Data Attribute**: Instead of using an event directly in the HTML, it's more modern and cleaner to store the date in a data attribute. This keeps your HTML ...
44,488
[ { "from": "human", "value": "I've a HTML page with several Div's that will show the time difference between now and each given date.\n<div class=\"dated\" onEvent=\"calculateHTML(this, 'Sat Jun 09 2007 17:46:21')\">\n30 Minutes Ago</div>\n\nI want that time difference to be dynamic (calculated to all elemen...
I've looking to find a simple recommended "minimal" c++ makefile for linux which will use g++ to compile and link a single file and h file. Ideally the make file will not even have the physical file names in it and only have a .cpp to .o transform. What is the best way to generate such a makefile without diving into th...
Creating a minimal Makefile that compiles C++ source files is straightforward. Below is a simple Makefile that you can use to compile a C++ file (`.cpp`) and its corresponding header file (`.h`). This Makefile does not require you to specify the actual filenames, and it will work for any `.cpp` files in the directory. ...
48,840
[ { "from": "human", "value": "I've looking to find a simple recommended \"minimal\" c++ makefile for linux which will use g++ to compile and link a single file and h file. Ideally the make file will not even have the physical file names in it and only have a .cpp to .o transform. What is the best way to gene...
Stuggling a little bit with the RegEx, I've got 4 codes in a string CODE4:CODE3:CODE2:CODE1 each code is optional apart from CODE1 So I could have ab:bc:de:fg or bc::fg of ab:::fg In each case of the above CODE1 = fg dnd for the dear life of me I can't work out the RegEX Would be easy to do as a standard string parse,...
Your current regex is indeed quite complex due to the number of optional segments. However, you can simplify it a bit while still achieving the desired functionality. Here's a more concise regex pattern you could use: ```regex ^(?:(?<code4>[\w]*):)?(?:(?<code3>[\w]*):)?(?:(?<code2>[\w]*):)?(?<code1>[\w]+)$ ``` ### Ex...
47,224
[ { "from": "human", "value": "Stuggling a little bit with the RegEx, I've got 4 codes in a string\nCODE4:CODE3:CODE2:CODE1\neach code is optional apart from CODE1\nSo I could have ab:bc:de:fg\nor\nbc::fg\nof \nab:::fg\nIn each case of the above CODE1 = fg dnd for the dear life of me I can't work out the RegE...
It is not possible to fire an event in C# that has no handlers attached to it. So before each call it is necessary to check if the event is null. if ( MyEvent != null ) { MyEvent( param1, param2 ); } I would like to keep my code as clean as possible and get rid of those null checks. I don't think it will affect perf...
Yes, you can use reflection to automate the process of attaching empty handlers to events in a class. By doing this, you can ensure that no null checks are required when invoking the events, while keeping your code clean and reducing the risk of errors. Here's how you can achieve this: 1. **Create a Method to Attach ...
47,245
[ { "from": "human", "value": "It is not possible to fire an event in C# that has no handlers attached to it. So before each call it is necessary to check if the event is null.\nif ( MyEvent != null ) {\n MyEvent( param1, param2 );\n}\n\nI would like to keep my code as clean as possible and get rid of those ...
For example I have 2 tables, Users and UserRelations, and it is a one to many relationship. For the UserRelations table, I can have an identity column and make it the primary key: [RelationID] [int] IDENTITY(1,1) NOT NULL, [UserID] [int] NOT NULL, [TargetID] [int] NOT NULL, Or I can design the table like: [UserID] [i...
The choice between the two designs for your `UserRelations` table can have significant implications regarding performance, data integrity, and ease of use. Let's break down the implications of each approach: ### Design 1: With Identity Column ```sql [RelationID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [UserID] [int...
43,922
[ { "from": "human", "value": "For example I have 2 tables, Users and UserRelations, and it is a one to many relationship.\nFor the UserRelations table, I can have an identity column and make it the primary key: \n[RelationID] [int] IDENTITY(1,1) NOT NULL,\n[UserID] [int] NOT NULL,\n[TargetID] [int] NOT NULL,...
Is it possible to exclude a complete namespace from all FxCop analysis while still analyzing the rest of the assembly using the SuppressMessageAttribute? In my current case, I have a bunch of classes generated by LINQ to SQL which cause a lot of FxCop issues, and obviously, I will not modify all of those to match FxCop...
In FxCop, while you can use the `SuppressMessageAttribute` to suppress specific warnings at the class or method level, there isn’t a direct mechanism to exclude an entire namespace from analysis using this attribute alone. However, there are several approaches you can consider to manage the situation with generated cod...
48,968
[ { "from": "human", "value": "Is it possible to exclude a complete namespace from all FxCop analysis while still analyzing the rest of the assembly using the SuppressMessageAttribute?\nIn my current case, I have a bunch of classes generated by LINQ to SQL which cause a lot of FxCop issues, and obviously, I w...
The last line of my file is: 29-dez,40, How can I modify that line so that it reads: 29-Dez,40,90,100,50 Note: I don't want to write a new line. I want to take the same line and put new values after 29-Dez,40, I'm new at python. I'm having a lot of trouble manipulating files and for me every example I look at seems...
To modify the last line of a file in Python, you can read the entire file, modify the last line, and then write the contents back to the file. Here's a step-by-step guide to do that, along with the code you can use. ### Step-by-Step Guide: 1. **Open the File**: You will first need to read the contents of the file. 2....
49,499
[ { "from": "human", "value": "The last line of my file is:\n\n29-dez,40,\n\nHow can I modify that line so that it reads:\n\n29-Dez,40,90,100,50\n\nNote: I don't want to write a new line. I want to take the same line and put new values after 29-Dez,40,\nI'm new at python. I'm having a lot of trouble manipulat...
I'm using the command line compiler for builds. One problem I see is that the paths mentioned there seem to need to be the short versions of the filenames such that they don't contain any spaces. I don't know so much about this even though I have used it for some time. I recently upgraded to d2009 and the problem sta...
It looks like you're dealing with an issue related to path resolution in Delphi 2009. There are a couple of things to consider that may help you resolve the issue of the compiler not finding the `IdCoder.dcu` file. ### 1. Check Environment Variables Make sure that the `$(BDS)` environment variable is correctly set and...
38,367
[ { "from": "human", "value": "I'm using the command line compiler for builds. One problem I see is that the paths mentioned there seem to need to be the short versions of the filenames such that they don't contain any spaces. I don't know so much about this even though I have used it for some time.\nI rece...
I am trying to create a custom accordion for my page to that display my posts. I have it in list format using HTML and I am trying to create an effect when you click each header to expand to show more information. But I don't want to have say six blocks of code for six of the <li> elements I have on the page. Is there ...
Absolutely! You can create a custom accordion using jQuery (or vanilla JavaScript) in a more dynamic way by leveraging classes and the `.each()` method. Below, I'll provide a basic example of how to create an accordion for a list of posts using HTML, CSS, and jQuery. ### HTML Structure ```html <ul class="accordion"> ...
47,338
[ { "from": "human", "value": "I am trying to create a custom accordion for my page to that display my posts. I have it in list format using HTML and I am trying to create an effect when you click each header to expand to show more information.\nBut I don't want to have say six blocks of code for six of the <...
I want to make a simple server application where people can connect using a browser-based client (which I will make later) to watch streaming video. And I want to use C#. What do I need to capture video or rapid images through a webcam and send them over the network?
Creating a simple server application in C# to stream video from a webcam to a web-based client involves several steps. Below is a high-level overview of the components you need and a basic guide on how to implement this. ### Components Required: 1. **Webcam Access**: Use a library to capture video frames from the web...
43,790
[ { "from": "human", "value": "I want to make a simple server application where people can connect using a browser-based client (which I will make later) to watch streaming video. And I want to use C#.\nWhat do I need to capture video or rapid images through a webcam and send them over the network?\n" }, ...
I want to build a dynamic floating window with close button at corner. Is it possible, and also i want to add some content dynamically into that window. Please help me.. It should be in javascript.. Better without AJAX.. Thanks in Advance
Yes, it's certainly possible to create a dynamic floating window with a close button using plain JavaScript. Below is a simple implementation that allows you to create a floating window, add content to it dynamically, and close it when the close button is clicked. Here’s a complete example of how to achieve this: ```...
46,927
[ { "from": "human", "value": "I want to build a dynamic floating window with close button at corner. Is it possible, and also i want to add some content dynamically into that window. \nPlease help me.. It should be in javascript.. Better without AJAX..\nThanks in Advance\n" }, { "from": "gpt", "v...
This is related to a question I asked the other day on how to send email. My new, related question is this... what if the user of my application is behind a firewall or some other reason why the line client.Send(mail) won't work... After the lines: SmtpClient client = new SmtpClient("mysmtpserver.com", myportID); cl...
To determine whether you can successfully connect to an SMTP server before attempting to send an email, you can create a method that attempts to establish a connection to the SMTP server. However, you won't be able to directly test the `SmtpClient` for this purpose, as it does not provide a built-in way to check connec...
46,149
[ { "from": "human", "value": "This is related to a question I asked the other day on how to send email. \nMy new, related question is this... what if the user of my application is behind a firewall or some other reason why the line client.Send(mail) won't work...\nAfter the lines:\nSmtpClient client = new ...
I have a webpage that is taking way too long and need to optimize it. Because uninformed optimizing is the devil, I need to know what exactly is holding me down. A quick glance showed me that it is probably a LINQ to SQL query that is most likely causing the trouble. What are techniques of pinning the performance probl...
Optimizing performance in a LINQ to SQL application often requires careful investigation of the queries being generated and how data is being retrieved and manipulated. Here are some techniques to identify performance bottlenecks and best practices when using LINQ to SQL: ### Techniques for Pinpointing Performance Iss...
48,264
[ { "from": "human", "value": "I have a webpage that is taking way too long and need to optimize it. Because uninformed optimizing is the devil, I need to know what exactly is holding me down. A quick glance showed me that it is probably a LINQ to SQL query that is most likely causing the trouble.\nWhat are t...
I have from the backend a time on the format 00:12:54 and I display it to the screen. But, I would like to have this time to continue to go down. I have though to create a variable in javascript that will old the time and with setTimeout to loop to display with document.getElementById the new value. I think it can be p...
You're correct that if you have multiple timers counting down simultaneously, managing them could become complex. Using an array or an object to hold each timer's state and updates is a good way to go. Below is a general approach that uses an array to handle multiple countdown timers. ### Implementation Steps: 1. **S...
46,390
[ { "from": "human", "value": "I have from the backend a time on the format 00:12:54 and I display it to the screen. But, I would like to have this time to continue to go down. I have though to create a variable in javascript that will old the time and with setTimeout to loop to display with document.getEleme...
Here's my situation: I'm trying to understand how msbuild works by looking at the build files located in the .NET framework install path: C:\Windows\Microsoft.NET\Framework\v3.5>dir /s/b microsoft* Microsoft.Build.Tasks.v3.5.xml Microsoft.Build.xsd Microsoft.Common.targets Microsoft.Common.Tasks Microsoft.CSharp.targe...
Your understanding of how MSBuild works is on the right track. Let me break down your questions: ### 1) Is my interpretation correct? Yes, your interpretation is largely correct. MSBuild is a build system that uses a system of "targets" and "tasks" defined in XML files to determine how to build a project. Here's how ...
44,514
[ { "from": "human", "value": "Here's my situation: I'm trying to understand how msbuild works by looking at the build files located in the .NET framework install path:\nC:\\Windows\\Microsoft.NET\\Framework\\v3.5>dir /s/b microsoft*\nMicrosoft.Build.Tasks.v3.5.xml\nMicrosoft.Build.xsd\nMicrosoft.Common.targ...
I have an ASP page which will query records from a DB Table and do some processing and then Render an HTML table in the browser.My table has more than 16000 rows in it. When i am running the prigram with select top 2500 StudId,StudName from StudentsTbl, It is working fine.But when i am Using select "StudId,StudName fr...
It seems that you're encountering performance issues when trying to generate a large number of records (more than 16,000 rows) in your ASP page. When querying such a large dataset, rendering it directly in the browser can lead to performance bottlenecks or even timeouts. Here are some steps you can take to optimize you...
43,868
[ { "from": "human", "value": "I have an ASP page which will query records from a DB Table and do some processing and then Render an HTML table in the browser.My table has more than 16000 rows in it. When i am running the prigram with select top 2500 StudId,StudName from StudentsTbl, It is working fine.But wh...
In a multi-threaded program running on a multi-cpu machine do I need to access shared state ( _data in the example code below) using volatile read/writes to ensure correctness. In other words, can heap objects be cached on the cpu? Using the example below and assuming multi-threads will access the GetValue and Add meth...
In a multi-threaded environment, particularly with regard to shared state and data structures, ensuring correct synchronization and visibility across threads is critical to avoid subtle bugs and data corruption. Let's break down your specific questions: ### 1. Do I need to access shared state using volatile reads/writ...
45,624
[ { "from": "human", "value": "In a multi-threaded program running on a multi-cpu machine do I need to access shared state ( _data in the example code below) using volatile read/writes to ensure correctness.\nIn other words, can heap objects be cached on the cpu?\nUsing the example below and assuming multi-th...
I have the following structure: <StructLayout(LayoutKind.Sequential)> _ Public Structure _WTS_CLIENT_ADDRESS Public AddressFamily As Integer <MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)> _ Public Address() As Byte End Structure Which is populated by the following call: ...
The `_WTS_CLIENT_ADDRESS` structure you are working with has two fields: `AddressFamily` (an integer that indicates the address family, such as IPv4 or IPv6) and an array of bytes `Address` which holds the actual IP address. To convert the `Address` byte array into a human-readable string, you'll need to handle it dif...
48,014
[ { "from": "human", "value": "I have the following structure:\n <StructLayout(LayoutKind.Sequential)> _\n Public Structure _WTS_CLIENT_ADDRESS\n Public AddressFamily As Integer\n <MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)> _\n Public Address() As Byte\n End Structure\n\...
I'm a software developer who has a background in usability engineering. When I studied usability engineering in grad school, one of the professors had a mantra: "You are not the user". The idea was that we need to base UI design on actual user research rather than our own ideas as to how the UI should work. Since then ...
Absolutely, your professor's mantra of "You are not the user" is crucial for effective UI/UX design. Here are some examples where developers' assumptions about users can lead to confusion and frustration: 1. **Assuming Technical Knowledge**: Developers often assume users are familiar with technical terminology or jarg...
48,126
[ { "from": "human", "value": "I'm a software developer who has a background in usability engineering. When I studied usability engineering in grad school, one of the professors had a mantra: \"You are not the user\". The idea was that we need to base UI design on actual user research rather than our own idea...
With ASP.NET MVC, it is common to have AJAX code(e.g. jQuery) to invoke web service from server to without page refreshing. It's natural to make web service RESTful. It seems that there are two ways to go. First, the ASP.NET MVC URI's are RESTful, it is very easy to make some Controller/Action to act as web service met...
When considering using ASP.NET MVC and WCF for RESTful services, each approach has its pros and cons. Here's a comparison: ### ASP.NET MVC as a RESTful Service **Pros:** 1. **Simplicity:** ASP.NET MVC is designed for building web applications, and its routing and controller mechanisms lend themselves well to creatin...
48,162
[ { "from": "human", "value": "With ASP.NET MVC, it is common to have AJAX code(e.g. jQuery) to invoke web service from server to without page refreshing. It's natural to make web service RESTful. It seems that there are two ways to go. First, the ASP.NET MVC URI's are RESTful, it is very easy to make some Co...
I have a large set of XML files of a propriatary schema -the XML files define binary communication protocol (message structure). I'd like to leverage Google's protocol buffers technology. I am using existing code to load the XML files into an object model (in memory). I'd like to generate a .proto file from that obje...
Generating `.proto` files from an object model in C#/.NET requires the ability to serialize the structure of your object model into the Protocol Buffers syntax. Since you're looking for a library that can help you represent the `.proto` file format as an object model and write it out, here are a few approaches you migh...
46,535
[ { "from": "human", "value": "I have a large set of XML files of a propriatary schema -the XML files define binary communication protocol (message structure).\nI'd like to leverage Google's protocol buffers technology. \nI am using existing code to load the XML files into an object model (in memory). \nI'd l...
I do not have any experience in web based development(neither client side nor server s ide code). since long time i had a question as to if anything like below is possible to do: 1.) I have say 10 attachments 1.zip to 10.zip on my desktop. 2.) I need to send all of these as an attachment using any web based email (I ne...
Yes, it is possible to automate the process of sending multiple email attachments through a web-based email service like Gmail using browser extensions or scripts. Below are a few approaches you can consider for both Internet Explorer and Mozilla Firefox: ### 1. Using a Browser Extension For **Mozilla Firefox**, you c...
37,840
[ { "from": "human", "value": "I do not have any experience in web based development(neither client side nor server s ide code). since long time i had a question as to if anything like below is possible to do:\n1.) I have say 10 attachments 1.zip to 10.zip on my desktop.\n2.) I need to send all of these as an...
I'm looking to add a 14-Day trial limit to my software. The program has been written in Delphi 7. Any help would be much appreciated.
Adding a 14-day trial limit to your Delphi 7 software can be accomplished by recording the installation date and checking how many days have passed each time the application starts. Here's a step-by-step guide on how you can implement this: ### Step 1: Store Installation Date You can store the installation date in th...
47,933
[ { "from": "human", "value": "I'm looking to add a 14-Day trial limit to my software. The program has been written in Delphi 7.\nAny help would be much appreciated.\n" }, { "from": "gpt", "value": "Adding a 14-day trial limit to your Delphi 7 software can be accomplished by recording the install...
I am using jqGrid of which I downloaded from here http://www.trirand.com/blog . I followed the tutorial word by word to test out the grid. Now the alterations I did is that the page from which the grid gets the data is in asp.net instead of php. The problem is that the grid loads fine and there is a response with the ...
It looks like you're having trouble getting your jqGrid to display the XML data returned from your ASP.NET page. There are a few key areas to verify and troubleshoot: ### 1. XML Response Format Make sure that your XML response is properly formatted. Your XML declaration seems to have an issue. The correct declaration ...
49,332
[ { "from": "human", "value": "I am using jqGrid of which I downloaded from here http://www.trirand.com/blog . I followed the tutorial word by word to test out the grid. Now the alterations I did is that the page from which the grid gets the data is in asp.net instead of php. \nThe problem is that the grid lo...
I've created two functions to load expanded views of a month in the archive section of my blog when it's link is clicked: // Load open view of a month in the Archive section function loadMonth(date) { // Remove other open month removeMonth(); // Hide opening month's link // Define variable to hold month anc...
It sounds like you're on the right track with your JavaScript functions, but the issue might stem from how you're managing the dynamic content, particularly the IDs and their associated elements. ### Possible Issues: 1. **Unique IDs**: If you're using the same IDs for multiple months or trying to access an element th...
46,282
[ { "from": "human", "value": "I've created two functions to load expanded views of a month in the archive section of my blog when it's link is clicked:\n// Load open view of a month in the Archive section\nfunction loadMonth(date) {\n // Remove other open month\n removeMonth();\n\n // Hide opening mont...
By default, IIS6 does not serve .json (no wildcard MIME type). Therefore a 404 not found is thrown. I then add a new MIME type (.json, text/plain or application/x-javascript or application/json) which works fine. However, when you then add a new mapping (Home Directory -> Configuration -> Add) with .json, C:\WINDOWS\sy...
It sounds like you're running into a common issue with MIME types and request mappings in IIS 6 when dealing with JSON files. Here's a breakdown of the issue and some steps to troubleshoot and resolve it: ### Understanding the Problem 1. **MIME Type Configuration**: You've correctly added the MIME type for `.json`. Th...
47,099
[ { "from": "human", "value": "By default, IIS6 does not serve .json (no wildcard MIME type).\nTherefore a 404 not found is thrown. I then add a new MIME type (.json, text/plain or application/x-javascript or application/json) which works fine.\nHowever, when you then add a new mapping (Home Directory -> Conf...
I'm trying to get started with unit testing in Python and I was wondering if someone could explain the advantages and disadvantages of doctest and unittest. What conditions would you use each for?
Certainly! Both `doctest` and `unittest` are popular testing frameworks in Python, but they serve different purposes and have different advantages and disadvantages. ### `doctest` **Advantages:** 1. **Simplicity**: `doctest` allows you to write tests as part of your documentation (in docstrings). This can make it eas...
46,536
[ { "from": "human", "value": "I'm trying to get started with unit testing in Python and I was wondering if someone could explain the advantages and disadvantages of doctest and unittest. \nWhat conditions would you use each for?\n" }, { "from": "gpt", "value": "Certainly! Both `doctest` and `uni...
I'm building a web portal where language content will generally depend on the "accept-language" sent by the browser. The same content-URI will thus serve different content to different users depending on their browser setting. I'm very curious to know how this will affect search indexing. Does Google index using all la...
Google's approach to indexing content served in different languages based on the "Accept-Language" header is nuanced, and there are a few important considerations to keep in mind: 1. **Content Variation and Duplication**: If you serve different language versions of the same content from the same URL based on the user'...
45,069
[ { "from": "human", "value": "I'm building a web portal where language content will generally depend on the \"accept-language\" sent by the browser. The same content-URI will thus serve different content to different users depending on their browser setting.\nI'm very curious to know how this will affect sea...
I have code running in a loop and it's saving state based on the current time. Sometimes this can be just milliseconds apart, but for some reason it seems that DateTime.Now will always return values of at least 10 ms apart even if it's only 2 or 3 ms later. This presents a major problem since the state i'm saving depen...
The behavior you're observing with `DateTime.Now` returning values that seem to be at least 10 ms apart is likely due to the timer resolution of your operating system. On many Windows systems, the default timer resolution can cause the `DateTime.Now` method to report times that appear to be coarser than expected, espec...
48,675
[ { "from": "human", "value": "I have code running in a loop and it's saving state based on the current time. Sometimes this can be just milliseconds apart, but for some reason it seems that DateTime.Now will always return values of at least 10 ms apart even if it's only 2 or 3 ms later. This presents a major...
The idea is to move all of the right elements into the left and the left into the right with an empty space in the middle. The elements can either jump over one or two pieces into an empty space. LLL[ ]RRR I'm trying to think of a heuristic for this task. Is the heuristic meant to aid in finding a possible solution, ...
In this task, you are attempting to devise a heuristic for a puzzle where elements need to be rearranged, specifically moving 'L' (left elements) and 'R' (right elements) across an empty space in the middle of a configuration. The heuristic will help you estimate the cost or difficulty of reaching the goal state from a...
47,320
[ { "from": "human", "value": "The idea is to move all of the right elements into the left and the left into the right with an empty space in the middle. The elements can either jump over one or two pieces into an empty space. \nLLL[ ]RRR\n\nI'm trying to think of a heuristic for this task. Is the heuristic m...
I have a question about this question. I posted a reply there but since it's been marked as answered, I don't think I'll get a response to my post there. I am running C# framework 2.0 and I would like to get some of the data from a list? The list is a List<>. How can I do that without looping and doing compar...
It sounds like you're exploring ways to efficiently search through a `List<T>` in C# without iterating over every element, particularly in the context of an unsorted list. As you've pointed out, if the list is unsorted, you typically cannot avoid checking each element unless you employ a different data structure or mai...
47,896
[ { "from": "human", "value": "I have a question about this question. I posted a reply there but since it's been marked as answered, I don't think I'll get a response to my post there.\n\nI am running C# framework 2.0 and I\n would like to get some of the data\n from a list? The list is a List<>. How\n ca...
Can someone explain to me the difference between these 3 approaches to processing messages that fail delivery? Poison Queue service Dead-Letter Queue service Using a response service to handle failures I have "Programming WCF", but I don't really understand when you would use one of these over another, or when it wou...
Certainly! Let's break down each of these approaches to processing messages that fail delivery, their use cases, and when it might be appropriate to use one or more of them. ### 1. Poison Queue Service **Description**: A Poison Queue typically refers to a mechanism where messages that consistently fail to be processed...
47,196
[ { "from": "human", "value": "Can someone explain to me the difference between these 3 approaches to processing messages that fail delivery?\n\nPoison Queue service\nDead-Letter Queue service\nUsing a response service to handle failures\n\nI have \"Programming WCF\", but I don't really understand when you wo...
This is an SQL problem I can't wrap my head around in a simple query Is it possible? The data set is (letters added for ease of understanding): Start End 10:01 10:12 (A) 10:03 10:06 (B) 10:05 10:25 (C) 10:14 10:42 (D) 10:32 10:36 (E) The desired output is: PeriodStart ...
This problem can be addressed in SQL, but it will require careful crafting of your query to create the desired outputs for the specified time intervals. Below is a step-by-step approach to achieve the results you want. Assuming you have your data stored in a table called `time_periods` with columns `start_time` and `e...
44,162
[ { "from": "human", "value": "This is an SQL problem I can't wrap my head around in a simple query Is it possible?\nThe data set is (letters added for ease of understanding):\nStart End\n10:01 10:12 (A)\n10:03 10:06 (B)\n10:05 10:25 (C)\n10:14 10:42 (D)\n10:32 10...
Does anyone have a working example using HttpWebRequest in C# to submit a file from the local drive to a multipart/form-data web form?
Yes, you can use `HttpWebRequest` in C# to submit a file to a multipart/form-data web form. Below is an example demonstrating how to accomplish this. This code uploads a file from the local drive to a specified URL using multipart/form-data. ```csharp using System; using System.IO; using System.Net; using System.Text;...
47,506
[ { "from": "human", "value": "Does anyone have a working example using HttpWebRequest in C# to submit a file from the local drive to a multipart/form-data web form?\n" }, { "from": "gpt", "value": "Yes, you can use `HttpWebRequest` in C# to submit a file to a multipart/form-data web form. Below i...
I am working on a Custom MarkupExtension within a WPF application. Every documented example I have seen uses string parameters from XAML to construct the new object. Is it possible to use a non-string parameter? In other words, how can I do something like this? [MarkupExtensionReturnType(typeof(Uri))] public class Re...
Yes, you can absolutely create a WPF `MarkupExtension` that accepts non-string parameters. In WPF, you can define any type of constructor parameter for your `MarkupExtension`, including objects like `Uri`, `Type`, or even your own custom classes. When using the `MarkupExtension`, it's important to note that you will ...
46,018
[ { "from": "human", "value": "I am working on a Custom MarkupExtension within a WPF application. Every documented example I have seen uses string parameters from XAML to construct the new object. Is it possible to use a non-string parameter?\nIn other words, how can I do something like this?\n[MarkupExtens...
Need recommendations for this... I have 2 teams Enterprise SOA development with InfoPath 2003, BizTalk 2006, MSCRMv3, custom .net2 website and a bunch of webservices using VSStudio 2005 with TFS. Web Team focused on public facing websites - using Adobe Suite, VSStudio 2005. As mentioned team 1 have TFS- we dont do da...
It sounds like you have a complex setup with two teams that have different requirements and tools. Given your constraints and needs, here are some recommendations for source control and build management solutions, both Open Source Software (OSS) and commercial alternatives: ### 1. **Git (OSS)** - **Pros:** - Git is ...
47,864
[ { "from": "human", "value": "Need recommendations for this...\nI have 2 teams\n\nEnterprise SOA development with InfoPath 2003, BizTalk 2006, MSCRMv3, custom .net2 website and a bunch of webservices using VSStudio 2005 with TFS.\nWeb Team focused on public facing websites - using Adobe Suite, VSStudio 2005....
Is there a way to limit mouse pointer movement to a specific area in wxWidgets? I know there is an API function ClipCursor() in Windows, but is there a method in wxWidgets for all platforms?
In wxWidgets, there is no direct cross-platform equivalent to Windows' `ClipCursor()` that restricts mouse pointer movement. However, you can achieve similar functionality by handling mouse events and repositioning the cursor when it moves outside a designated area. Here's a general approach to limit mouse pointer mov...
44,288
[ { "from": "human", "value": "Is there a way to limit mouse pointer movement to a specific area in wxWidgets? I know there is an API function ClipCursor() in Windows, but is there a method in wxWidgets for all platforms?\n" }, { "from": "gpt", "value": "In wxWidgets, there is no direct cross-plat...
Is there a simple database program to let me collect, sort, tag, and reguritate trivia questions and answers? If something already exists in Open Source, can you point me to that? I have assembly programming skills (cue jokes) but not so much in the Perl,LINQ,Delphi,VB, C#, Java arena.
Certainly! There are several open-source database programs and tools that can help you collect, sort, tag, and manage trivia questions and answers. Below are a few suggestions that might fit your needs: ### 1. **SQLite** - **Description**: SQLite is a lightweight, serverless database engine that is easy to set up and ...
47,324
[ { "from": "human", "value": "Is there a simple database program to let me collect, sort, tag, and reguritate trivia questions and answers? \nIf something already exists in Open Source, can you point me to that? I have assembly programming skills (cue jokes) but not so much in the Perl,LINQ,Delphi,VB, C#, ...
I have some HTML I am trying to parse. There are cases where the html attributes alone are not going to help me identify the row type (header versus data). Fortunately, if my row is a data row then it should have some values that can be converted to integers. I have figured out how to convert the unicode to an integ...
To handle the situation where some cells in your HTML table may contain text that cannot be converted to integers, you can use a `try-except` block. This will allow you to attempt the conversion and gracefully handle any exceptions that arise from invalid conversions. You can iterate through the cells in your row, atte...
47,336
[ { "from": "human", "value": "I have some HTML I am trying to parse. There are cases where the html attributes alone are not going to help me identify the row type (header versus data). Fortunately, if my row is a data row then it should have some values that can be converted to integers. I have figured o...
I have a "username" TEdit on a Delphi 2006 login form. When the application starts up the user is asked to enter the username. The TEdit gets focus and the caret is placed in its horizontal center for some reason. As soon as anything is typed the caret is left aligned again and everything looks normal. It is also stra...
The issue you're experiencing with the caret position in a `TEdit` control being initially centered seems unusual, especially since it is affecting multiple Delphi versions and across different computers. Here are several potential causes and solutions to help diagnose and hopefully resolve the problem: ### Potential ...
46,457
[ { "from": "human", "value": "I have a \"username\" TEdit on a Delphi 2006 login form. When the application starts up the user is asked to enter the username. The TEdit gets focus and the caret is placed in its horizontal center for some reason. As soon as anything is typed the caret is left aligned again an...
I'm using DotNetOpenID to provide relying party OpenID support for our website. All external requests have to be brokered via a proxy server, and I'm looking for a way to tell DotNetOpenID to use this proxy. I know I can set up a global proxy config in web.config, but I currently only want this to apply to the calls ma...
Yes, you can configure DotNetOpenID to use a proxy server specifically for the requests it makes without setting a global proxy in the web.config file. DotNetOpenID uses the `HttpWebRequest` class to make its web requests, which allows you to specify a proxy for individual requests. To set up a proxy for the calls mad...
49,888
[ { "from": "human", "value": "I'm using DotNetOpenID to provide relying party OpenID support for our website. All external requests have to be brokered via a proxy server, and I'm looking for a way to tell DotNetOpenID to use this proxy. I know I can set up a global proxy config in web.config, but I currentl...
I have inherited a application framework from the previous developer where I now work. This framework utilizes multiple parent/child relationships. In many instances parent/parent/child occur. I asked why he WASN'T using MDI and he stated that years ago, when he had started, MDI had major shortcomings concerning the...
MDI (Multiple Document Interface) is a design pattern used in applications where multiple child windows can be opened within a single parent window. While MDI has its advantages, such as keeping related documents organized in one window, it also has several shortcomings that developers should consider. Here’s a rundown...
46,042
[ { "from": "human", "value": "I have inherited a application framework from the previous developer where I now work. This framework utilizes multiple parent/child relationships. In many instances parent/parent/child occur. I asked why he WASN'T using MDI and he stated that years ago, when he had started, ...
Our projects are using objects as the data source to reports. Our business layer is returning single objects or IEnumerable. Our reports (quite complex) need to display value-type properties of the object, and its related objects. Typical case would be, from a List, display a master report with category data, then a su...
Finding a suitable reporting solution that integrates well with ASP.NET applications and works seamlessly with objects as data sources can be challenging. Here are several options you might consider: 1. **DevExpress Reporting**: - DevExpress provides a robust reporting tool that supports data binding to objects. It...
49,602
[ { "from": "human", "value": "Our projects are using objects as the data source to reports.\nOur business layer is returning single objects or IEnumerable. Our reports (quite complex) need to display value-type properties of the object, and its related objects.\nTypical case would be, from a List, display a ...
I trying to learn swt, and I use maven for all my builds and eclipse for my IDE. When getting the swt jars out of the maven repository, I get: Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3034 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709) at java.la...
It looks like you are facing an issue related to the native library path for SWT when trying to run your SWT application using Maven. The `UnsatisfiedLinkError` typically indicates that the JVM cannot find the native libraries required by SWT. Here's a step-by-step guide to help you resolve this issue: ### 1. Verify ...
45,995
[ { "from": "human", "value": "I trying to learn swt, and I use maven for all my builds and eclipse for my IDE. When getting the swt jars out of the maven repository, I get:\nException in thread \"main\" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3034 in java.library.path\n at java.lang.ClassLoader.load...
I'm writing Add-inn Application A in VB.Net and DLL B in C language. Application A pass callback method to dll B. When certain event occur the dll invoke the callback from A. Whole works fine on my PC but when I move it to Notebook I get an error: Run-Time Check Failure #0 - The value of ESP was not properly saved acr...
The error you're experiencing — "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call" — typically indicates that there is a mismatch between the calling conventions used in your C function pointer and the VB.NET delegate. ### Key Points to Check and Address 1. **Calling Convent...
47,104
[ { "from": "human", "value": "I'm writing Add-inn Application A in VB.Net and DLL B in C language.\nApplication A pass callback method to dll B. \nWhen certain event occur the dll invoke the callback from A.\nWhole works fine on my PC but when I move it to Notebook I get an error:\nRun-Time Check Failure #0 ...
I have a base recipe class and I am using a datacontext. I overrode the insert method for the recipe in the datacontext and am trying to insert into its children. Nomatter what I do I cannot get the child to insert.Currently, just the recipe inserts and nothing happens with the child. partial void InsertRecipe(Reci...
When you're working with an ORM like LINQ to SQL or Entity Framework, it is crucial to ensure that both the parent and child entities are properly tracked by the context before performing insert operations. In your case, it seems that the child `TextIngredient` objects are not being saved when you insert the parent `Re...
45,366
[ { "from": "human", "value": "I have a base recipe class and I am using a datacontext. I overrode the insert method for the recipe in the datacontext and am trying to insert into its children. Nomatter what I do I cannot get the child to insert.Currently, just the recipe inserts and nothing happens with the ...
I'm trying to pass u url as parameter to a get method. I defined a route that accepts a {*url} parameter so I can send "/" characters without it separating my parameter. As soon as there is a ":" in the url (like in http: or localhost:3857 for example), the method never gets hit. The Html.ActionLink method escapes it's...
It sounds like you're trying to pass a URL as a parameter to an action method in ASP.NET MVC, but you're running into issues with the way that the URL is formatted, especially when it includes characters like `:` and `/`. When you define a route parameter with `{*url}`, it indeed allows the inclusion of `/` characters...
45,954
[ { "from": "human", "value": "I'm trying to pass u url as parameter to a get method.\nI defined a route that accepts a {*url} parameter so I can send \"/\" characters without it separating my parameter.\nAs soon as there is a \":\" in the url (like in http: or localhost:3857 for example), the method never ge...
Of all these methods what's being run and in what order?? I guess the first question to ask is whats being run first? And why does th.start() start run()? import java.applet.*; import java.awt.*; import javax.swing.JFrame; public class BallApplet extends Applet implements Runnable { int x_pos = 10; int y_pos ...
Let's break down the execution flow of the `BallApplet` class in your Java code and identify which methods are called and in what order. ### Method Execution Order 1. **`init()`**: This method is called by the applet when it is first loaded. In your code, this method is currently empty, but it's typically used to ini...
48,324
[ { "from": "human", "value": "Of all these methods what's being run and in what order??\nI guess the first question to ask is whats being run first?\nAnd why does th.start() start run()?\nimport java.applet.*;\nimport java.awt.*;\n\nimport javax.swing.JFrame;\n\npublic class BallApplet extends Applet impleme...
Somehow my iPhone Simulator is unable to play sounds. First an app I'm working on using AudioServicesPlaySystemSound() stopped working.. I spent a while debugging this but sound is still working on the iPhone when I run the app on the device. I get the same results with other iPhone apps such as the sample Crash Land...
If your iPhone Simulator is unable to play sounds, there are several steps you can take to troubleshoot the issue: 1. **Check Volume Settings**: Make sure that the volume of your Mac is turned up and not muted. The simulator uses the Mac's audio output, so if the system volume is low or muted, you won’t hear any sound...
49,778
[ { "from": "human", "value": "Somehow my iPhone Simulator is unable to play sounds. First an app I'm working on using AudioServicesPlaySystemSound() stopped working.. I spent a while debugging this but sound is still working on the iPhone when I run the app on the device. I get the same results with other ...
I'm looking for a way to programatically change features ("Programs and Features" -> "Turn Windows Features on or off") in Windows Vista (and newer Redmond OS, e.g. Server 2008). Ideal solution would be in the form of a Powershell script (Get-Features, Set-Features), however any pointers to MSDN/other documentation wou...
To programmatically manage Windows Features on Windows Vista and newer operating systems (including Windows Server 2008 and later), you can use PowerShell. However, note that in older versions like Windows Vista, the functionality may be limited compared to later versions. Below are ways to achieve what you are looking...
47,726
[ { "from": "human", "value": "I'm looking for a way to programatically change features (\"Programs and Features\" -> \"Turn Windows Features on or off\") in Windows Vista (and newer Redmond OS, e.g. Server 2008).\nIdeal solution would be in the form of a Powershell script (Get-Features, Set-Features), howeve...
I have been assigned a project to develop a set of classes that act as an interface to a storage system. A requirement is that the class support a get method with the following signature: public CustomObject get(String key, Date ifModifiedSince) Basically the method is supposed to return the CustomObject associated w...
It sounds like you have put a lot of thought into the problem and have rightly considered the implications of different design choices. Given the requirements and constraints of your project, creating a wrapper object appears to be the most suitable solution. Here's a more detailed proposal based on your conclusion: #...
49,402
[ { "from": "human", "value": "I have been assigned a project to develop a set of classes that act as an interface to a storage system. A requirement is that the class support a get method with the following signature:\npublic CustomObject get(String key, Date ifModifiedSince)\n\nBasically the method is supp...
I am trying to use some AOP in my Python programming, but I do not have any experience of the various libraries that exist. So my question are: What AOP support exists for Python? And what are the advantages of the differents libraries between them? Edit I've found some, but I don't know how they compare: Aspyct L...
Aspect-Oriented Programming (AOP) is a programming paradigm that allows you to add behavior to existing code without modifying the code itself. In Python, there are several libraries that facilitate AOP. Let's explore a few of them, highlighting their features and potential advantages, particularly in your context of m...
45,800
[ { "from": "human", "value": "I am trying to use some AOP in my Python programming, but I do not have any experience of the various libraries that exist. \nSo my question are:\n\nWhat AOP support exists for Python? And what are the advantages of the differents libraries between them?\n\n\nEdit\nI've found so...
Using the CRM views, is there a way to retrieve a list of all of the activities linked to a specific account? I want it to retrieve not only those associated with the account directly, but also those associated with the account's contacts, cases, etc. I am trying to replicate the list generated when you click the Activ...
To retrieve a comprehensive list of all activities related to a specific account in your CRM, including those linked to the account itself, its contacts, cases, and opportunities, you'll need to design a query or use an API call that accounts for all relevant relationships. Here are some general steps and consideration...
47,754
[ { "from": "human", "value": "Using the CRM views, is there a way to retrieve a list of all of the activities linked to a specific account?\nI want it to retrieve not only those associated with the account directly, but also those associated with the account's contacts, cases, etc. I am trying to replicate t...
I would like to use Linq to query a bus schedule in my project, so that at any time I can get the next 5 bus arrival times. How can I limit my query to the first 5 results? More generally, how can I take a slice of a list in C#? (In Python I would use mylist[:5] to get the first 5 elements.)
In C#, you can use LINQ (Language Integrated Query) to query collections such as lists and arrays. To get the first 5 results from a query, you can use the `Take` method, which is part of LINQ's extension methods. Here's how you can do it: 1. **Using LINQ to Query a Bus Schedule**: Assuming you have a collection of bu...
38,123
[ { "from": "human", "value": "I would like to use Linq to query a bus schedule in my project, so that at any time I can get the next 5 bus arrival times. How can I limit my query to the first 5 results?\nMore generally, how can I take a slice of a list in C#? (In Python I would use mylist[:5] to get the firs...
Here's a minimal batch file, demo.bat, to illustrate my problem: @ECHO off set /p foo=Enter foo: echo. echo you typed "%foo%" sqlcmd -? set /p bar=Enter bar: echo. echo you typed "%bar%" I have an input file foo.txt that looks like so: foo_value bar_value I run my batch file as demo.bat < foo.txt. The output is:...
The behavior you are encountering is due to the fact that the `sqlcmd` command is consuming the standard input (stdin) when it is executed, preventing further input from being read correctly from the redirected input file. Unfortunately, there is no straightforward way to have the `sqlcmd` command execute and still re...
45,630
[ { "from": "human", "value": "Here's a minimal batch file, demo.bat, to illustrate my problem:\n@ECHO off\n\nset /p foo=Enter foo:\necho.\necho you typed \"%foo%\"\n\nsqlcmd -?\n\nset /p bar=Enter bar:\necho.\necho you typed \"%bar%\"\n\nI have an input file foo.txt that looks like so:\n\nfoo_value\nbar_valu...