instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I want to run an Apache on my local machine since I can only ssh into my server thru ajaxterm (webbased ssh client) which is a pain in the neck. Now my problem is, that I am running this server and have to send the traffic thru the companies proxy which also has user authentication with password. I have a .pac file so ...
To set up an Apache server on your local machine to route traffic through a corporate proxy with user authentication, you'll need to modify the Apache configuration files accordingly. Apache does not natively support using a PAC file, but you can still configure it to work with proxy settings. ### Steps to Set Up Apa...
41,481
[ { "from": "human", "value": "I want to run an Apache on my local machine since I can only ssh into my server thru ajaxterm (webbased ssh client) which is a pain in the neck. Now my problem is, that I am running this server and have to send the traffic thru the companies proxy which also has user authenticat...
I have a web application that uses Ext-JS 2.2. In a certain component, we have an empty toolbar that we are trying to add a button to using myPanel.getTopToolbar().insertButton(0, [...array of buttons...]); However, in IE6/7 this fails because of lines 20241-20242 in ext-all-debug.js: var td = document.createElement(...
Unfortunately, the CSS `content` property that you mentioned (using `:after` pseudo-element) is not applicable to `<tr>` elements. The `content` property only works with certain inline and block-level elements and will not insert actual DOM elements into the document tree in a way that would affect the behavior of Java...
40,674
[ { "from": "human", "value": "I have a web application that uses Ext-JS 2.2. In a certain component, we have an empty toolbar that we are trying to add a button to using \nmyPanel.getTopToolbar().insertButton(0, [...array of buttons...]);\n\nHowever, in IE6/7 this fails because of lines 20241-20242 in ext-al...
Recently I've been doing a lot of modal window pop-ups and what not, for which I used jQuery. The method that I used to create the new elements on the page has overwhelmingly been along the lines of: $("<div></div>"); However, I'm getting the feeling that this isn't the best or the most efficient method of doing this...
Creating elements dynamically with jQuery using `$("...")` syntax is common, but there are more efficient ways to achieve this, especially if you're concerned about performance. Here are some recommended practices, along with their performance implications: ### 1. **Use Document Fragments** Instead of appending eleme...
42,312
[ { "from": "human", "value": "Recently I've been doing a lot of modal window pop-ups and what not, for which I used jQuery. The method that I used to create the new elements on the page has overwhelmingly been along the lines of: \n$(\"<div></div>\");\n\nHowever, I'm getting the feeling that this isn't the b...
What is the best way to store DateTime in SQL for different timezones and different locales There a few questions/answers about timezones, but none is addressing the locale problems. DateTime.ToUniversalTime is locale specific, and I need it locale independent. For example: DateTime.Now.ToUniversalTime.ToString() ...
When working with date and time in SQL databases, especially when dealing with multiple time zones and locales, it's important to follow best practices to avoid common pitfalls. Here are key considerations and a sample C# code snippet for handling DateTime values effectively: ### Best Practices for Storing DateTime in...
40,381
[ { "from": "human", "value": "What is the best way to store DateTime in SQL for different timezones and different locales\nThere a few questions/answers about timezones, but none is addressing the locale problems.\nDateTime.ToUniversalTime is locale specific, and I need it locale independent.\nFor example:\n...
I have a class Page that creates an instance of DB, which is named $db. In the __construct() of Page, I create the new $db object and I pull a bunch of config data from a file. Now the DB class has a method _connectToDB() which (attempts) to connect to the database. Is there a way in the DB class to call the parent cla...
To access configuration data from a parent class (such as the `Page` class) in a child class (like the `DB` class), you can pass the relevant configuration array to the `DB` class when creating its instance. This way, you avoid using global variables and ensure that you're not duplicating your configuration data. Here...
40,293
[ { "from": "human", "value": "I have a class Page that creates an instance of DB, which is named $db.\nIn the __construct() of Page, I create the new $db object and I pull a bunch of config data from a file.\nNow the DB class has a method _connectToDB() which (attempts) to connect to the database.\nIs there ...
Does the silverlight clr support access to a sql compact database placed in the silverlight application's isolated storage? If so, any pointers to code samples. I would like to cache information retrieved from the server in previous sessions.
Silverlight has limited support for database access compared to traditional .NET applications. However, Silverlight does support the use of SQL Server Compact (SQL CE) within its isolated storage for data persistence. This allows you to store and retrieve data between sessions. Here's a general outline of how you can ...
38,970
[ { "from": "human", "value": "Does the silverlight clr support access to a sql compact database placed in the silverlight application's isolated storage?\nIf so, any pointers to code samples.\nI would like to cache information retrieved from the server in previous sessions. \n" }, { "from": "gpt", ...
What's the easiest way to use a linked list in Python? In Scheme, a linked list is defined simply by '(1 2 3 4 5). Python's lists, [1, 2, 3, 4, 5], and tuples, (1, 2, 3, 4, 5), are not, in fact, linked lists, and linked lists have some nice properties such as constant-time concatenation, and being able to reference sep...
To implement a simple linked list in Python, you can create a class for the linked list nodes and another class for the linked list itself. This approach allows you to build a data structure that closely resembles a linked list in Scheme. Here's a basic implementation of an immutable linked list in Python: ### Node C...
42,396
[ { "from": "human", "value": "What's the easiest way to use a linked list in Python? In Scheme, a linked list is defined simply by '(1 2 3 4 5).\nPython's lists, [1, 2, 3, 4, 5], and tuples, (1, 2, 3, 4, 5), are not, in fact, linked lists, and linked lists have some nice properties such as constant-time conc...
OK so that title sucks a little but I could not think of anything better (maybe someone else can?). So I have a few questions around a subject here. What I want to do is create a program that can take an object and use reflection to list all its properties, methods, constructors etc. I can then manipulate these objects...
Creating a "reflection machine" as you've described is definitely possible, though it comes with some complexity and considerations, particularly around security, stability, and the design of your application. Let's break down the points you've raised: ### Key Features of the Reflection Machine 1. **Use Reflection to...
41,626
[ { "from": "human", "value": "OK so that title sucks a little but I could not think of anything better (maybe someone else can?).\nSo I have a few questions around a subject here. What I want to do is create a program that can take an object and use reflection to list all its properties, methods, constructor...
I am having difficulty determining if the body of a text email message is base64 encoded. if it is then use this line of code; making use of jython 2.2.1 dirty=base64.decodebytes(dirty) else continue as normal. This is the code I have atm. What line of code will allow me to extract this from the email: "Content-Tra...
It looks like you're trying to determine if the email body is Base64 encoded and then decode it if it is. However, there are some adjustments needed in the code you provided. Specifically, the way you're accessing the `Content-Transfer-Encoding` header and handling the payloads could use clarification. Here’s a modif...
41,265
[ { "from": "human", "value": "I am having difficulty determining if the body of a text email message is base64 encoded.\nif it is then use this line of code;\nmaking use of jython 2.2.1\ndirty=base64.decodebytes(dirty)\n\nelse continue as normal.\nThis is the code I have atm. What line of code will allow me ...
I'm using the following code to have a non-JS navigation: <ol id="navigation"> <li id="home"><a href="#"><img src="./images/nav/home-hover.png" alt="Home" /></li> ... </ol> And the CSS: #navigation a { display: block; height: 25px; } #navigation a img { display: none; } #navigation a:hover img { ...
Using CSS alone to change images on hover can indeed be problematic in older browsers like Internet Explorer 6. IE6 has limited support for CSS features and doesn't handle certain hover effects quite well, especially with the combination of images. Here are a few alternative solutions you could consider that don't invo...
43,241
[ { "from": "human", "value": "I'm using the following code to have a non-JS navigation:\n<ol id=\"navigation\">\n <li id=\"home\"><a href=\"#\"><img src=\"./images/nav/home-hover.png\" alt=\"Home\" /></li>\n ...\n</ol>\n\nAnd the CSS:\n#navigation a {\n display: block;\n height: 25px;\n}\n\n#navi...
Is there a managed API to compile C# applications (to memory or disk)? I assume one exists because SharePoint compiles ASP.NET pages in memory. We want to use it to, at runtime, generate Linq DataContexts and compile those against various projects.
Yes, there are managed APIs in .NET that allow you to compile C# code at runtime, both to memory and to disk. The most commonly used API for this purpose is the **Roslyn** compiler platform (Microsoft.CodeAnalysis). Roslyn provides a rich set of APIs for code analysis and compilation. ### Using Roslyn to Compile C# Co...
40,074
[ { "from": "human", "value": "Is there a managed API to compile C# applications (to memory or disk)? I assume one exists because SharePoint compiles ASP.NET pages in memory. We want to use it to, at runtime, generate Linq DataContexts and compile those against various projects. \n" }, { "from": "g...
I want to start developing Flash and Flex applications so that I can put all of the concepts floating around in my head into action. The problem is that I have never done any programming nor dealt with code...ever. I have worked in the graphic design industry and a lot of the storyboarding features in Flash are intuiti...
It's great that you have a background in graphic design and are eager to dive into developing Flash and Flex applications! Since you've already started with tutorials and grasped the concepts well, you're on the right track. Here are some suggestions to help you navigate your learning process: 1. **Continue with Flex ...
42,215
[ { "from": "human", "value": "I want to start developing Flash and Flex applications so that I can put all of the concepts floating around in my head into action. The problem is that I have never done any programming nor dealt with code...ever. I have worked in the graphic design industry and a lot of the st...
i'm trying to send fake keyboard input to an application that's running in a Remote Desktop session. i'm using: Byte key = Ord("A"); keybd_event(key, 0, 0, 0); // key goes down keybd_event(key, 0, KEYEVENTF_KEYUP, 0); // key goes up Now this code does send the character "a" to any local window, but it will not send t...
To send keyboard input to an application running in a Remote Desktop session from a local application, you cannot rely solely on the `keybd_event` function, as it typically only affects local applications. Instead, you can use a combination of techniques or libraries designed for remote desktop automation or simulate i...
41,997
[ { "from": "human", "value": "i'm trying to send fake keyboard input to an application that's running in a Remote Desktop session. i'm using:\nByte key = Ord(\"A\");\n\nkeybd_event(key, 0, 0, 0); // key goes down\nkeybd_event(key, 0, KEYEVENTF_KEYUP, 0); // key goes up\n\nNow this code does send the characte...
My main browsers (FF and Chrome) are both configured for a 12 pixel font. In both browsers the font picker shows a font preview, and in both they are the same size and a comfortable size for reading web sites. My IE doesn't allow me to set font size, but seems to default to something a little bit larger than Chrome. ...
It sounds like you've made significant progress in troubleshooting the font size issues across different browsers and websites. Here’s a breakdown of the situation and some additional insights that might help you understand why this discrepancy occurs and how to handle it effectively: ### Understanding Font Size in Br...
41,529
[ { "from": "human", "value": "My main browsers (FF and Chrome) are both configured for a 12 pixel font. In both browsers the font picker shows a font preview, and in both they are the same size and a comfortable size for reading web sites. My IE doesn't allow me to set font size, but seems to default to so...
I don't expect to get a great response from this, so if you have had experience in this any contribution would be appreciated. I am trying to use the Visual Studio Report Designer with a Linq to SQL datasource, I have no experience of using the Visual Studio Report Designer. If I go through the wizard and use an object...
Using the Visual Studio Report Designer with LINQ to SQL can be a bit challenging, especially when working with complex queries and anonymous types. However, there are ways to work around these limitations and still achieve your goals. Here's a general approach: ### Using Named Types Instead of Anonymous Types When y...
39,224
[ { "from": "human", "value": "I don't expect to get a great response from this, so if you have had experience in this any contribution would be appreciated.\nI am trying to use the Visual Studio Report Designer with a Linq to SQL datasource, I have no experience of using the Visual Studio Report Designer.\nI...
I've been trying to learn about Neural Networks for a while now, and I can understand some basic tutorials online, and I've been able to get through portions of Neural Computing - An Introduction but even there, I'm glazing over a lot of the math, and it becomes completely over my head after the first few chapters. Ev...
It's great to hear about your interest in neural networks! You’re on the right track, and it sounds like you already have a good foundation. Here’s a suggested learning path that builds on your existing knowledge and helps you fill in the gaps needed to understand neural networks thoroughly. ### 1. **Mathematics Found...
41,353
[ { "from": "human", "value": "I've been trying to learn about Neural Networks for a while now, and I can understand some basic tutorials online, and I've been able to get through portions of Neural Computing - An Introduction but even there, I'm glazing over a lot of the math, and it becomes completely over...
I'm trying to create an ASP page that has a bridged connection with an SQL Server 2005 database (separate sever from the ASP's server). For this I am trying to use a Windows Authentication setup. I have my name with full rights to the SQL server yet I am still getting the error 'Login failed for user COMPANY\name'. To ...
Hi Franco, It sounds like you're experiencing issues with connecting your ASP application to your SQL Server 2005 database using Windows Authentication. Here are several steps and troubleshooting tips that can help resolve the login failure problem: ### 1. **Check SQL Server Authentication Mode:** Ensure that your...
41,255
[ { "from": "human", "value": "I'm trying to create an ASP page that has a bridged connection with an SQL Server 2005 database (separate sever from the ASP's server). For this I am trying to use a Windows Authentication setup. I have my name with full rights to the SQL server yet I am still getting the error ...
Write a class ListNode which has the following properties: int value; ListNode *next; Provide the following functions: ListNode(int v, ListNode *l) int getValue(); ListNode* getNext(); void insert(int i); bool listcontains(int j); Write a program which asks the user to enter some integers and stores them as ListNo...
Your implementation of the `ListNode` class and the corresponding program contains several good ideas, but there are some areas where improvements can be made for better clarity, efficiency, and correctness. Here are some suggested improvements: 1. **Separation of Node Structure**: You are currently implementing the `...
38,647
[ { "from": "human", "value": "\nWrite a class ListNode which has the following properties:\n\nint value;\nListNode *next;\n\nProvide the following functions:\n\nListNode(int v, ListNode *l)\nint getValue();\nListNode* getNext();\nvoid insert(int i);\nbool listcontains(int j);\n\nWrite a program which asks th...
When using strongly typed dataSets in Visual Studio 2005/2008, if the underlying database schema changes, the only practical way to refresh is to delete the dataset and recreate it from scratch. This is OK unless I need to customize the dataset. Customizing by extending the partial dataset class allows customizations...
In Visual Studio 2005/2008, when using strongly typed DataSets, it is indeed a challenge to resynchronize a DataSet with a modified database schema while maintaining any customizations you have made. Here are some approaches to help you manage this situation without losing your customizations: 1. **Manual XML Serializ...
41,784
[ { "from": "human", "value": "When using strongly typed dataSets in Visual Studio 2005/2008, if the underlying database schema changes, the only practical way to refresh is to delete the dataset and recreate it from scratch. This is OK unless I need to customize the dataset.\nCustomizing by extending the p...
I have 4 different named instances of SQL Server 2005 on a single server (for testing purposes). There is no default instance on the server. Because I will eventually need to allow communication to these instances across the firewall, I have set the ports of each instance statically listening on all IPs for the server....
The issue you are encountering with your named instances of SQL Server 2005 appears to be related to the configuration of the instances, particularly with respect to communication protocols, authentication modes, and potential network issues. Here are several troubleshooting steps and considerations to help resolve the...
42,729
[ { "from": "human", "value": "I have 4 different named instances of SQL Server 2005 on a single server (for testing purposes). There is no default instance on the server.\nBecause I will eventually need to allow communication to these instances across the firewall, I have set the ports of each instance stati...
I know that I am supposed to use delete [] after I use new [], so using auto_ptr with new [] is not such a bright idea. However, while debugging delete [] (using Visual Studio 2005), I noticed that the call went into a function that looked like this: void operator delete[]( void * p ) { RTCCALLBACK(_RTC_Free_hook, ...
In C++, `auto_ptr` is indeed not designed to work well with dynamic arrays allocated using `new[]`. This is primarily because `auto_ptr` only has a single ownership model, which leads to issues when managing multiple objects (as with an array). Regarding the `operator delete[]` function you encountered while debugging...
40,547
[ { "from": "human", "value": "I know that I am supposed to use delete [] after I use new [], so using auto_ptr with new [] is not such a bright idea.\nHowever, while debugging delete [] (using Visual Studio 2005), I noticed that the call went into a function that looked like this:\nvoid operator delete[]( vo...
I am new to sharepoint development but have about 10 years of expirence in C++, VB6 and C#. It is my experience that a great way to learn a new language or coding style is to spend some time "dissecting" one of the open source projects available at CodePlex or Google code. In order to avoid picking up some bad habits ...
Welcome to SharePoint development! It’s great that you’re leveraging your experience to explore a new area. Dissecting open-source projects is indeed a fantastic way to learn. Below are some open-source projects and resources related to SharePoint development that you can explore to help you get started: ### Open Sour...
42,069
[ { "from": "human", "value": "I am new to sharepoint development but have about 10 years of expirence in C++, VB6 and C#. It is my experience that a great way to learn a new language or coding style is to spend some time \"dissecting\" one of the open source projects available at CodePlex or Google code. \nI...
I downloaded and installed this version of wxPython for use with my Python 2.6 installation: http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.9.1-py26.exe When I run Python and try to import wx, I get the following error: C:\Program Files\Console2>python Python 2.6 (r26:66721, Oct 2 2008, 11:35:...
The error you're encountering (`ImportError: DLL load failed`) typically indicates that there is an issue with the installation of wxPython or that the environment is not set up correctly. Here are some steps you can take to troubleshoot and potentially fix this issue: 1. **Ensure Python is Installed Correctly**: -...
43,154
[ { "from": "human", "value": "I downloaded and installed this version of wxPython for use with my Python 2.6 installation:\nhttp://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.9.1-py26.exe\nWhen I run Python and try to import wx, I get the following error:\nC:\\Program Files\\Console2>pyt...
I have a simple web app, with a few jsp pages, servlets and pojo's. I want to initialise the connection pool before any requests are made. What is the best way to do this? Can it be done when the app is first deployed or do you have to wait till the first request comes in?
To initialize a connection pool in a web application before any requests are made, it's best to do this at the application startup rather than waiting for the first request. This can be accomplished in several ways, depending on the servlet container or application server you're using. Below are some common approaches:...
42,465
[ { "from": "human", "value": "I have a simple web app, with a few jsp pages, servlets and pojo's. I want to initialise the connection pool before any requests are made. What is the best way to do this? Can it be done when the app is first deployed or do you have to wait till the first request comes in?\n"...
I've got a web page that's using jquery to receive some product information as people are looking at things and then displays the last product images that were seen. This is in a jquery AJAX callback that looks pretty much like this: if(number_of_things_seen > 10) { $('#shots li:last-child').remove(); } $('<li><img...
Memory leaks in JavaScript applications, especially when dealing with DOM manipulation, can often occur due to lingering references to DOM elements, event listeners that aren't removed, or closures that keep references alive. Here are some strategies to help mitigate the memory usage in your case: 1. **Ensure Proper R...
41,041
[ { "from": "human", "value": "I've got a web page that's using jquery to receive some product information as people are looking at things and then displays the last product images that were seen. This is in a jquery AJAX callback that looks pretty much like this:\nif(number_of_things_seen > 10) {\n $('#sho...
reference, OpenCv\samples\c\lkdemo.c Anybody know what does the following snippet of codes does ? Code extracted from lkdemo.c for( i = k = 0; i < count; i++ ) { if( add_remove_pt ) { double dx = pt.x - points[1][i].x; double dy = pt....
Sure! Let's break down your questions about the code snippet from `lkdemo.c`. ### Q1. What does the line `points[1][k++] = points[1][i];` do, and why `k++`? This line is performing two actions: 1. **Copying Values:** It copies the value from `points[1][i]` into `points[1][k]`. This means it is taking the `i-th` point...
40,791
[ { "from": "human", "value": "reference, OpenCv\\samples\\c\\lkdemo.c \nAnybody know what does the following snippet of codes does ?\nCode extracted from lkdemo.c\n for( i = k = 0; i < count; i++ )\n {\n if( add_remove_pt )\n {\n double dx = pt.x - ...
I've got an array of char* in a file. The company I work for stores data in flat files.. Sometimes the data is sorted, but sometimes it's not. I'd like to sort the data in the files. Now I could write the code to do this, from scratch. Is there an easier way? Of course an in-place sort would be the best option. I'm...
Given your constraints of handling large files with limited RAM, sorting data in place while using an efficient approach is indeed challenging. Since you mentioned that all strings are of a fixed length and you are willing to consider all options, here are a few strategies you could use to sort the data in a file conta...
37,027
[ { "from": "human", "value": "I've got an array of char* in a file. \nThe company I work for stores data in flat files.. Sometimes the data is sorted, but sometimes it's not. \nI'd like to sort the data in the files.\nNow I could write the code to do this, from scratch. \nIs there an easier way? \nOf course ...
Like most developers I have grown to love dual monitors. I won't go into all the reasons for their goodness; just take it as a given. However, they are not perfect. You can never seem to line them up "just right". You always end up with the monitors at slight funny angles. And of course the bezel always gets in the way...
Your insights on the challenges of using multiple monitors, especially when they are not identical, are well-articulated and resonate with many users who face similar frustrations. The idea of virtual monitors is certainly intriguing, and it would address many of the issues related to bezel interference, alignment, and...
43,311
[ { "from": "human", "value": "Like most developers I have grown to love dual monitors. I won't go into all the reasons for their goodness; just take it as a given.\nHowever, they are not perfect. You can never seem to line them up \"just right\". You always end up with the monitors at slight funny angles. An...
I'm looking to log unhandled javascript exceptions. Is there an event that fires when an exception isn't caught? I'm looking to catch the exceptions before they cause javascript errors in the browser, but I'd rather not run my entire application inside of a try/catch. Any help would be appreciated. Thanks! Update: tva...
To log unhandled JavaScript exceptions, you can use the `window.onerror` event handler. This handler is a global error handler that captures errors that are not caught by try/catch blocks and can be used across modern browsers, including Firefox, Chrome, Edge, and Safari. Here's an example of how to set it up: ```jav...
40,835
[ { "from": "human", "value": "I'm looking to log unhandled javascript exceptions. Is there an event that fires when an exception isn't caught? I'm looking to catch the exceptions before they cause javascript errors in the browser, but I'd rather not run my entire application inside of a try/catch. Any help w...
Whenever I alter (or even just resave without altering) a Perl file, it completely takes down our backend. I have no idea what the problem could be. Permissions are correct. Encoding is correct. Encoding is UTF-8. Transfer mode was ASCII. I might not deal with Perl too much but I have no idea what the problem could be....
It sounds like you're experiencing a challenging issue, and you're right to consider both client-side and server-side factors that may be contributing to the problem. Here are a few potential explanations and solutions to consider: ### Potential Causes: 1. **Line Endings:** Even though you mentioned that the file enc...
39,463
[ { "from": "human", "value": "Whenever I alter (or even just resave without altering) a Perl file, it completely takes down our backend. I have no idea what the problem could be. Permissions are correct. Encoding is correct. Encoding is UTF-8. Transfer mode was ASCII.\nI might not deal with Perl too much but...
I'm looking for a simple protocol to control remote processes from one managing application. The remote processes will run on Windows and Linux (x86). Is there a simple protocol for managing remote processes, for which I could find daemons that run on both Windows and Linux?
For managing remote processes across Windows and Linux systems, you have a few protocol options to consider. Here are some of the most commonly used protocols that can help you control remote processes in a unified manner: ### 1. **SSH (Secure Shell)** - **Overview**: SSH is widely used for securely accessing and man...
40,179
[ { "from": "human", "value": "I'm looking for a simple protocol to control remote processes from one managing application. The remote processes will run on Windows and Linux (x86).\nIs there a simple protocol for managing remote processes, for which I could find daemons that run on both Windows and Linux?\n"...
I know that there has been a couple questions about tutorials on moq. But I am wondering if there are any sample apps out there that use moq in the context of an n-tier business application using ado.net. I find the tutes good, but they don't seem to bring everything all together into the big picture. Thus, I am lookin...
Hi Anthony, It's great to hear that you're looking to deepen your understanding of Moq and its application in an n-tier architecture, especially in the context of ADO.NET. While there may not be a plethora of sample applications that specifically combine all these elements, I can certainly guide you toward building a ...
36,981
[ { "from": "human", "value": "I know that there has been a couple questions about tutorials on moq. But I am wondering if there are any sample apps out there that use moq in the context of an n-tier business application using ado.net.\nI find the tutes good, but they don't seem to bring everything all togeth...
I'd like to sort on a column in the result of a stored procedure without having to add the Order By clause in the stored procedure. I don't want the data to be sorted after I have executed the query, sorting should be part of the query if possible. I have the following code: public static DataTable RunReport(ReportQuer...
To sort the data returned from a stored procedure without modifying the stored procedure itself, you can apply sorting to the DataTable after the data has been filled, or you can modify your SQL command to include an `ORDER BY` clause dynamically. Here are two approaches you could take: ### Approach 1: Using a DataVi...
38,006
[ { "from": "human", "value": "I'd like to sort on a column in the result of a stored procedure without having to add the Order By clause in the stored procedure. I don't want the data to be sorted after I have executed the query, sorting should be part of the query if possible. I have the following code:\npu...
When using log4perl, the debug log layout that I'm using is : log4perl.appender.D10.layout=PatternLayout log4perl.appender.D10.layout.ConversionPattern=%d [pid=%P] %p %F{1} (%L) %M %m%n log4perl.appender.D10.Filter = DebugAndUp This produces very verbose debug logs, for example: 2008/11/26 11:57:28 [pid=25485] DEBUG S...
To achieve a consistent column alignment for your log messages in Log::Log4perl, you can use a custom layout implementation. Unfortunately, `PatternLayout` does not support padding or fixed width for fields directly. However, you can define a custom layout or modify your existing pattern to standardize the output. Her...
38,438
[ { "from": "human", "value": "When using log4perl, the debug log layout that I'm using is :\nlog4perl.appender.D10.layout=PatternLayout\nlog4perl.appender.D10.layout.ConversionPattern=%d [pid=%P] %p %F{1} (%L) %M %m%n\nlog4perl.appender.D10.Filter = DebugAndUp\n\nThis produces very verbose debug logs, for ex...
I am trying to make a php login page that allows users to access multiple .htaccess protected pages (on apache server). So a user would enter a password in a form on page 1 and depending on which login they provided, they would be sent to one directory or another, but I want the login to happen automatically to the su...
To create a PHP login page that automatically handles authentication for `.htaccess` protected directories, you can use PHP's built-in `header()` function to send the appropriate credentials via a PHP session or set cookies, rather than passing them in the URL. Here's how to accomplish this: ### Steps to Create an Aut...
42,621
[ { "from": "human", "value": "I am trying to make a php login page that allows users to access multiple .htaccess protected pages (on apache server). So a user would enter a password in a form on page 1 and depending on which login they provided, they would be sent to one directory or another, but I want th...
I'm stuck between a rock and a hard place. I'm developing on XP using Studio 2005/IIS. Thus far, this has been problem free for me, until today. I needed to add an SSL cert so I could finish development for a part of the site that runs in SSL using sessions that are only allowed in secure mode. So, I install the cert a...
It sounds like you're experiencing issues with IIS on Windows XP, especially regarding the connection limits and debugging in Visual Studio 2005. Here are some potential workarounds to address the issues you're encountering: 1. **Adjust IIS Connection Limits:** Windows XP has a limitation on the number of simultane...
39,243
[ { "from": "human", "value": "I'm stuck between a rock and a hard place. I'm developing on XP using Studio 2005/IIS. Thus far, this has been problem free for me, until today.\nI needed to add an SSL cert so I could finish development for a part of the site that runs in SSL using sessions that are only allowe...
I wish to use the Validating event on a label in VB.Net (Visual Studio 2005, .Net Runtime 2.0). I have two text boxes side by side. These are for a %/% split allocation, such as 80/20, 50/50, etc. So, I have validation on each box to ensure that their values are >= 0 and <= 100. It is my desire to have the label off to...
In Windows Forms (WinForms) applications, the `Validating` event is typically used for controls that can receive input, such as text boxes, combo boxes, and so forth. However, labels do not inherently support user input, and thus their `Validating` events do not get triggered. If you want to validate the total of two ...
42,393
[ { "from": "human", "value": "I wish to use the Validating event on a label in VB.Net (Visual Studio 2005, .Net Runtime 2.0).\nI have two text boxes side by side. These are for a %/% split allocation, such as 80/20, 50/50, etc. So, I have validation on each box to ensure that their values are >= 0 and <= 100...
I'm trying to remember how the math is worked out to compute the remainder of an XOR algorithm in Cyclical Redundancy Checks to verify the remainder bits of a network message. I shouldn't have tossed that text book. This is easily done in code, but how is it worked out by hand? I know it looks something like a standard...
Sure! Calculating the remainder using XOR for a Cyclical Redundancy Check (CRC) can be compared to long division, but with binary numbers. The method uses XOR in place of subtraction. Here’s a step-by-step guide on how to do binary long division using XOR, similar to how you would with decimal long division. ### Exam...
41,832
[ { "from": "human", "value": "I'm trying to remember how the math is worked out to compute the remainder of an XOR algorithm in Cyclical Redundancy Checks to verify the remainder bits of a network message.\nI shouldn't have tossed that text book.\nThis is easily done in code, but how is it worked out by hand...
I'd like one of my table rows to be a button that takes up an entire row of my UITableView. I figured the best way to go about this is to instantiate a UIButton, and give it the same frame size as an instance of UITableViewCell, and add that as a subview to the cell. I'm almost there, but quite a few pixels off to not ...
To create a button that takes up an entire row of your `UITableView`, it’s indeed a common practice to add a UIButton as a subview to a UITableViewCell. However, there are a few adjustments that you can make to ensure proper alignment and spacing, as well as better management of the button's touch area. Here’s an impr...
41,822
[ { "from": "human", "value": "I'd like one of my table rows to be a button that takes up an entire row of my UITableView. I figured the best way to go about this is to instantiate a UIButton, and give it the same frame size as an instance of UITableViewCell, and add that as a subview to the cell. I'm almost ...
My business is setting up online billing using PayPal and Google checkout. I'm looking for the best way to charge a recurring monthly service fee for my website. My site is subscription based and I charge X amount of dollars per month. I want to bill the customer's credit card each month for that monthly fee. The s...
Setting up recurring billing for a subscription-based website using PayPal and Google Checkout (now part of Google Pay) can be a straightforward process. Here’s a guide on how to implement this effectively: ### 1. **Using PayPal for Recurring Payments** **PayPal Standard Subscriptions:** - **Create a PayPal Business ...
42,770
[ { "from": "human", "value": "My business is setting up online billing using PayPal and Google checkout. I'm looking for the best way to charge a recurring monthly service fee for my website. My site is subscription based and I charge X amount of dollars per month. I want to bill the customer's credit car...
I am adding a method to a SOAP service. I would like this method to be able to return a map. More specifically it is map of lists (vectors/arrays). How would I capture this in its WSDL?
To represent a method in a SOAP service that returns a map (or dictionary) of lists in the WSDL (Web Services Description Language), you will need to define the appropriate types in your WSDL file. SOAP itself does not have a direct concept of a map or dictionary, but you can achieve this by defining complex types that...
38,281
[ { "from": "human", "value": "I am adding a method to a SOAP service. I would like this method to be able to return a map. More specifically it is map of lists (vectors/arrays). How would I capture this in its WSDL?\n" }, { "from": "gpt", "value": "To represent a method in a SOAP service that ret...
With stackoveflow.com in perspective (team of 2-3 engineers building a website project intended to scale) does it make sense to spend effort early in the process of development to build a search based on Lucene/Autonomy… as opposed to a database based full text search. Pros/Cons: With a mature Lucene implementation l...
When evaluating whether to implement a search solution based on Lucene or a database-based full-text search for a website project, several factors need to be considered. Here’s a breakdown of the pros and cons associated with both approaches. ### Pros of Using Lucene/Nutch or Similar: 1. **Performance**: Lucene is op...
39,681
[ { "from": "human", "value": "With stackoveflow.com in perspective (team of 2-3 engineers building a website project intended to scale) does it make sense to spend effort early in the process of development to build a search based on Lucene/Autonomy… as opposed to a database based full text search. \nPros/C...
I have read the very good blog post of Rob Conery Crazy Talk: Reducing ORM Friction How can I generalize this interface so I can implement it with NHibernate? using System; using System.Collections; using System.Linq; using System.Linq.Expressions; public interface IRepository<T> { IQueryable<T> Ge...
To generalize your `IRepository<T>` interface for use with NHibernate, you can implement it by translating the `Expression<Func<T, bool>>` to an NHibernate query. NHibernate supports LINQ queries directly, so you can leverage its capabilities to query your entities. Here’s an example of how you might implement the `IR...
41,008
[ { "from": "human", "value": "I have read the very good blog post of Rob Conery Crazy Talk: Reducing ORM Friction\nHow can I generalize this interface so I can implement it with NHibernate?\nusing System; \nusing System.Collections; \nusing System.Linq; \nusing System.Linq.Expressions; \n\n\npublic inte...
I'm looking for the .NET/C# way of performing Change Journal Operations (without importing unmanaged code). Any hints or RTM-links?
Change Journal Operations are typically performed using the `FSCTL_QUERY_USN_JOURNAL`, `FSCTL_READ_USN_JOURNAL`, and other related IO control codes in Windows. Unfortunately, these operations are typically part of the unmanaged Windows API, and there isn't a direct .NET/C# API that exposes these functions natively. Ho...
40,867
[ { "from": "human", "value": "I'm looking for the .NET/C# way of performing Change Journal Operations (without importing unmanaged code).\nAny hints or RTM-links?\n" }, { "from": "gpt", "value": "Change Journal Operations are typically performed using the `FSCTL_QUERY_USN_JOURNAL`, `FSCTL_READ_US...
Is there any sort of "out of the box" system within SharePoint (i.e. MOSS 2007) that is useful for tracking/managing permissions. We've got a relatively small installation, but I can easily see special permissions for special users/sites getting out of hand. I'm hoping there's something pre-baked into SharePoint that...
In SharePoint 2007 (MOSS), there is limited out-of-the-box functionality for tracking and managing permissions, especially when it comes to more advanced scenarios. However, there are a few features you can use to help manage permissions effectively: ### Out-of-the-Box Features: 1. **Site Settings:** - Under "Site...
43,495
[ { "from": "human", "value": "Is there any sort of \"out of the box\" system within SharePoint (i.e. MOSS 2007) that is useful for tracking/managing permissions. We've got a relatively small installation, but I can easily see special permissions for special users/sites getting out of hand. I'm hoping there...
When I display an instance of WinForms.FontDialog (C#, .NET 2.0), I am missing some fonts that I expect to be there (e.g. Courier, Fixedsys, MS Sans Serif). Also, a customer is complaining that Adobe fonts he has installed are also not showing up in the list. How can I get these fonts to display in this dialog?
The issue of missing fonts in the WinForms `FontDialog` can occur for several reasons. Here are a few steps to help troubleshoot and potentially resolve the issue of missing fonts, including system fonts like Courier, Fixedsys, MS Sans Serif, and third-party fonts like Adobe fonts: ### 1. **Check System Fonts Installa...
41,675
[ { "from": "human", "value": "When I display an instance of WinForms.FontDialog (C#, .NET 2.0), I am missing some fonts that I expect to be there (e.g. Courier, Fixedsys, MS Sans Serif). Also, a customer is complaining that Adobe fonts he has installed are also not showing up in the list.\nHow can I get thes...
Is there any way to access the Windows Event Log from a java class. Has anyone written any APIs for this, and would there be any way to access the data from a remote machine? The scenario is: I run a process on a remote machine, from a controlling Java process. This remote process logs stuff to the Event Log, which I w...
Yes, there are ways to access the Windows Event Log from a Java application, and some libraries or methods you can use to achieve this. Below are a few approaches you might consider: ### 1. Use JNA (Java Native Access) You can use the **JNA** library to call Windows API functions directly from Java. Here’s a basic ou...
36,749
[ { "from": "human", "value": "Is there any way to access the Windows Event Log from a java class. Has anyone written any APIs for this, and would there be any way to access the data from a remote machine?\nThe scenario is:\nI run a process on a remote machine, from a controlling Java process.\nThis remote pr...
We have a java web service application that uses log4j to do logging. An exception gets thrown when log4j tries to delete its rolling log files Exception:java.security.AccessControlException: access denied (java.io.FilePermission /var/opt/SUNWappserver/domains/domain1/ applications/j2ee-modules/ourwebservice/WEB-INF/l...
The `java.security.AccessControlException` you're encountering indicates that the Java security manager is preventing your application from performing the delete operation on the log files. This is commonly due to security policies that restrict certain operations, including file permissions. Here are the steps you ca...
43,513
[ { "from": "human", "value": "We have a java web service application that uses log4j to do logging. An exception gets thrown when log4j tries to delete its rolling log files\nException:java.security.AccessControlException: access denied\n(java.io.FilePermission /var/opt/SUNWappserver/domains/domain1/\nappli...
I'm writing a service application that sometimes cannot be stopped immediately upon receiving the SERVICE_CONTROL_STOP from the Services MMC. I currently handle it like this: (in pseudo-code): DWORD HandlerEx( DWORD dwControl, DWORD dwEventType, PVOID pvEventData, PVOID pvContext ) { switch( dw...
When implementing a Windows service, it's important to follow the expected behavior when handling service control requests, such as `SERVICE_CONTROL_STOP`. The behavior you're seeing is due to how the Service Control Manager (SCM) and the Windows Services infrastructure interpret the return codes from the handler. In ...
43,415
[ { "from": "human", "value": "I'm writing a service application that sometimes cannot be stopped immediately upon receiving the SERVICE_CONTROL_STOP from the Services MMC. I currently handle it like this: (in pseudo-code):\nDWORD \nHandlerEx(\n DWORD dwControl, \n DWORD dwEventType, \n PVOID pvEvent...
need ask you about some help. I have web app running in Net 2.0. I wanna ask what storage (cache, session, file) I should use for my objects as they have different scope of using. Can be divide into several groups: 1) objects related directly to visitor (e.g. details about visitor that are received after authentication...
When designing a web application, especially one built on .NET 2.0, it's essential to choose the right storage mechanism based on the lifespan and scope of the data you are handling. Given your requirements, let's analyze the different storage options for the two groups of objects you've described: ### 1. Objects Rela...
41,385
[ { "from": "human", "value": "need ask you about some help.\nI have web app running in Net 2.0.\nI wanna ask what storage (cache, session, file) I should use for my objects as they have different scope of using. Can be divide into several groups:\n1) objects related directly to visitor (e.g. details about vi...
this is the scenario: multiple web systems (mostly lampp/wampp) exist, most of them with separate login information, (some share it). We're considering the benefits/disadvantages of unifying them somehow, or at least making handling the user administration parts easier. Due to the nature of some systems (its a mixed b...
Your scenario is a common challenge faced by organizations that have a diverse set of systems with different authentication mechanisms. Here are a few approaches and solutions you can consider that aim to reduce the administrative burden of managing user accounts across multiple systems, while minimizing the need for e...
42,189
[ { "from": "human", "value": "this is the scenario:\n multiple web systems (mostly lampp/wampp) exist, most of them with separate login information, (some share it). We're considering the benefits/disadvantages of unifying them somehow, or at least making handling the user administration parts easier.\nDue t...
I am using C# and DSL Tools for VS2005. I need to create Transactions to change some data but i want them to be hidden from the user, that means, to not show in the UNDO list in VS2005. I tried by disabling the UndoManager store.UndoManager.UndoState = UndoState.Disabled; But by disabling it all existing previous act...
Creating a transaction in DSL Tools for Visual Studio 2005 that does not appear in the undo list can be a bit tricky, especially since you want to maintain the existing undo actions while performing your own operations. Unfortunately, as you have noted, the `isHidden` property for transactions is read-only, and there ...
41,808
[ { "from": "human", "value": "I am using C# and DSL Tools for VS2005. \nI need to create Transactions to change some data but i want them to be hidden from the user, that means, to not show in the UNDO list in VS2005.\nI tried by disabling the UndoManager\nstore.UndoManager.UndoState = UndoState.Disabled;\n\...
When writing application code, it's generally accepted that premature micro-optimization is evil, and that profiling first is essential, and there is some debate about how much, if any, higher level optimization to do up front. However, I haven't seen any guidelines for when/how to optimize generic code that will be p...
Optimizing generic code in libraries or frameworks poses unique challenges, as you need to consider a broader range of potential use cases than you would for application-specific code. Here are some guidelines to approach optimization in this context: ### 1. **Understand Your Use Cases** - **Identify Typical Scenar...
40,731
[ { "from": "human", "value": "When writing application code, it's generally accepted that premature micro-optimization is evil, and that profiling first is essential, and there is some debate about how much, if any, higher level optimization to do up front. However, I haven't seen any guidelines for when/ho...
Greetings! I'm still learning about the GridView control and I have one bound to an ObjectDataSource. My Web form looks like this: <asp:GridView ID="ourGrid" runat="server" DataSourceID="ourDataSource" onrowdatabound="ourGrid_RowDataBound" HeaderStyle-CssClass="header_style" AlternatingRowStyle-CssClass=...
You can achieve the modifications you desire in the `GridView` control, but there are certain limitations and steps you need to follow. Here's how you can address each of your requirements: ### 1. Customizing the TFOOT To modify the footer of the GridView, you will typically need to use the `RowDataBound` event, or y...
37,328
[ { "from": "human", "value": "Greetings!\nI'm still learning about the GridView control and I have one bound to an ObjectDataSource. My Web form looks like this:\n<asp:GridView ID=\"ourGrid\" runat=\"server\" DataSourceID=\"ourDataSource\" onrowdatabound=\"ourGrid_RowDataBound\"\n HeaderStyle-C...
I am looking for a good way to transfer non-trivial (10G > x >10MB) amounts of data from one machine to another, potentially over multiple sessions. I have looked briefly at *ftp (sftp, tftp, ftp) http torrents (out because I will not have a seed network in general) rsync (not sure if I can really adapt this to what I...
When transferring large amounts of data reliably and efficiently between machines, especially with a focus on protocol rather than application, there are several options to consider. Here are some protocols that may fit your needs: 1. **Rsync**: You mentioned uncertainty about rsync, but it is worth noting that rsync ...
41,646
[ { "from": "human", "value": "I am looking for a good way to transfer non-trivial (10G > x >10MB) amounts of data from one machine to another, potentially over multiple sessions.\nI have looked briefly at\n\n*ftp (sftp, tftp, ftp)\nhttp\ntorrents (out because I will not have a seed network in general)\nrsync...
I want to plan a data access layer and I thought to use Linq. I read that linq has its problems with performance and that you could use stored procedures with linq. Should I use stored procedures with linq when planning my data access layer? Is it crucial for the performance? When should I use them? I know that stored...
When planning a data access layer using LINQ, it's important to consider both performance and maintainability. LINQ (Language Integrated Query) provides a powerful, type-safe way to interact with databases and can be very effective for many use cases. However, there are scenarios where stored procedures can be benefici...
41,698
[ { "from": "human", "value": "I want to plan a data access layer and I thought to use Linq.\nI read that linq has its problems with performance and that you could use stored procedures with linq.\nShould I use stored procedures with linq when planning my data access layer? Is it crucial for the performance?...
I need to write a row to the database regardless of whether it already exists or not. Before using NHibernate this was done with a stored procedure. The procedure would attempt an update and if no rows were modified it would fallback to an insert. This worked well because the application doesn't care if the record exis...
Your scenario involves using NHibernate to handle a situation where you want to insert or update a record based on whether it exists without having to explicitly check for its presence. Given the constraints of NHibernate, here are a few approaches you can consider: ### 1. **Using `SaveOrUpdate()` with a Unique Constr...
39,019
[ { "from": "human", "value": "I need to write a row to the database regardless of whether it already exists or not. Before using NHibernate this was done with a stored procedure. The procedure would attempt an update and if no rows were modified it would fallback to an insert. This worked well because the ap...
I seem to be in a never ending tail spin of Linux, or not, Windows or not. Web programming or system programming. Python or PHP. I'am self teaching myself programming. But it seems I keep being torn about which way to go. Unfortunately it is always seemingly good reasons to get side tracked. You know the whole open sou...
It sounds like you’re experiencing a common challenge for self-taught programmers: the temptation to explore multiple technologies and platforms can lead to feeling overwhelmed and unfocused. Here are some tips to help you stay grounded and make progress in your programming journey: ### 1. Define Your Goals - **Identi...
43,195
[ { "from": "human", "value": "I seem to be in a never ending tail spin of Linux, or not, Windows or not. Web programming or system programming. Python or PHP.\nI'am self teaching myself programming. But it seems I keep being torn about which way to go. Unfortunately it is always seemingly good reasons to get...
I have a N-Ary non sorted in any way tree and each node can have 0-N children. Given the data structure below, how can I fill the tree view assuming you have an array of TermNodes and that array is the first level of the TreeView? I have not been able to come up with a recursive way to do this. class TermNode { publ...
To fill a tree view from an N-ary tree represented by an array of `TermNode`, you can use a recursive function to iterate through each node and its children. Below is an example of how you might accomplish this in C# using a `TreeView` control. Here's a method to populate a `TreeView` given an array of `TermNode`: ``...
36,262
[ { "from": "human", "value": "I have a N-Ary non sorted in any way tree and each node can have 0-N children. Given the data structure below, how can I fill the tree view assuming you have an array of TermNodes and that array is the first level of the TreeView? I have not been able to come up with a recursive...
I have a 'reference' SQL Server 2005 database that is used as our global standard. We're all set up for keeping general table schema and data properly synchronized, but don't yet have a good solution for other objects like views, stored procedures, and user-defined functions. I'm aware of products like Redgate's SQL Co...
Certainly! Synchronizing stored procedures, views, and user-defined functions across multiple SQL Server databases can be achieved using scripts. Below are some steps and an example of how to approach this using T-SQL scripts, without relying on third-party tools like Redgate's SQL Compare. ### Step 1: Generate the Sc...
39,999
[ { "from": "human", "value": "I have a 'reference' SQL Server 2005 database that is used as our global standard. We're all set up for keeping general table schema and data properly synchronized, but don't yet have a good solution for other objects like views, stored procedures, and user-defined functions.\nI...
Below is my (simplified) schema (in MySQL ver. 5.0.51b) and my strategy for updating it. There has got to be a better way. Inserting a new item requires 4 trips to the database and editing/updating an item takes up to 7! items: itemId, itemName categories: catId, catName map: mapId*, itemId, catId * mapId (varchar) is ...
Your current schema and update strategy involve multiple database trips, which can indeed be optimized for efficiency. Here’s a more streamlined approach to handle your insert and update operations. ### Optimized Approach 1. **Use a Transaction**: Start a transaction to ensure atomicity. This will help maintain data ...
39,205
[ { "from": "human", "value": "Below is my (simplified) schema (in MySQL ver. 5.0.51b) and my strategy for updating it. There has got to be a better way. Inserting a new item requires 4 trips to the database and editing/updating an item takes up to 7!\nitems: itemId, itemName\ncategories: catId, catName\nmap:...
I want to give Windows Server 2008 a try as a .NET developer and a database environment. I was wondering which configuration would be the most appropriate for the server in terms of: Services: Which ones are unnecessary and can be turned off to increase performance? Software: What software fits the best with the serve...
Using Windows Server 2008 as a development and database environment is a good approach, especially if you want to test and develop applications in a server-like setup. Here’s a breakdown of your queries related to services, software, and tweaks. ### Services To increase performance, you can disable unnecessary servic...
39,975
[ { "from": "human", "value": "I want to give Windows Server 2008 a try as a .NET developer and a database environment.\nI was wondering which configuration would be the most appropriate for the server in terms of:\n\nServices: Which ones are unnecessary and can be turned off to increase performance?\nSoftwar...
I have a .NET application distributed through ClickOnce. Security within the application is implemented through the WindowsPrincipal.IsInRole(GroupName) method using a set of groups as resources. This structure works well for us for users within the same domain as the groups. Unfortunately we now have users that need t...
You're facing a common challenge when dealing with multi-domain environments and security group management, particularly when they are not in the same forest. Here are several approaches you might consider for addressing your issue, along with their pros and cons. ### 1. Use a Centralized Identity Management Solution ...
42,485
[ { "from": "human", "value": "I have a .NET application distributed through ClickOnce. Security within the application is implemented through the WindowsPrincipal.IsInRole(GroupName) method using a set of groups as resources. This structure works well for us for users within the same domain as the groups. Un...
I'm currently developing an application that is comprised of five separate executables that communicate via ActiveMQ. I have a Visual Studio Solution that contains the five executable projects. One of the projects (the launcher.exe) launches the other four projects from their local folders as separate processes. As ...
Debugging multiple executables simultaneously from a single Visual Studio solution can be challenging, especially with an architecture where one executable acts as a launcher for others. However, there are a few strategies you can employ to achieve this. ### Method 1: Use of Multiple Debugger Instances 1. **Start the...
41,713
[ { "from": "human", "value": "I'm currently developing an application that is comprised of five separate executables that communicate via ActiveMQ. I have a Visual Studio Solution that contains the five executable projects. One of the projects (the launcher.exe) launches the other four projects from their ...
If I want to provide OpenID as the only registration method available AND want to do something meaningful with the nick name, how can I handle 2 users with the same Jon Smith nickname? Actually, when I looked at StackOverflow's URL schema I was surprised that the internal user ID was being used in the URL. For example:...
Handling user nicknames in an OpenID-based registration system can indeed be challenging, especially with the potential for duplicates and impersonation. Here are several strategies to consider for effectively managing nicknames while still using OpenID as your sole registration method: ### 1. Unique Nickname Requirem...
40,939
[ { "from": "human", "value": "If I want to provide OpenID as the only registration method available AND want to do something meaningful with the nick name, how can I handle 2 users with the same Jon Smith nickname?\nActually, when I looked at StackOverflow's URL schema I was surprised that the internal user ...
I have a dataset that contains 2 datatables they link together using a DataRelation. it it possible to select from those tables into into one result set? thanks, Ofer
Yes, it is definitely possible to select data from two related DataTables into one result set when using a DataRelation in a dataset. Here’s how you can do it in C#: ### Using LINQ If you're using LINQ to DataSet, you can perform a join between the two DataTables. Here is an example of how to do this: ```csharp usin...
42,561
[ { "from": "human", "value": "I have a dataset that contains 2 datatables they link together using a DataRelation.\nit it possible to select from those tables into into one result set? \nthanks,\nOfer\n" }, { "from": "gpt", "value": "Yes, it is definitely possible to select data from two related ...
We have a huge web application running on lasso, mainly because it first was a huge internal Filemaker database, that was to be opened to the public as a web app. The web application doesn't use Filemaker though, it runs on a MySQL database, recreated every day. The only reason I know of for using lasso is it's easy in...
Lasso is indeed a web programming language that was designed for database-driven applications and has a strong focus on ease of integration with databases, especially FileMaker. Here are the answers to your questions: ### 1. Is Lasso a viable language for a web app? Are there any important benefits it offers over othe...
43,016
[ { "from": "human", "value": "We have a huge web application running on lasso, mainly because it first was a huge internal Filemaker database, that was to be opened to the public as a web app.\nThe web application doesn't use Filemaker though, it runs on a MySQL database, recreated every day.\nThe only reaso...
I have a need for multiple fixed rows for the header of a virtual string view - something that looks like the effect you get if you set a StringGrid's FixedRows property to a value greater than 1. Is there a way to achieve this? Some searching on the Soft-Gems website and forums led me to a couple of mentions of an Adv...
To create a virtual string view with multiple fixed rows for the header, using the `VirtualStringTree` component from Soft-Gems, you indeed have a couple of options, including the `HeaderQueryElements` property and custom drawing methods. Below, I'll outline a basic approach using the `AdvancedHeaderDraw` method and `H...
41,617
[ { "from": "human", "value": "I have a need for multiple fixed rows for the header of a virtual string view - something that looks like the effect you get if you set a StringGrid's FixedRows property to a value greater than 1. Is there a way to achieve this?\nSome searching on the Soft-Gems website and forum...
I have a desktop application having heavyweight components (JxBrowser) in a JFrame. How can I make a snapshot from the GUI and save it to for example a png file? Note: The method using Graphics2d and Component.paint()/paintAll()/print/printAll works only for lightweight components. Any answers appreciated! EDIT I hav...
Capturing a snapshot of a heavyweight component in a JFrame, particularly when dealing with components like JxBrowser, can indeed be challenging since heavyweight components do not participate in the standard Java painting mechanism. Here are a few strategies that you can consider to capture a snapshot of your GUI: ##...
39,832
[ { "from": "human", "value": "I have a desktop application having heavyweight components (JxBrowser) in a JFrame. How can I make a snapshot from the GUI and save it to for example a png file? \nNote: The method using Graphics2d and Component.paint()/paintAll()/print/printAll works only for lightweight compon...
In Silverlight, I have a Vertical ListBox that has a Horizontal ListBox for each item. I want the items in the HorizontalListbox to space evenly across the width of the parent (Vertical) ListBox. How can I do this? <ListBox x:Name="MachineListBox" Background="Green"> <ListBox.ItemTemplate> <Dat...
To achieve even spacing for items in your `Horizontal ListBox` that is inside a `Vertical ListBox`, you can utilize a `UniformGrid` instead of a `StackPanel` for the `ItemsPanel` of your inner `ListBox`. A `UniformGrid` will help you arrange the items in rows and columns, allowing them to occupy the full width of the p...
43,856
[ { "from": "human", "value": "In Silverlight, I have a Vertical ListBox that has a Horizontal ListBox for each item. I want the items in the HorizontalListbox to space evenly across the width of the parent (Vertical) ListBox. How can I do this?\n <ListBox x:Name=\"MachineListBox\" Background=\"Green\">\n...
How do I connect to the database(MYSQL) in connection bean using JSF to retrieve its contents. Also please let me know how do I configure the web.xml file?
To connect to a MySQL database using a connection bean in a JavaServer Faces (JSF) application, you'll need to perform a series of steps that include setting up your database connection, creating a JSF managed bean for database operations, and configuring the `web.xml` file. Below, I'll provide a step-by-step guide to ...
38,111
[ { "from": "human", "value": "How do I connect to the database(MYSQL) in connection bean using JSF to retrieve its contents. Also please let me know how do I configure the web.xml file?\n" }, { "from": "gpt", "value": "To connect to a MySQL database using a connection bean in a JavaServer Faces (...
It took me some time, but I've finally managed to write down all the tasks that need to go into Version 1.0 of the software product I'm working on. The list is almost 1000 items long. We are a 3-person team, and we've somehow managed to get this far using MindMeister, Google Docs, @todos in the code etc. Now, I have e...
Prioritizing a large list of tasks can feel overwhelming, but with a structured approach, you can efficiently determine which tasks to tackle first. Here are some steps to help you prioritize your tasks and develop a manageable schedule for Version 1.0 of your software product: ### 1. **Categorize Tasks** - **High-...
42,546
[ { "from": "human", "value": "It took me some time, but I've finally managed to write down all the tasks that need to go into Version 1.0 of the software product I'm working on. \nThe list is almost 1000 items long.\nWe are a 3-person team, and we've somehow managed to get this far using MindMeister, Google ...
Can you do mock page requests with NUnit with webforms? what about web service testing?
Certainly! When testing ASP.NET Web Forms applications with NUnit, you typically want to perform mock page requests to simulate interactions with your web pages. You can achieve this by using various techniques such as mocking frameworks, HTTP request simulation, or testing frameworks that are tailored for web applicat...
41,526
[ { "from": "human", "value": "Can you do mock page requests with NUnit with webforms?\nwhat about web service testing?\n" }, { "from": "gpt", "value": "Certainly! When testing ASP.NET Web Forms applications with NUnit, you typically want to perform mock page requests to simulate interactions with...
I personally don't use FxCop yet. We want to work out the unit testing first before going with code analysis. However, which rules would you permanantly deactivate? Which rules would you deactivate temporarily and in which situation?
FxCop is a static code analysis tool for .NET applications, designed to help ensure code quality and adherence to best practices. While it's important to adhere to its rules, there are situations where you might choose to deactivate certain rules, whether permanently or temporarily. Here’s how you can categorize the ru...
41,396
[ { "from": "human", "value": "I personally don't use FxCop yet. We want to work out the unit testing first before going with code analysis. However, which rules would you permanantly deactivate? Which rules would you deactivate temporarily and in which situation?\n" }, { "from": "gpt", "value": "...
I'm using Office Automation in .NET. It is leaving behind the excel.exe program. I know the fix - it is all about explicitely defining the variables. Once defined, I can properly de-allocate the ram and the GC will clean them up. The problem is, I have literally thousands of lines of code to go through. So I'm wonderin...
In .NET, particularly when dealing with COM objects like Excel through Office Automation, it's essential to properly release the resources to prevent memory leaks. Unfortunately, there isn’t a built-in utility in .NET that provides a straightforward list of all variables holding COM references that are not released. Ho...
42,475
[ { "from": "human", "value": "I'm using Office Automation in .NET. It is leaving behind the excel.exe program. I know the fix - it is all about explicitely defining the variables. Once defined, I can properly de-allocate the ram and the GC will clean them up.\nThe problem is, I have literally thousands of li...
I'm struggling to think of a good way to use linq2sql, simply I want to use it, but I can't figure out whether it's best to wrap up the linq2sql generated classes inside my model classes providing some form of generic abstract base class / or interface for the common methods on my model classes like add, update, delete...
When working with LINQ to SQL, there are multiple approaches to structuring your code that can enhance maintainability, flexibility, and adherence to best practices. Below are some common design patterns and strategies that developers have found effective when integrating LINQ to SQL into their applications: ### 1. **...
41,190
[ { "from": "human", "value": "I'm struggling to think of a good way to use linq2sql, simply I want to use it, but I can't figure out whether it's best to wrap up the linq2sql generated classes inside my model classes providing some form of generic abstract base class / or interface for the common methods on ...
I'd like to have a job that runs nightly, or even just once a week, that generates a script of our dev databases. They tend to be tinkered with, and developers have a habit of making changes without scripting them, or documenting them. I'd like to create a job that will essentially mimic what happens when I right-click...
You are definitely on the right track thinking about generating scripts for your development databases. Automating this process can help you maintain a record of schema changes, which is crucial for recovering from unexpected issues. Here are some methods you can use to create a job that generates scripts for your dev ...
29,325
[ { "from": "human", "value": "I'd like to have a job that runs nightly, or even just once a week, that generates a script of our dev databases. They tend to be tinkered with, and developers have a habit of making changes without scripting them, or documenting them.\nI'd like to create a job that will essenti...
Under many operating systems Unix-domain sockets allow a process to reliably pass its credentials to another process in a way that can't be maliciously subverted. For instance, this is done on Linux through the SO_PASSCRED and SO_PEERCRED options, on FreeBSD by passing messages that include the cmsgcred structure, and...
On macOS, the ability to reliably pass process credentials over Unix-domain sockets is indeed not supported in the same way it is in other Unix-like operating systems. However, there are a few approaches you might consider using for passing credentials or similar information securely between processes on macOS: 1. **U...
43,750
[ { "from": "human", "value": "Under many operating systems Unix-domain sockets allow a process to reliably pass its credentials to another process in a way that can't be maliciously subverted. For instance, this is done on Linux through the SO_PASSCRED and SO_PEERCRED options, on FreeBSD by passing messages...
EDIT: I've tagged this C in a hope to get more response. It's more the theory I'm interested in than a specific language implementation. So if you're a C coder please treat the following PHP as pseudo-code and feel free to respond with an answer written in C. I am trying to speed up a PHP CLI script by having it exec...
To achieve the desired functionality of limiting the number of concurrent child processes in a PHP CLI script using `pcntl_fork()`, you can maintain a count of active child processes and only fork a new child process when the number of currently active processes is below a specified threshold (in this case, 10). Here’s...
40,691
[ { "from": "human", "value": "EDIT: I've tagged this C in a hope to get more response. It's more the theory I'm interested in than a specific language implementation. So if you're a C coder please treat the following PHP as pseudo-code and feel free to respond with an answer written in C.\nI am trying to s...
I'm trying to design a form which contains a dropdown box containing a list of grocery item choices. What criteria should I look at when trying to decide on whether to use a java enum or a lookup table? Also, I will need to plan ahead for i18n support for the dropdown strings.
When deciding whether to use a Java enum or a lookup table for your dropdown box containing grocery item choices, you should consider several criteria: ### 1. **Nature of Data** - **Fixed vs. Dynamic**: If the list of grocery items is relatively fixed and unlikely to change often, an enum might be appropriate. Howe...
43,022
[ { "from": "human", "value": "I'm trying to design a form which contains a dropdown box containing a list of grocery item choices. \nWhat criteria should I look at when trying to decide on whether to use a java enum or a lookup table? Also, I will need to plan ahead for i18n support for the dropdown string...
I faced a little trouble - I do not know if I can define my own operators for my classes. For example: type TMinMatrix = class(TMatrix) private RowAmount: Byte; ColAmount: Byte; Data: DataMatrix; DemVector, SupVector: SupplyDemand; public constructor Create(Rows, Cols: Byte); ...
In Delphi (the language you seem to be using, based on your example), you cannot directly define operator overloads like you can in C++. Delphi does not support operator overloading for classes, meaning you cannot define custom operators (like `=` or `+`) for your class types. ### Copy Constructor in Delphi However, ...
41,951
[ { "from": "human", "value": "I faced a little trouble - I do not know if I can define my own operators for my classes.\nFor example:\ntype\n TMinMatrix = class(TMatrix)\n private\n RowAmount: Byte;\n ColAmount: Byte;\n Data: DataMatrix;\n DemVector, SupVector: SupplyDemand;\n publ...
I am actually not able to install any windows feature through the "Turn Windows features on or off" dialog. I am trying to get ASP.NET working for IIS7 on Vista Ultimate. I also tried running aspnet_iisreg -i but got an unspecified error. I checked several places and none of the solutions worked. They mostly had to...
It sounds like you're experiencing issues with enabling features for IIS7 on Windows Vista Ultimate, particularly for ASP.NET. Here are several troubleshooting steps you can try to resolve the issue: ### 1. **Run Windows Features as Administrator** Ensure you are running the "Turn Windows features on or off" dialog wi...
42,023
[ { "from": "human", "value": "I am actually not able to install any windows feature through the \"Turn Windows features on or off\" dialog. I am trying to get ASP.NET working for IIS7 on Vista Ultimate. \nI also tried running aspnet_iisreg -i but got an unspecified error.\nI checked several places and none...
How can I achieve the following? I have two models (blogs and readers) and a JOIN table that will allow me to have an N:M relationship between them: class Blog < ActiveRecord::Base has_many :blogs_readers, :dependent => :destroy has_many :readers, :through => :blogs_readers end class Reader < ActiveRecord::Base ...
To achieve your goals with the `Blog`, `Reader`, and `BlogsReaders` models, here are the steps you need to follow: ### 1. Ensure Uniqueness in the Join Table To prevent duplicate entries in the `BlogsReaders` join table, you need to add a uniqueness constraint to the database. You can do this by adding a unique index...
41,097
[ { "from": "human", "value": "How can I achieve the following? I have two models (blogs and readers) and a JOIN table that will allow me to have an N:M relationship between them:\nclass Blog < ActiveRecord::Base\n has_many :blogs_readers, :dependent => :destroy\n has_many :readers, :through => :blogs_reade...
Currently, I'm using a strategy found on many blog posts. Basically, the URL contains the page number (e.g. /Users/List/5 will give you the users on page 5 of your paged list of users). However, I'm not running into a situation where one page must list two separate paged lists. How do I go about doing this using ASP...
When handling multiple paged lists on the same page in an ASP.NET MVC application, there are a couple of approaches you can take, including using URL parameters and leveraging partial views. Below are the strategies you can consider: ### Option 1: Using URL Parameters You can indeed use URL parameters to specify the ...
42,821
[ { "from": "human", "value": "Currently, I'm using a strategy found on many blog posts. Basically, the URL contains the page number (e.g. /Users/List/5 will give you the users on page 5 of your paged list of users). However, I'm not running into a situation where one page must list two separate paged lists...
What is the best way to scale a 2D image array? For instance, suppose I have an image of 1024 x 2048 bytes, with each byte being a pixel. Each pixel is a grayscale level from 0 to 255. I would like to be able to scale this image by an arbitrary factor and get a new image. So, if I scale the image by a factor of 0.68, I...
To scale and rotate a 2D image array effectively, you can use various interpolation and transformation techniques. Here's a structured approach for each task: ### Scaling the Image 1. **Determine the New Size:** - Given a scaling factor \( S \), the new dimensions can be computed as: \[ \text{new\_width}...
40,622
[ { "from": "human", "value": "What is the best way to scale a 2D image array? For instance, suppose I have an image of 1024 x 2048 bytes, with each byte being a pixel. Each pixel is a grayscale level from 0 to 255. I would like to be able to scale this image by an arbitrary factor and get a new image. So, if...
Is it possible to use a TabContainer inside a templated FormView like so: <ItemTemplate> <cc1:TabContainer ID="TabContainer1" runat="server"> <cc1:TabPanel ID="Tab1" runat="server"> <HeaderTemplate>Tab One</HeaderTemplate> <ContentTem...
Using a TabContainer inside a templated FormView is indeed possible in ASP.NET. However, the problem you're encountering with duplicate bound field IDs arises from the fact that the IDs generated during the rendering of the controls need to be unique across the entire naming container. In your case, having two `TabCo...
43,046
[ { "from": "human", "value": "Is it possible to use a TabContainer inside a templated FormView like so:\n \n\n <ItemTemplate>\n <cc1:TabContainer ID=\"TabContainer1\" runat=\"server\">\n <cc1:TabPanel ID=\"Tab1\" runat=\"server\">\n <HeaderTemplate>T...
I'm creating an app that needs to be accessed by both a web front end hosted on an internal network and also run as a scheduled task. Nothing will need to be accessed outside of our internal systems and once the app is up and running we don't envision anything changing for some time. My initial thought is to create a D...
It sounds like you’re tackling an interesting project and weighing two solid architectural choices. Let's break down your options and consider the pros and cons of each approach: creating a DLL versus a web service. ### Option 1: DLL Approach **Pros:** 1. **Performance:** Direct calls to a DLL will generally be faster...
40,582
[ { "from": "human", "value": "I'm creating an app that needs to be accessed by both a web front end hosted on an internal network and also run as a scheduled task. Nothing will need to be accessed outside of our internal systems and once the app is up and running we don't envision anything changing for some ...
As you know, in ASP.NET, you can store session data in one of following three modes: InProc Session State SQL Server For InProc mode, you can store any kind of data objects even it's not serializable. However, in Session State and SQL Server modes, you can only store serialized data. In my project, I have a ready m...
If you're facing a situation where a third-party portal stores non-serializable objects in the ASP.NET session state using InProc mode, and you need to migrate to Session State or SQL Server mode without access to modify the underlying code, you'll have to consider some workarounds. Here are some options: ### 1. **Cus...
39,508
[ { "from": "human", "value": "As you know, in ASP.NET, you can store session data in one of following three modes:\n\nInProc\nSession State \nSQL Server\n\nFor InProc mode, you can store any kind of data objects even it's not serializable. However, in Session State and SQL Server modes, you can only store se...
I would like to create my ObjectDataProvider in my C# code behind rather than my XAML. I was wondering how to change this XAML into equivalent C#. The XAML was generated by Microsoft Expression Blend 2, so the d: namespace can be ignored safely. <ObjectDataProvider x:Key="FooSourceDS" ObjectType="{x:Type myNS:FooSource...
To create an `ObjectDataProvider` in your C# code-behind that is equivalent to the XAML you provided, you can set the `ObjectType` property using the `Type` of the `FooSource` class. You're on the right track, but you need to specify the `ObjectType` property using the `typeof` operator. Here's how you can do it in C#...
43,558
[ { "from": "human", "value": "I would like to create my ObjectDataProvider in my C# code behind rather than my XAML.\nI was wondering how to change this XAML into equivalent C#. The XAML was generated by Microsoft Expression Blend 2, so the d: namespace can be ignored safely.\n<ObjectDataProvider x:Key=\"Foo...
Howdy... here on my local LAN, I have a Windows Server 2k8 box with SQL Server 2k8 installed. I can connect to the database engine using the SSMS tool on the server, but attempting to connect to the database engine from a remote machine (also on the same LAN), the connection fails with the usual generic message about ...
It sounds like you've done quite a bit of troubleshooting already, but here are some less common reasons and additional things to check that might help resolve the issue: 1. **SQL Server Configuration Manager**: - Ensure that the SQL Server instance you are trying to connect to is actually listening on the right pr...
42,970
[ { "from": "human", "value": "Howdy... here on my local LAN, I have a Windows Server 2k8 box with SQL Server 2k8 installed. I can connect to the database engine using the SSMS tool on the server, but attempting to connect to the database engine from a remote machine (also on the same LAN), the connection fa...
I'm kind of new to ASP.NET MVC and to the MVC pattern in general but I'm really digging the concept and the rapidity with which I can compose an app. One thing that I'm struggling with is how to expose more than one object to a view. I use a lot of strongly typed views, which works well but what if my view relies on ...
Welcome to the world of ASP.NET MVC! It's great to hear you're enjoying the framework and its capabilities. When it comes to passing multiple objects to a view in a strongly typed manner, there are indeed better patterns than using a `Dictionary`. Here are some recommended approaches: ### 1. ViewModel Pattern The mos...
42,865
[ { "from": "human", "value": "I'm kind of new to ASP.NET MVC and to the MVC pattern in general but I'm really digging the concept and the rapidity with which I can compose an app. One thing that I'm struggling with is how to expose more than one object to a view. I use a lot of strongly typed views, which ...
I have a requirement where I create many swc files (swc files are similar to zip or jar files). I want that, whenever I create a new swc file and add it in a "particular folder" then these files should automatically get extracted (similar to what happens in Apache Tomcat webapps folder). Please help me how to do that i...
You can achieve this in Windows using a combination of batch scripting and a task scheduler. The idea is to create a batch script that checks for new SWC files in a specific folder and extracts them when they are detected. Here’s how you can set this up step-by-step: ### Step 1: Create the Batch Script 1. Open a text...
42,466
[ { "from": "human", "value": "I have a requirement where I create many swc files (swc files are similar to zip or jar files). I want that, whenever I create a new swc file and add it in a \"particular folder\" then these files should automatically get extracted (similar to what happens in Apache Tomcat webap...
The current top-voted to this question states: Another one that's not so much a security issue, although it is security-related, is complete and abject failure to grok the difference between hashing a password and encrypting it. Most commonly found in code where the programmer is trying to provide unsafe "Remind me of...
The difference between hashing and encryption is fundamental in security, especially when it comes to storing passwords. ### Hashing vs. Encryption 1. **Hashing:** - **Definition:** Hashing is a one-way function that takes an input (or "message") and produces a fixed-size string of bytes. The output, known as the ...
41,532
[ { "from": "human", "value": "The current top-voted to this question states:\n\nAnother one that's not so much a security issue, although it is security-related, is complete and abject failure to grok the difference between hashing a password and encrypting it. Most commonly found in code where the programme...
There are <meta> tags and other things you can place in the <head> of your HTML document. What <meta> tags etc. and best practices do you make use of in your HTML document to make it more accessible, searchable, optimized etc.
The `<head>` section of an HTML document is crucial for setting metadata, improving accessibility, and optimizing the document for search engines and usability. Here are some important `<meta>` tags and best practices you can use: ### Key `<meta>` Tags 1. **Charset Declaration**: ```html <meta charset="UTF-8"> ...
40,192
[ { "from": "human", "value": "There are <meta> tags and other things you can place in the <head> of your HTML document. What <meta> tags etc. and best practices do you make use of in your HTML document to make it more accessible, searchable, optimized etc.\n" }, { "from": "gpt", "value": "The `<h...
I need a Javascript which monitors keyboard and mouse events to track how much time a user spends on the page. Specifically, actively using the page by typing, or moving/clicking with the mouse. Thought I'd ask if anybody knows of something that might work for me to save some time. Otherwise, Javascript and Aspirin her...
Certainly! You can create a simple JavaScript script to monitor keyboard and mouse events and calculate the active time a user spends on a web page. The idea is to listen for keyboard and mouse events and update a timer based on those interactions. Here's a basic example: ```javascript let activeTime = 0; // Time spen...
41,780
[ { "from": "human", "value": "I need a Javascript which monitors keyboard and mouse events to track how much time a user spends on the page. Specifically, actively using the page by typing, or moving/clicking with the mouse.\nThought I'd ask if anybody knows of something that might work for me to save some t...
I'm trying to use mtrace to detect memory leaks in a fortran program. I'm using the gfortran compiler. See the wikipedia entry for a (working) C example of mtrace: http://en.wikipedia.org/wiki/Mtrace I tried both ways, i.e. wrapping the mtrace() and muntrace() and call them from the fortran program, as well as create ...
When using `mtrace` for memory leak detection in Fortran programs compiled with `gfortran`, you may encounter difficulties because `gfortran` does not use the standard `malloc()` function directly for memory allocations. Instead, it typically wraps calls to a custom memory allocation function, such as `_gfortran_alloca...
43,055
[ { "from": "human", "value": "I'm trying to use mtrace to detect memory leaks in a fortran program. I'm using the gfortran compiler. See the wikipedia entry for a (working) C example of mtrace: http://en.wikipedia.org/wiki/Mtrace \nI tried both ways, i.e. wrapping the mtrace() and muntrace() and call them fr...
I'm storing many files of various lengths into a block-oriented medium (fixed-size e.g. 1024 bytes). When reading back the file, each block will either be missing or correct (no bit errors or the like). The missing blocks are random, and there's not necessarily any sequence to the missing blocks. I'd like to be able...
Your problem of reassembling files from blocks with some missing ones is indeed a common scenario in distributed storage systems, video streaming, and fault-tolerant storage systems. The approach you've proposed using XOR is a good start, but there are more advanced and efficient error-correcting codes that are well-su...
40,751
[ { "from": "human", "value": "I'm storing many files of various lengths into a block-oriented medium (fixed-size e.g. 1024 bytes). When reading back the file, each block will either be missing or correct (no bit errors or the like). The missing blocks are random, and there's not necessarily any sequence to...
I'm developing a sort of personalized search engine in Ruby on Rails, and I'm currently trying to find best way of sorting results depending on user's record, in real time. Example: items that are searched for can have tags (separate entities with ids), for example item has tags=[1, 5, 10, 23, 45]. User, on the other h...
Your task of developing a personalized search engine in Ruby on Rails with user-specific sorting can indeed be challenging, particularly when it comes to balancing performance and accuracy. Here are several approaches to consider based on your requirements: ### 1. Pre-Filter in the IR System While you've mentioned tha...
39,422
[ { "from": "human", "value": "I'm developing a sort of personalized search engine in Ruby on Rails, and I'm currently trying to find best way of sorting results depending on user's record, in real time.\nExample: items that are searched for can have tags (separate entities with ids), for example item has tag...
I'll be using the AdventureWorks Database to illustrate my problem. I need to show for a particular customer a list of OrderDate with the most Orders. My intial attempt was as follows: SELECT CustomerID, OrderDate, COUNT(1) Cnt FROM Sales.SalesOrderHeader WHERE CustomerID = 11300 GROUP BY CustomerID, OrderDate ORDER BY...
To achieve your goal of showing the order dates for a specific customer with the maximum count of orders, you can use a Common Table Expression (CTE) or a subquery. Here’s how you can write the query in T-SQL to get the desired results: 1. First, find the maximum count of orders for the specific customer. 2. Then, sel...
44,208
[ { "from": "human", "value": "I'll be using the AdventureWorks Database to illustrate my problem.\nI need to show for a particular customer a list of OrderDate with the most Orders.\nMy intial attempt was as follows:\nSELECT CustomerID, OrderDate, COUNT(1) Cnt\nFROM Sales.SalesOrderHeader\nWHERE CustomerID =...
Anyone have examples for creating a new user registration form where the web application checks for username availability via making an ajax call on the form and returning available or not on the same page without a full page post? Something similar to new user registration on Hotmail.
Creating a user registration form with AJAX for checking username availability can enhance user experience by providing instant feedback without needing a full page refresh. Below is an example using HTML, jQuery, and a simple backend using PHP to illustrate how you can implement this functionality. ### HTML Form ``...
40,031
[ { "from": "human", "value": "Anyone have examples for creating a new user registration form where the web application checks for username availability via making an ajax call on the form and returning available or not on the same page without a full page post? Something similar to new user registration on H...