instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
In java, there's three levels of access: Public - Open to the world Private - Open only to the class Protected - Open only to the class and its subclasses (inheritance). So why does the java compiler allow this to happen? TestBlah.java: public class TestBlah { public static void main(String[] args) { Bl...
In your code snippet, you're demonstrating how access modifiers work in Java, particularly focusing on `protected` members. Let's break down why the compiler allows the actions you described in your example. ### Access Modifiers Recap 1. **Public**: Accessible from anywhere. 2. **Private**: Accessible only within the ...
39,973
[ { "from": "human", "value": "In java, there's three levels of access:\n\nPublic - Open to the world\nPrivate - Open only to the class \nProtected - Open only to the class and its subclasses (inheritance).\n\nSo why does the java compiler allow this to happen?\nTestBlah.java:\npublic class TestBlah {\n\n ...
Is it possible to backup the windows server 2008 firewall settings?
Yes, it is possible to back up the Windows Server 2008 firewall settings. Here’s how you can do it: ### Method 1: Using the Windows Firewall with Advanced Security Snap-in 1. **Open the Firewall Configuration:** - Click on the **Start** menu. - Type `wf.msc` in the search box and hit **Enter**. This will open t...
42,313
[ { "from": "human", "value": "Is it possible to backup the windows server 2008 firewall settings?\n" }, { "from": "gpt", "value": "Yes, it is possible to back up the Windows Server 2008 firewall settings. Here’s how you can do it:\n\n### Method 1: Using the Windows Firewall with Advanced Security...
I work at a college that uses an intranet based student management solution not developed by us. Recently changes were made that caused us to have to set internet explorer to check for a new version of a web page each time it visits. Otherwise certain pages would fail to run correctly we would get old content which wo...
Setting Internet Explorer to check for a new version of a web page each time it visits will primarily affect how the browser handles caching for that specific site. Here’s what this setting generally entails and its implications for caching: 1. **Behavior of the Setting**: When you configure Internet Explorer to alway...
40,943
[ { "from": "human", "value": "I work at a college that uses an intranet based student management solution not developed by us. \nRecently changes were made that caused us to have to set internet explorer to check for a new version of a web page each time it visits. Otherwise certain pages would fail to run c...
I would like to check my JavaScript files without going to JSLint web site. Is there a desktop version of this tool for Windows?
Yes, there are several ways you can use JSLint or similar tools on your desktop without visiting the JSLint website. Here are some options: 1. **Node.js Package**: You can use JSLint directly from the command line by installing it as an npm package. First, ensure you have Node.js and npm installed. Then, you can insta...
40,957
[ { "from": "human", "value": "I would like to check my JavaScript files without going to JSLint web site.\nIs there a desktop version of this tool for Windows?\n" }, { "from": "gpt", "value": "Yes, there are several ways you can use JSLint or similar tools on your desktop without visiting the JSL...
I found one source which successfully overrode Time.strftime like this: class Time alias :old_strftime :strftime def strftime #do something old_strftime end end The trouble is, strftime is an instance method. I need to override Time.now - a class method - in such away that any caller gets my new method,...
To override a class method like `Time.now` in Ruby while still being able to call the original method, you can use `class << self` to define a new implementation of the class method and then call the original implementation. Here’s how you can do it: ```ruby class Time class << self alias_method :original_now, :...
43,322
[ { "from": "human", "value": "I found one source which successfully overrode Time.strftime like this:\nclass Time\n alias :old_strftime :strftime\n def strftime\n #do something\n old_strftime\n end\nend\n\nThe trouble is, strftime is an instance method. I need to override Time.now - a class method ...
I want to be able to read from an unsorted source text file (one record in each line), and insert the line/record into a destination text file by specifying the line number where it should be inserted. Where to insert the line/record into the destination file will be determined by comparing the incoming line from the i...
You're on an interesting path, and it's great to see your enthusiasm for tackling this problem! Let's break down how to approach this in a manner that balances clarity and efficiency. To handle this task, you'll want to read through the incoming file line by line and insert each line into the destination file at the c...
38,317
[ { "from": "human", "value": "I want to be able to read from an unsorted source text file (one record in each line), and insert the line/record into a destination text file by specifying the line number where it should be inserted.\nWhere to insert the line/record into the destination file will be determined...
In .NET there is the CultureInfo class in the System.Globalization namespace. It has two similar properties both returning values of the CultureInfo type: CurrentCulture and CurrentUICulture. What is the difference between them? Which one should I use when and why?
In .NET, the `CultureInfo` class in the `System.Globalization` namespace provides information about a specific culture (language and region) and its associated settings, such as date formats, number formats, and string comparison rules. The `CurrentCulture` and `CurrentUICulture` properties represent different aspects ...
41,155
[ { "from": "human", "value": "In .NET there is the CultureInfo class in the System.Globalization namespace. It has two similar properties both returning values of the CultureInfo type: CurrentCulture and CurrentUICulture.\nWhat is the difference between them? \nWhich one should I use when and why?\n" }, ...
The FILESTREAM feature of SQL Server 2008, allows storage of and efficient access to BLOB data using a combination of SQL Server 2008 and the NTFS file system. When insert a row on a table which contains varbinary column with filestream attribute, the file (data) is stored directly on the file system and assigned the n...
In SQL Server 2008, when you use the FILESTREAM feature, the data is stored in the NTFS file system, but the metadata is still managed within SQL Server. To associate a specific row in a table with the physical file stored in the file system, you can use the `FILESTREAM` column in combination with the `SYS.FILestream_C...
42,551
[ { "from": "human", "value": "The FILESTREAM feature of SQL Server 2008, allows storage of and efficient access to BLOB data using a combination of SQL Server 2008 and the NTFS file system.\nWhen insert a row on a table which contains varbinary column with filestream attribute, the file (data) is stored dire...
I have an existing ASP.NET 2.0 website, stored in Team Foundation Server 2005. Some of the pages/controls are encoded as ANSI (according to Notepad++) and the Content-Type header is set to: <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> I would like to change all pages to UTF-8, and theref...
Changing the encoding of your ASP.NET website from ANSI (or Windows-1252) to UTF-8 is a significant change that can affect various aspects of your application. Here are some steps to consider and potential issues you might encounter, especially in the context of using Team Foundation Server (TFS): ### Steps to Change ...
38,599
[ { "from": "human", "value": "I have an existing ASP.NET 2.0 website, stored in Team Foundation Server 2005. Some of the pages/controls are encoded as ANSI (according to Notepad++) and the Content-Type header is set to:\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\"/>\n\nI wou...
I have a SQL table which has a number of fields ID | Value | Type A typical record may be :- 1000,10,[int] a second row may be:- 1001,foo,[string] a third row may be:- 1002,10/12/2008,[DateTime] I have been asked to look at this as at the moment, each time we wish to select from this table we have to cast the value to ...
Redesigning the SQL table for improved usability and performance is a common practice, especially when dealing with a heterogeneous data type storage scenario like the one you described. SQL Server 2000 does not have support for some of the more modern features found in later versions, but we can still optimize your de...
38,522
[ { "from": "human", "value": "I have a SQL table which has a number of fields\nID | Value | Type\nA typical record may be :-\n1000,10,[int]\na second row may be:-\n1001,foo,[string]\na third row may be:-\n1002,10/12/2008,[DateTime]\nI have been asked to look at this as at the moment, each time we wish to sel...
I would like to create a WLST script to create my Weblogic domain. However I'm having problems adding the LDAP config. cd("/SecurityConfiguration/myDomain") cmo.createRealm("myrealm") cd("/SecurityConfiguration/myDomain/Realms/myrealm") cmo.createAuthenticationProvider("myLDAP", "weblogic.security.providers.authentica...
When creating a WebLogic domain and configuring security features like LDAP, you may encounter issues related to the order and context in which you are invoking WLST commands. The `SecurityConfiguration` object needs to be correctly accessed in the domain's configuration before you can create realms and authentication ...
38,444
[ { "from": "human", "value": "I would like to create a WLST script to create my Weblogic domain. However I'm having problems adding the LDAP config.\ncd(\"/SecurityConfiguration/myDomain\")\ncmo.createRealm(\"myrealm\")\n\ncd(\"/SecurityConfiguration/myDomain/Realms/myrealm\")\ncmo.createAuthenticationProvid...
We are developing a number of games on multiple paltforms (DS/Wii/Xbox 360/PS3/PC/PSP). Each has their own compiler/linker and debugger. We want to use Visual Studio as the IDE and to manage the build process but use the platform specific compilers (and settings) to generate the appropriate output. We could manage the ...
Integrating multiple platform-specific compilers into Visual Studio can be a complex task, but there are a few strategies you can consider to manage the build process effectively while leveraging Visual Studio's IDE features. Below are some approaches, along with their pros and cons: ### 1. **Custom MSBuild Targets** ...
38,484
[ { "from": "human", "value": "We are developing a number of games on multiple paltforms (DS/Wii/Xbox 360/PS3/PC/PSP). Each has their own compiler/linker and debugger. We want to use Visual Studio as the IDE and to manage the build process but use the platform specific compilers (and settings) to generate the...
I'm learning c# , and I reached the LinkedList<T> type and I still need to know more, like when should I use it, how do I create one, how do I to use it. I just want information. If any one knows a good article about this subject, or if you can show me some examples with explanation, such as how to create, how to add a...
Certainly! The `LinkedList<T>` class in C# is a part of the `System.Collections.Generic` namespace and provides a doubly linked list implementation. It's particularly useful when you need efficient insertions and deletions from the middle of a collection. Below, I’ll outline when to use `LinkedList<T>`, how to create o...
35,395
[ { "from": "human", "value": "I'm learning c# , and I reached the LinkedList<T> type and I still need to know more, like when should I use it, how do I create one, how do I to use it. I just want information.\nIf any one knows a good article about this subject, or if you can show me some examples with explan...
In this sentence: myCommand.ExecuteReader(CommandBehavior.CloseConnection) does it close connection in case of exception?
In the context of using `myCommand.ExecuteReader(CommandBehavior.CloseConnection)` in ADO.NET (assuming this is from a .NET application), the `CommandBehavior.CloseConnection` option specifies that the associated database connection should be automatically closed when the `DbDataReader` is closed. However, if an exce...
41,314
[ { "from": "human", "value": "In this sentence:\nmyCommand.ExecuteReader(CommandBehavior.CloseConnection)\n\ndoes it close connection in case of exception?\n" }, { "from": "gpt", "value": "In the context of using `myCommand.ExecuteReader(CommandBehavior.CloseConnection)` in ADO.NET (assuming this...
I'm writing a Linux kernel module that needs to open and read files. What's the best way to accomplish that?
Writing a Linux kernel module that interacts with files is a task that requires careful consideration, as the kernel operates at a lower level than user space and does not have the same direct access to file operations as user-space applications. Here’s how you can approach this: ### General Guidelines 1. **Avoid file...
37,157
[ { "from": "human", "value": "I'm writing a Linux kernel module that needs to open and read files. What's the best way to accomplish that?\n" }, { "from": "gpt", "value": "Writing a Linux kernel module that interacts with files is a task that requires careful consideration, as the kernel operates...
I have an application web.xml with the following entry: <error-page> <error-code>404</error-code> <location>/system_files/error/p_notfound.jsp</location> </error-page> However, when this page is displayed, Japanese characters are garbled. The same page (p_notfound.jsp) displays properly if displayed directly ...
When you encounter garbled characters in a JSP page that is displayed due to an error, it often means that the character encoding is not being set correctly for the error response. This situation can arise because the web server or servlet container may not apply the same character encoding to error pages as it does to...
40,924
[ { "from": "human", "value": "I have an application web.xml with the following entry:\n<error-page>\n <error-code>404</error-code>\n <location>/system_files/error/p_notfound.jsp</location>\n</error-page>\n\nHowever, when this page is displayed, Japanese characters are garbled. \nThe same page (p_notfou...
I'm using this simple regular expression to validate a hex string: ^[A-Fa-f0-9]{16}$ As you can see, I'm using a quantifier to validate that the string is 16 characters long. I was wondering if I can use another quantifier in the same regex to validate the string length to be either 16 or 18 (not 17).
Yes, you can modify your regular expression to validate a hexadecimal string that is either 16 or 18 characters long. You can use the alternation operator `|` to specify the two lengths. Here's how you can do that: ```regex ^([A-Fa-f0-9]{16}|[A-Fa-f0-9]{18})$ ``` In this regex: - `^` asserts the start of the string....
41,683
[ { "from": "human", "value": "I'm using this simple regular expression to validate a hex string:\n^[A-Fa-f0-9]{16}$\n\nAs you can see, I'm using a quantifier to validate that the string is 16 characters long. I was wondering if I can use another quantifier in the same regex to validate the string length to b...
In XHTML Strict, it seems that you're not allowed to use the <u> tag any more. Is there a semantic equivalent like there is for <b> and <i>? If not, is there any convention for how to markup underlined text in XHTML? Thanks.
In XHTML Strict, the `<u>` tag is indeed not permitted because it is considered presentational markup, which does not convey semantic meaning. The `<b>` and `<i>` tags have semantic equivalents—`<strong>` for bold text and `<em>` for italic text—aimed at conveying meaning rather than just presentation. For underlined ...
39,544
[ { "from": "human", "value": "In XHTML Strict, it seems that you're not allowed to use the <u> tag any more. Is there a semantic equivalent like there is for <b> and <i>? If not, is there any convention for how to markup underlined text in XHTML?\nThanks.\n" }, { "from": "gpt", "value": "In XHTML...
I have a JEdit (BeanShell) macro which opens a specific file then immediately saves the file to my c:\temp folder (so that I don't accidentally update the real file). Here is the bean shell code: logFilePath = "c:\\temp\\aj.txt"; jEdit.openFile( view , logFilePath ); _buffer = jEdit.getBuffer(logFilePath); _buffer.save...
The issue you're encountering is due to the asynchronous nature of file I/O operations in JEdit. When you call `jEdit.openFile()`, it begins the process of opening the file but doesn't complete it immediately. As a result, trying to save the buffer right after opening it leads to the error because the file isn't fully ...
40,933
[ { "from": "human", "value": "I have a JEdit (BeanShell) macro which opens a specific file then immediately saves the file to my c:\\temp folder (so that I don't accidentally update the real file).\nHere is the bean shell code:\nlogFilePath = \"c:\\\\temp\\\\aj.txt\";\njEdit.openFile( view , logFilePath );\n...
I have a partitioned table in SQL Enterprise 2005. I need to query the PARTITION FUNCTION to find it's partition ranges. What SQL query will give me those values?
In SQL Server 2005, you can retrieve information about the partition function and its corresponding partition ranges by querying the system catalog views. Specifically, you can use the `sys.partition_functions` and `sys.partition_range_values` catalog views to get the necessary information. Here’s a query that will he...
43,755
[ { "from": "human", "value": "I have a partitioned table in SQL Enterprise 2005. I need to query the PARTITION FUNCTION to find it's partition ranges. What SQL query will give me those values?\n" }, { "from": "gpt", "value": "In SQL Server 2005, you can retrieve information about the partition fu...
I have developed a framework that is used by several teams in our organisation. Those "modules", developed on top of this framework, can behave quite differently but they are all pretty resources consuming even though some are more than others. They all receive data in input, analyse and/or transform it, and send it fu...
Your idea of sequentially running each module with a well-chosen dataset is a solid starting point for benchmarking. However, to ensure that your benchmark results are meaningful and provide a clear basis for comparing hardware offers, consider the following advice and best practices: ### 1. Define Benchmark Objective...
39,091
[ { "from": "human", "value": "I have developed a framework that is used by several teams in our organisation. Those \"modules\", developed on top of this framework, can behave quite differently but they are all pretty resources consuming even though some are more than others. They all receive data in input, ...
I'm getting a FileIOPermssion exception thrown when trying to create a folder in Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) on some computers. I've established that there is some form of antivirus running on the computer in question, but I haven't been able to get in contact with their IT depa...
The `FileIOPermission` exception you're encountering when trying to create a folder in `Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)` can indeed be influenced by several factors, including antivirus software, User Account Control (UAC), and specific user permissions on the system. Here are some...
40,842
[ { "from": "human", "value": "I'm getting a FileIOPermssion exception thrown when trying to create a folder in Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) on some computers. I've established that there is some form of antivirus running on the computer in question, but I haven't been ...
My workplace is planning on moving to Team Foundation Server and it's not a moment too soon - anything to get away from the cancer that is Visual SourceSafe. However, I must ask - is the source control in TFS significantly different (and better) than VSS or is it just a "beefed up" version of the same thing? I ask thi...
Team Foundation Server (TFS) offers significant improvements over Visual SourceSafe (VSS), so transitioning to TFS is generally seen as a positive step for most teams. Here are some key differences and improvements TFS provides compared to VSS: 1. **Version Control System**: TFS uses a more robust version control syst...
41,531
[ { "from": "human", "value": "My workplace is planning on moving to Team Foundation Server and it's not a moment too soon - anything to get away from the cancer that is Visual SourceSafe.\nHowever, I must ask - is the source control in TFS significantly different (and better) than VSS or is it just a \"beefe...
I am trying to implement performance testing on ActiveMQ, so have setup a basic producer and consumer to send and receive messages across a queue. I have created a producer with no problems, getting it to write a specific number of messages to the queue: for(int i = 0; i < numberOfMessages; i++){ try{ ...
It sounds like you're encountering a problem with your consumer being blocked while trying to receive messages from the ActiveMQ queue. There are several factors that could contribute to this issue. Here are some potential areas to investigate and steps you can take to troubleshoot the problem: 1. **Consumer Acknowled...
37,331
[ { "from": "human", "value": "I am trying to implement performance testing on ActiveMQ, so have setup a basic producer and consumer to send and receive messages across a queue. I have created a producer with no problems, getting it to write a specific number of messages to the queue:\n for(int i = 0; i < num...
Our coding standards ask that we minimise the use of C# var (suggests limiting it's use to being in conjunction with Linq). However there are times when using generics where it's reasonably convenient e.g. Dictionary<DateTime, Dictionary<string, float>> allValues = ... // ... foreach (var dateEntry in allValue) is eas...
In C#, using the `var` keyword can certainly make some code easier to read and write, particularly when dealing with complex types like nested dictionaries. However, as you noted, some coding standards recommend minimizing its use to promote clarity, especially in situations where the type can easily be inferred. As o...
40,400
[ { "from": "human", "value": "Our coding standards ask that we minimise the use of C# var (suggests limiting it's use to being in conjunction with Linq). However there are times when using generics where it's reasonably convenient e.g.\nDictionary<DateTime, Dictionary<string, float>> allValues = ...\n// ...\...
Staring JBoss server from within Eclipse Ganymede gives me the following problem: "Server JBoss v4.0 at localhost was unable to start within 120 seconds. If the server requires more time, try increasing the timeout in the server editor." The console shows JBoss has started in so and so minutes but soon after, there is ...
The issue you're encountering with starting JBoss from within Eclipse Ganymede is often related to the server start-up time. Eclipse has a default timeout period of 120 seconds for starting servers, and if the server does not start within that timeframe, you will see the error message you're getting. Here are some ste...
39,726
[ { "from": "human", "value": "Staring JBoss server from within Eclipse Ganymede gives me the following problem:\n\"Server JBoss v4.0 at localhost was unable to start within 120 seconds. If the server requires more time, try increasing the timeout in the server editor.\"\nThe console shows JBoss has started i...
When I started using SoundEngine (from CrashLanding and TouchFighter), I had read about a few people recommending not to use it, for it was, according to them, not stable enough. Still it was the only solution I knew of to play sounds with pitch and position control without learning C++ and OpenAL, so I ignored the war...
It's understandable to be concerned about using a library that may not be stable or well-maintained, especially as platform updates and alternatives become available. Since you're looking for an open-source alternative to SoundEngine, here are a few options you might consider: 1. **OpenAL**: Since you mentioned an int...
41,814
[ { "from": "human", "value": "When I started using SoundEngine (from CrashLanding and TouchFighter), I had read about a few people recommending not to use it, for it was, according to them, not stable enough. Still it was the only solution I knew of to play sounds with pitch and position control without lear...
How do I declare a session variable in PL/SQL - one that will persist for the duration of the session only, without me having to store it in the database itself?
In PL/SQL, you can declare session variables that persist for the duration of the session using Oracle's `DBMS_SESSION` package or by using PL/SQL collections or package variables. However, typically, session state in PL/SQL is managed using package variables because they are stored in memory for the duration of the se...
40,578
[ { "from": "human", "value": "How do I declare a session variable in PL/SQL - one that will persist for the duration of the session only, without me having to store it in the database itself?\n" }, { "from": "gpt", "value": "In PL/SQL, you can declare session variables that persist for the durati...
I have a JavaScript snippet that runs very well on Firefox and Safari, but refuses to run on IE: var drop= function(id) { if(document.getElementById("select1").value == "Ficha de pediatria"){ top.location.href = "print.jsp?id="+id+"&type=2"; } else if(document.getElementById("select1").value == "Ficha norm...
The issue you're facing with Internet Explorer (IE) might be related to how the `id` variable is being passed to the `drop` function in the `onChange` event of your `<select>` element. In IE, the variable `id` is not defined unless it has been explicitly declared or assigned a value, which could lead to issues when the...
40,324
[ { "from": "human", "value": "I have a JavaScript snippet that runs very well on Firefox and Safari, but refuses to run on IE:\nvar drop= function(id)\n{\n if(document.getElementById(\"select1\").value == \"Ficha de pediatria\"){\n top.location.href = \"print.jsp?id=\"+id+\"&type=2\";\n }\n else if(...
Are function pointers supported in Inno Setup? I can't find anything in the documentation. I know Delphi/Pascal supports them and as the Inno Setup scripting engine is based on it, I'm hoping it is supported.
Inno Setup does not natively support function pointers like you might find in Delphi or other Pascal-based environments. Inno Setup uses a scripting language based on Pascal, but it does not include all features of the full Delphi language, particularly those involving advanced memory management and direct function poi...
43,213
[ { "from": "human", "value": "Are function pointers supported in Inno Setup? I can't find anything in the documentation. I know Delphi/Pascal supports them and as the Inno Setup scripting engine is based on it, I'm hoping it is supported.\n" }, { "from": "gpt", "value": "Inno Setup does not nat...
How to wait in a bash script for several subprocesses spawned from that script to finish, and then return exit code !=0 when any of the subprocesses ends with code !=0? Simple script: #!/bin/bash for i in `seq 0 9`; do doCalculations $i & done wait The above script will wait for all 10 spawned subprocesses, but it w...
You can achieve this by using a combination of `wait` and checking the exit status of each subprocess as they finish. Here's how you can modify your script: ```bash #!/bin/bash # Initialize a variable to track if any subprocess exits with a non-zero status exit_code=0 # Start the subprocesses in the background for i...
43,586
[ { "from": "human", "value": "How to wait in a bash script for several subprocesses spawned from that script to finish, and then return exit code !=0 when any of the subprocesses ends with code !=0?\nSimple script:\n#!/bin/bash\nfor i in `seq 0 9`; do\n doCalculations $i &\ndone\nwait\n\nThe above script wi...
I am working on a solo project, writing all code myself so no collaboration is required, However, I do need the following features: Check in a current version, with comments Assign a label to a version Retrieve a version using label/tag NOT HOSTED (meaning I hold the repository on my local machine) free/open source Wi...
If you're looking for a version control system that meets your criteria—being local, user-friendly with a GUI, and not too complex—there are a few options you might consider: ### 1. **Git with GUI Clients** While Git is often associated with command-line usage, many excellent graphical user interfaces (GUIs) make it m...
42,113
[ { "from": "human", "value": "I am working on a solo project, writing all code myself so no collaboration is required,\nHowever, I do need the following features:\n\nCheck in a current version, with comments\nAssign a label to a version\nRetrieve a version using label/tag\nNOT HOSTED (meaning I hold the repo...
Is there a wrapper around the Win32 API for getting font information without actually instantiating an instance of the .NET Font class? For example, some fonts do not have a regular style so I need to determine what styles are valid for a font without actually creating an instance of it.
Yes, you can use the Win32 API to get information about fonts without creating an instance of the .NET `Font` class. In particular, you can use the `EnumFontFamiliesEx` function from the GDI (Graphics Device Interface) library to enumerate the fonts available on the system and gather information about their styles. He...
32,831
[ { "from": "human", "value": "Is there a wrapper around the Win32 API for getting font information without actually instantiating an instance of the .NET Font class? \nFor example, some fonts do not have a regular style so I need to determine what styles are valid for a font without actually creating an inst...
I guess it should be a common technique, However, I tried the following two options: 1) Using my existing POP3 PHP client to access my local mail account. I am getting a "could not connect". Same code works if I run it with my localhost connecting to GoDaddy's pop3 server 2) Parsing the local mbox file - I can't figure...
When working with local mail accounts or mbox files in PHP, both approaches you mentioned have their pros and cons. Let's break them down and explore possible solutions. ### Option 1: Using POP3 PHP Client If you're trying to connect to a local mail account using a POP3 PHP client and getting a "could not connect" er...
39,782
[ { "from": "human", "value": "I guess it should be a common technique,\nHowever, I tried the following two options:\n1) Using my existing POP3 PHP client to access my local mail account. I am getting a \"could not connect\". Same code works if I run it with my localhost connecting to GoDaddy's pop3 server\n2...
I am trying to return the minimum and maximum prices for a villa booking system. I have a look up table that stores the price for each week for each villa. I am using the min and max functions to do this within the select but I'm having lots of problems. Can anyone explain where i'm going wrong? Heres the sp ALTER PRO...
The issue you're experiencing with the SQL query is likely due to the way you're using the `MIN` and `MAX` functions along with the `GROUP BY` clause. When you use aggregate functions like `MIN` and `MAX`, you must include all non-aggregated columns in the `GROUP BY` clause. In your query, you are trying to select mul...
38,385
[ { "from": "human", "value": "I am trying to return the minimum and maximum prices for a villa booking system. I have a look up table that stores the price for each week for each villa. \nI am using the min and max functions to do this within the select but I'm having lots of problems. Can anyone explain whe...
I'm trying to configure Hibernate classes not through XML/Annotation, but using their programmatic API: Mappings mappings = configuration.createMappings(); mappings.addClass(...); An example of column addition: public void addColumn(String colName, String accessorName, NullableType type) { if(this._t...
When configuring Hibernate using its programmatic API, it's important to ensure that you're managing the mapping relationships properly to avoid issues such as the `NullPointerException` you're encountering related to column duplication. In your specific case, the error appears to arise when a column name is duplicate...
40,365
[ { "from": "human", "value": "I'm trying to configure Hibernate classes not through XML/Annotation, but using their programmatic API:\nMappings mappings = configuration.createMappings();\n mappings.addClass(...);\n\nAn example of column addition:\npublic void addColumn(String colName, String accessorName,...
I've tried MiniBufExplorer, but I usually end up with several windows showing it or close it altogether. What I'd like is something like LustyJuggler with incremental search, the way I switch between buffers in Emacs. Surely there is a script like this?
It sounds like you're looking for a more efficient way to switch between buffers in Vim, akin to how you use LustyJuggler or the way Emacs handles buffer switching. While MiniBufExplorer is a great plugin, it might not fit your workflow perfectly. Here are a few alternatives that provide incremental search or enhanced ...
42,632
[ { "from": "human", "value": "I've tried MiniBufExplorer, but I usually end up with several windows showing it or close it altogether. What I'd like is something like LustyJuggler with incremental search, the way I switch between buffers in Emacs. Surely there is a script like this?\n" }, { "from": "...
I am building a small device with its own CPU (AVR Mega8) that is supposed to connect to a PC. Assuming that the physical connection and passing of bytes has been accomplished, what would be the best protocol to use on top of those bytes? The computer needs to be able to set certain voltages on the device, and read bac...
Your approach of a host-driven synchronous protocol sounds quite reasonable for your application. Here are some additional considerations and options you might want to explore: ### 1. **Protocol Design** - **Request-Response Model**: This is a common pattern where the PC sends a command (request), and the AVR Mega8 re...
37,415
[ { "from": "human", "value": "I am building a small device with its own CPU (AVR Mega8) that is supposed to connect to a PC. Assuming that the physical connection and passing of bytes has been accomplished, what would be the best protocol to use on top of those bytes? The computer needs to be able to set cer...
Here is a snippet of the file /proc/self/smaps: 00af8000-00b14000 r-xp 00000000 fd:00 16417 /lib/ld-2.8.so Size: 112 kB Rss: 88 kB Pss: 1 kB Shared_Clean: 88 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 0 kB Referenced: ...
To obtain useful information from the memory range `00b14000-00b15000`—specifically the line number of the file in which a large static structure is declared—several steps can be followed. This process typically involves using tools like `gdb`, `addr2line`, and potentially inspecting the binary with a disassembler. Her...
32,566
[ { "from": "human", "value": "Here is a snippet of the file /proc/self/smaps:\n00af8000-00b14000 r-xp 00000000 fd:00 16417 /lib/ld-2.8.so\nSize: 112 kB\nRss: 88 kB\nPss: 1 kB\nShared_Clean: 88 kB\nShared_Dirty: 0 kB\nPrivate_Clean: ...
I'd like to save some simple text data to a file from my Silverlight app - to a CSV file. The user presses on a button, the code generates the contents of the file in memory (a string), then a prompt appears asking to either open the file or Save to disk, like through a normal web page. I found a complicated way to do ...
In Silverlight, saving files to the client machine can be a bit tricky since it doesn't have direct access to the file system like traditional desktop applications. However, starting with Silverlight 2.0, Microsoft introduced a more straightforward way to save files, including the capability to save text data as a CSV ...
39,774
[ { "from": "human", "value": "I'd like to save some simple text data to a file from my Silverlight app - to a CSV file.\nThe user presses on a button, the code generates the contents of the file in memory (a string), then a prompt appears asking to either open the file or Save to disk, like through a normal ...
The curses.ascii module has some nice functions defined, that allow for example to recognize which characters are printable (curses.ascii.isprint(ch)). But, diffrent character codes can be printable depending on which locale setting is being used. For example, there are certain polish characters: >>> ord('a') 97 >>> or...
You're correct that the `curses.ascii.isprint` function is primarily based on ASCII, which is not suitable for character sets beyond the basic Latin alphabet. To handle locale-specific printable characters, Python provides a more flexible approach through the `unicodedata` module. This module can help you determine if ...
40,988
[ { "from": "human", "value": "The curses.ascii module has some nice functions defined, that allow for example to recognize which characters are printable (curses.ascii.isprint(ch)).\nBut, diffrent character codes can be printable depending on which locale setting is being used. For example, there are certain...
Does the size of a .net assembly affect performance at all? How about the number of assemblies in your windows forms/web forms project?
Yes, the size of a .NET assembly and the number of assemblies in a project can affect performance, though the impact can vary based on several factors. Here are some points to consider: ### Size of a .NET Assembly 1. **Load Time**: Larger assemblies can take longer to load into memory, which may increase startup time...
41,302
[ { "from": "human", "value": "Does the size of a .net assembly affect performance at all? How about the number of assemblies in your windows forms/web forms project?\n" }, { "from": "gpt", "value": "Yes, the size of a .NET assembly and the number of assemblies in a project can affect performance,...
I want to build an Axis2 client (I'm only accessing a remote web service, I'm not implementing one!) with Maven2 and I don't want to add 21MB of JARs to my project. What do I have to put in my pom.xml to compile the code when I've converted the WSDL with ADB?
To build an Axis2 client that uses ADB (Axis Data Binding) for accessing a remote web service without including a large number of JAR files, you'll need to include only the necessary dependencies in your `pom.xml`. Here’s a minimal example of what your `pom.xml` might look like to achieve this: ```xml <project xmlns="...
38,334
[ { "from": "human", "value": "I want to build an Axis2 client (I'm only accessing a remote web service, I'm not implementing one!) with Maven2 and I don't want to add 21MB of JARs to my project. What do I have to put in my pom.xml to compile the code when I've converted the WSDL with ADB?\n" }, { "fr...
I am attempting to start a new Wordpress blog. I am seeing funny characters in some browsers but not others instead of single quotes, double quotes and ellipses. Things I already thought of: The HTML template page for output itself is set to UTF-8 The admin page is UTF-8 The MySQL database tables where the data is s...
It sounds like you're encountering issues with character encoding, which can often happen due to a mismatch in settings between the database, server, and application layers. Since you've already verified several aspects, here are some additional troubleshooting steps and solutions to consider: 1. **Database Collation*...
39,053
[ { "from": "human", "value": "I am attempting to start a new Wordpress blog. I am seeing funny characters in some browsers but not others instead of single quotes, double quotes and ellipses. Things I already thought of:\n\nThe HTML template page for output\nitself is set to UTF-8\nThe admin page is UTF-8\...
I am attempting to determine prior art for the following idea: 1) user types in some code in a language called (insert_name_here); 2) user chooses a destination language from a list of well-known output candidates (javascript, ruby, perl, python); 3) the processor translates insert_name_here into runnable code in desti...
Your idea of a code translation tool that converts code from a custom language (let's call it "insert_name_here") into runnable code in multiple established programming languages (like JavaScript, Ruby, Perl, Python) is an interesting one. As of my knowledge cutoff in October 2023, there are several tools and systems t...
40,167
[ { "from": "human", "value": "I am attempting to determine prior art for the following idea:\n1) user types in some code in a language called (insert_name_here);\n2) user chooses a destination language from a list of well-known output candidates (javascript, ruby, perl, python);\n3) the processor translates ...
If I have a list like this: <ul id="mylist"> <li id="list-item1">text 1</li> <li id="list-item2">text 2</li> <li id="list-item3">text 3</li> <li id="list-item4">text 4</li> </ul> What's the easiest way to re-arrange the DOM nodes to my preference? (This needs to happen automatically when the page loads...
To rearrange the DOM nodes in your list based on a preferred order retrieved from a cookie, you can use JavaScript. Here's a step-by-step guide to achieve this: 1. **Store the Order in a Cookie**: First, ensure that your order preference is stored in a cookie. For example, you might have a cookie that looks like this:...
38,286
[ { "from": "human", "value": "If I have a list like this:\n<ul id=\"mylist\">\n <li id=\"list-item1\">text 1</li>\n <li id=\"list-item2\">text 2</li>\n <li id=\"list-item3\">text 3</li>\n <li id=\"list-item4\">text 4</li>\n</ul>\n\nWhat's the easiest way to re-arrange the DOM nodes to my preferen...
As per the title. I think .Net libraries would definitely benifit from some sort of community development; perhaps something like the Java Community Process. This is where an analogue would be very helpful. EDIT: I think people are believing that I need to use some libraries. That's not what I'm talking about. I mean s...
Your suggestion for a formal community development process for .NET libraries akin to the Java Community Process (JCP) is an interesting idea. Here’s an overview of how such a process could be structured, as well as its potential benefits and challenges: ### Proposed Framework for .NET Community Development Process 1...
38,678
[ { "from": "human", "value": "As per the title.\nI think .Net libraries would definitely benifit from some sort of community development; perhaps something like the Java Community Process. This is where an analogue would be very helpful.\nEDIT: I think people are believing that I need to use some libraries. ...
I have the following snippet where I would like to extract code between the {foreach} and {/foreach} using a regular expression: {foreach (...)} Some random HTML content <div class="">aklakdls</div> and some {$/r/template} markup inside. {/foreach} I already have: {foreach [^}]*} but I am unable to match anything aft...
To extract the content between `{foreach}` and `{/foreach}` using a regular expression, you can use the following regex pattern: ```regex {foreach[^}]*}(.*?){/foreach} ``` ### Breakdown of the pattern: 1. **`{foreach[^}]*}`**: This matches the opening `{foreach}` block. It starts with `{foreach`, then allows any cha...
42,672
[ { "from": "human", "value": "I have the following snippet where I would like to extract code between the {foreach} and {/foreach} using a regular expression:\n{foreach (...)}\nSome random HTML content <div class=\"\">aklakdls</div> and some {$/r/template} markup inside.\n{/foreach}\n\nI already have:\n{fore...
I want to do preliminary check if entered string looks like Vehicle Identification Number (VIN). I know what it consists of 17 letters and digits, but letters I, O and Q are not allowed inside VIN, so I use this regular expression: ^[0-9A-Z-[IOQ]]{17}$ Now if I check a string like 1G1FP22PXS2100001 with RegularExpres...
In .NET, there are indeed differences in how regular expressions are implemented in different components, particularly between `RegularExpressionValidator` and the `Regex` class. Here’s a brief overview of the situation: ### Differences in Regex Implementation 1. **RegularExpressionValidator**: This class is primaril...
41,033
[ { "from": "human", "value": "I want to do preliminary check if entered string looks like Vehicle Identification Number (VIN). I know what it consists of 17 letters and digits, but letters I, O and Q are not allowed inside VIN, so I use this regular expression:\n^[0-9A-Z-[IOQ]]{17}$ \n\nNow if I check a stri...
I'm currently working on some logging code that supposed to - among other things - print information about the calling function. This should be relatively easy, standard C++ has a type_info class. This contains the name of the typeid'd class/function/etc. but it's mangled. It's not very useful. I.e. typeid(std::vector<...
In C++, the `typeid` operator produces a mangled name for types, which is not human-readable. To obtain a demangled name that is more useful for logging, you can use the `abi::__cxa_demangle` function provided by the Itanium C++ ABI. This function is available in the `cxxabi.h` header file and is supported by GCC and C...
40,401
[ { "from": "human", "value": "I'm currently working on some logging code that supposed to - among other things - print information about the calling function. This should be relatively easy, standard C++ has a type_info class. This contains the name of the typeid'd class/function/etc. but it's mangled. It's ...
I've got a ant build.xml that uses the <copy> task to copy a variety of xml files. It uses filtering to merge in properties from a build.properties file. Each environment (dev, stage, prod) has a different build.properties that stores configuration for that environment. Sometimes we add new properties to the Spring X...
Yes, you can achieve this behavior in Apache Ant without writing a custom task. You can utilize the built-in Ant tasks in combination with some XML parsing to check for any unresolved properties in your generated files. Below are the general steps you can follow to implement this. ### Step-by-Step Approach 1. **Use t...
37,612
[ { "from": "human", "value": "I've got a ant build.xml that uses the <copy> task to copy a variety of xml files. It uses filtering to merge in properties from a build.properties file. Each environment (dev, stage, prod) has a different build.properties that stores configuration for that environment.\nSomet...
How do I compare two dates in Lingo? To be specific, I want to know if today's date is after some fixed date. I know I can create the fixed date by using: date("20090101") and I can get the current date using: _system.date() but I can't seem to directly compare the two. Do I have to parse the _system.date() to determ...
In Lingo, you can compare two date objects directly using comparison operators like `>`, `<`, `>=`, `<=`, etc. However, it's important to ensure that both values you're comparing are indeed date objects. The code snippet you shared seems like a good approach, but you might be facing an issue with the syntax of your `if...
43,659
[ { "from": "human", "value": "How do I compare two dates in Lingo? To be specific, I want to know if today's date is after some fixed date. I know I can create the fixed date by using:\ndate(\"20090101\")\n\nand I can get the current date using:\n_system.date()\n\nbut I can't seem to directly compare the two...
I am creating menus in WPF programatically using vb.net. Can someone show me how I can add separator bar to a menu in code? No xaml please.
Certainly! To add a separator to a menu in a WPF application programmatically using VB.NET, you can use the `MenuItem` class. A separator can be added by creating a new `MenuItem` with the `IsSeparator` property set to `True`. Here is a basic example to illustrate how to create a menu with a separator in WPF using VB....
41,138
[ { "from": "human", "value": "I am creating menus in WPF programatically using vb.net. Can someone show me how I can add separator bar to a menu in code? No xaml please.\n" }, { "from": "gpt", "value": "Certainly! To add a separator to a menu in a WPF application programmatically using VB.NET, ...
oPanel = CType(Master.FindControl("panelSearch"), Panel) This code resides on my masterpage's back-end (theMaster.master.vb), but I get a "Cannot refer to an instance member from within a shared class or shared member initializer without an explicit instance of the class" the function it resides in IS shared, I just ca...
The error you're encountering indicates that you are trying to access an instance member (in this case, `Master` and `FindControl`) from a shared method in your `theMaster.master.vb` file. In VB.NET, shared methods do not have access to instance members because they belong to the class itself rather than to an instance...
42,776
[ { "from": "human", "value": "oPanel = CType(Master.FindControl(\"panelSearch\"), Panel)\nThis code resides on my masterpage's back-end (theMaster.master.vb), but I get a \"Cannot refer to an instance member from within a shared class or shared member initializer without an explicit instance of the class\"\n...
Is this the best way to handle file moving in a windows service? we have many files that get matched and moved, but an end user may have the file opened at the time of moving. This is what the code currently says: Do While IO.File.Exists(OriginalFilePath) Try IO.File.Move(OriginalFilePath, BestMatchPath) ...
Your current implementation for moving files in a Windows Service is a solid start, but there are several improvements and considerations you might want to take into account for better handling of files that may be in use by other processes. Here are some suggestions to enhance your approach: ### 1. Use a Backoff Stra...
36,962
[ { "from": "human", "value": "Is this the best way to handle file moving in a windows service? we have many files that get matched and moved, but an end user may have the file opened at the time of moving.\nThis is what the code currently says:\nDo While IO.File.Exists(OriginalFilePath)\n\n Try\n I...
I have a software diagnostic page on which I would like to list the File Version information of a couple of COM DLLs. The page is running under the normal, restricted ASP.Net account (NETWORK SERVICE). Given the ProgIDs of a COM library, what's the best way to go about getting the physical file path or otherwise access...
To retrieve the file version information of COM DLLs in an ASP.NET application running under the NETWORK SERVICE account, you can follow these steps: 1. **Register the COM Component**: Ensure that the COM component is registered correctly in the Windows registry. You can find the file path of the DLL from the registry...
39,916
[ { "from": "human", "value": "I have a software diagnostic page on which I would like to list the File Version information of a couple of COM DLLs. The page is running under the normal, restricted ASP.Net account (NETWORK SERVICE).\nGiven the ProgIDs of a COM library, what's the best way to go about getting ...
I have a volunteers_2009 table that lists all the volunteers and a venues table that lists the venues that a volunteer can be assigned to, they are only assigned to one. What I want to do, is print out the number of volunteers assigned to each venue. I want it to print out like this: Name of Venue: # of volunteers tabl...
It looks like you're on the right track, but there are a few small issues that may be causing your query to not work as expected. Here's the corrected version of your SQL query and PHP code. 1. You are using the aliases `ven` and `vol` but you should refer to the tables directly. 2. It's also good practice to use the...
41,641
[ { "from": "human", "value": "I have a volunteers_2009 table that lists all the volunteers and a venues table that lists the venues that a volunteer can be assigned to, they are only assigned to one.\nWhat I want to do, is print out the number of volunteers assigned to each venue.\nI want it to print out lik...
I'm trying to create routes which follow the structure of a tree navigation system, i.e I want to include the entire path in the tree in my route. So if I had a tree which looked like this Computers Software Development Graphics Hardware CPU Graphics cards Then I would like to be able to have routes that loo...
To create a routing system that supports tree navigation with parameters in ASP.NET MVC (or similar frameworks), while also allowing for both the category hierarchy and the product information at the end of the URL, you can use a combination of custom routing logic and regular expressions. Here’s a possible approach ...
38,731
[ { "from": "human", "value": "I'm trying to create routes which follow the structure of a tree navigation system, i.e I want to include the entire path in the tree in my route. So if I had a tree which looked like this\n\nComputers\n\n\nSoftware\n\n\nDevelopment\nGraphics\n\nHardware\n\n\nCPU\nGraphics cards...
Okay i am working on someone elses code. They do alot of this: char description[256]; description[0]=0; I know this would put a \0 in the first spot of the character array. But is this even a safe way to erase a string? Also visual studio keeps reporting memory leaks, and i've pretty much tied this done to the strings...
The line of code you're dealing with: ```cpp char description[256]; description[0] = 0; ``` effectively initializes the first character of the `description` array to the null terminator (`\0`), which indicates that the string is empty. This technique is a way to "erase" the contents of the string in C-style strings, ...
37,104
[ { "from": "human", "value": "Okay i am working on someone elses code. They do alot of this:\nchar description[256];\ndescription[0]=0;\n\nI know this would put a \\0 in the first spot of the character array. But is this even a safe way to erase a string?\nAlso visual studio keeps reporting memory leaks, and...
I've been beating my head against this wall for quite some time now, so I thought I'd ask some experts. I need to send an xml string from one computer to the next. I would like to format the xml something like this: <xml> <author>Joe the Magnificent</author> <title>Joe Goes Home</title> </xml> Can anyone provide ...
It sounds like you're on the right track with your XML handling in .NET! Given that you have the sending and receiving side under control, I'll provide you with a basic example of how to create an XML string and send it over a network (e.g., using sockets, HTTP, or any other method you prefer). Below, I'll provide both...
38,174
[ { "from": "human", "value": "I've been beating my head against this wall for quite some time now, so I thought I'd ask some experts.\nI need to send an xml string from one computer to the next. I would like to format the xml something like this:\n<xml>\n <author>Joe the Magnificent</author>\n <title>Joe ...
I'd like to see a series of diffs for a file. I'd settle for simply the log listing restricted to only those entries that modified the file.
To view a series of diffs or a log listing of changes for a specific file in a version control system like Git, you can use the following commands. ### Viewing the Commit History for a Specific File To see a log listing of all the commits that modified a specific file, you can use: ```bash git log -- <file-path> ```...
43,144
[ { "from": "human", "value": "I'd like to see a series of diffs for a file. I'd settle for simply the log listing restricted to only those entries that modified the file.\n" }, { "from": "gpt", "value": "To view a series of diffs or a log listing of changes for a specific file in a version contr...
Are there any Platform agnostic (not CLI) movements to get LINQ going for C++ in some fashion? I mean a great part of server frameworks around the world run on flavors of UNIX and having access to LINQ for C++ on UNIX would probably make lots of people happy!
Yes, there are movements and libraries aimed at bringing LINQ-like functionality to C++, even though there is no official LINQ implementation for C++. Several projects and libraries attempt to provide similar capabilities, allowing developers to perform queries on collections in a more declarative style. ### Libraries...
42,408
[ { "from": "human", "value": "Are there any Platform agnostic (not CLI) movements to get LINQ going for C++ in some fashion? \nI mean a great part of server frameworks around the world run on flavors of UNIX and having access to LINQ for C++ on UNIX would probably make lots of people happy!\n" }, { "...
I have 6 links on a page to an mp3. The plugin I installed replaces those links with a swf and plays that mp3 inline. The problem I had was that it was possible to activate all 6 links and have all audio playing at once. I solved that problem (I feel in a clumsy novice way though) by catching the <a> tag before it was ...
Yes, you can reassign the click event to the `<a>` tag after you restore it. When you dynamically insert or manipulate elements in jQuery, the event bindings may be lost unless you bind them again. Here’s how you can achieve that: 1. Store the click handler in a function. 2. After you restore the `<a>` tag, rebind the...
41,993
[ { "from": "human", "value": "I have 6 links on a page to an mp3.\nThe plugin I installed replaces those links with a swf and plays that mp3 inline.\nThe problem I had was that it was possible to activate all 6 links and have all audio playing at once. I solved that problem (I feel in a clumsy novice way tho...
I am testing the application in the debug mode under several conditions. Now I'm doing it by writing some of the states and executed functions on the piece of paper and then comparing the scenarios. Does anyone know if there is any built-in functionality in VS2008 or any additional tool that could record the selected s...
In Visual Studio 2008, there aren't built-in tools specifically designed for capturing and logging states and executed functions in the way you're describing. However, there are several strategies and tools you can use to improve your debugging process: 1. **Debug Output Window**: You can utilize the Output window to ...
42,455
[ { "from": "human", "value": "I am testing the application in the debug mode under several conditions. Now I'm doing it by writing some of the states and executed functions on the piece of paper and then comparing the scenarios.\nDoes anyone know if there is any built-in functionality in VS2008 or any additi...
I want to match a block of code multiple times in a file but can't work out the regular expression to do this. An example of the code block is: //@debug ... // code in here ... //@end-debug (possibly more comments here on same line) Each code block I'm trying to match will start with //@debug and stop at the end of th...
To match each block of code between `//@debug` and the line containing `//@end-debug` separately, you can use a regular expression with the `m` (multiline) flag and a lazy quantifier. The following regex should work for your case: ```regex (\/\/@debug[\s\S]*?\/\/@end-debug(?:.*)?) ``` Here's a breakdown of the regex:...
42,078
[ { "from": "human", "value": "I want to match a block of code multiple times in a file but can't work out the regular expression to do this. An example of the code block is:\n//@debug\n...\n// code in here\n...\n//@end-debug (possibly more comments here on same line)\n\nEach code block I'm trying to match wi...
What do people recommend for creating popup's in ASP.Net MVC? I have used the AJAX toolkit and component art's methods in the web forms world and am looking something with similar capability. What JQUERY plugins do people like? SimpleModal, JBOX (I think this was, what it was called) Is it worth exploring pulling out ...
When it comes to creating popups in ASP.NET MVC, there are several modern approaches and libraries you can consider. Since you're transitioning from Web Forms and have experience with AJAX toolkit and component art, you might appreciate the flexibility and rich features offered by JavaScript libraries and jQuery plugin...
39,635
[ { "from": "human", "value": "What do people recommend for creating popup's in ASP.Net MVC? I have used the AJAX toolkit and component art's methods in the web forms world and am looking something with similar capability. \nWhat JQUERY plugins do people like? SimpleModal, JBOX (I think this was, what it was ...
because i read that one of the advantages of WS-Discovery that it "Support both SOAP 1.1 and SOAP 1.2 Envelopes" so what?
WS-Discovery (Web Services Discovery) is a protocol that allows web services to discover each other over a network. The fact that it supports both SOAP 1.1 and SOAP 1.2 envelopes is significant for a few reasons: 1. **Interoperability**: Supporting both SOAP versions means that WS-Discovery can communicate with a wide...
42,766
[ { "from": "human", "value": "because i read that one of the advantages of WS-Discovery that it\n\"Support both SOAP 1.1 and SOAP 1.2 Envelopes\"\nso what?\n" }, { "from": "gpt", "value": "WS-Discovery (Web Services Discovery) is a protocol that allows web services to discover each other over a n...
I have spent several hours trying to find a means of writing a cross platform password prompt in php that hides the password that is input by the user. While this is easily accomplished in Unix environments through the use of stty -echo, I have tried various means of passthru() and system() calls to make windows do th...
Creating a password prompt in PHP that works cross-platform (on both Unix-like systems and Windows) and hides the password input can be quite challenging because PHP is primarily a web scripting language, and its standard input/output handling does not provide built-in support for password masking in console applicatio...
37,268
[ { "from": "human", "value": "I have spent several hours trying to find a means of writing a cross platform password prompt in php that hides the password that is input by the user. While this is easily accomplished in Unix environments through the use of stty -echo, I have tried various means of passthru()...
I've seen this in a few places function fn() { return +new Date; } And I can see that it is returning a timestamp rather than a date object, but I can't find any documentation on what the plus sign is doing. Can anyone explain?
The plus sign (`+`) in front of `new Date` is a way to coerce the `Date` object into a primitive number type, specifically a timestamp. In JavaScript, when you use the unary plus operator (`+`) before a value, it attempts to convert that value to a number. In the case of `new Date`, when you create a new `Date` object...
43,653
[ { "from": "human", "value": "I've seen this in a few places\nfunction fn() {\n return +new Date;\n}\n\nAnd I can see that it is returning a timestamp rather than a date object, but I can't find any documentation on what the plus sign is doing.\nCan anyone explain?\n" }, { "from": "gpt", "valu...
I need to bitwise shift a value 64 times in JavaScript. But JavaScript starts rounding after 32. For example: for(var j = 0; j < 64; j++) { mask = mask << 1; console.log(mask); } This prints value from 0 to 1073741824 but then rounds of and starts printing 0.
In JavaScript, the bitwise operators (like `<<`, `>>`, etc.) work with 32-bit signed integers. This means that if you attempt to perform a left shift (or any bitwise operation) more than 32 times, you will effectively end up with a number that cannot be represented as a 32-bit integer, leading to undesired results (lik...
42,909
[ { "from": "human", "value": "I need to bitwise shift a value 64 times in JavaScript. But JavaScript starts rounding after 32.\nFor example:\nfor(var j = 0; j < 64; j++)\n{\n mask = mask << 1;\n console.log(mask);\n}\n\nThis prints value from 0 to 1073741824 but then rounds of and starts printing 0.\n"...
I've accidentally removed Win2K compatibility from an application by using GetProcessID. I use it like this, to get the main HWND for the launched application. ShellExecuteEx(&info); // Launch application HANDLE han = info.hProcess; // Get process cbinfo.han = han; //Call EnumWindows to enumerate windows.... //with t...
To achieve similar functionality in Windows 2000 (Win2K), you can use the same basic approach, but you need to adapt some function calls that may differ from newer versions of Windows. Here's a restructured approach to achieve the same functionality: 1. **Launching the Application**: Continue using `ShellExecuteEx` to...
39,015
[ { "from": "human", "value": "I've accidentally removed Win2K compatibility from an application by using GetProcessID.\nI use it like this, to get the main HWND for the launched application.\nShellExecuteEx(&info); // Launch application\nHANDLE han = info.hProcess; // Get process\n\ncbinfo.han = han;\n\n//Ca...
I need to pull some BLOB data from a SQL Server 2005 database and generate a SQL script to insert this same data in another database, in another server. I am only allowed to do this using SQL scripts, I can't use any other utility or write a program in Java or .NET to do it. The other big restriction I have is that I d...
Yes, you can encode BLOB data into a textual format using Base64 encoding. Although SQL Server 2005 does not have built-in functions for Base64 encoding, you can achieve this by extracting the BLOB data, encoding it manually (using a tool or programming language), and then embedding that encoded data directly into a SQ...
38,475
[ { "from": "human", "value": "I need to pull some BLOB data from a SQL Server 2005 database and generate a SQL script to insert this same data in another database, in another server.\nI am only allowed to do this using SQL scripts, I can't use any other utility or write a program in Java or .NET to do it.\nT...
I have a .NET Set and Deployment project which has to execute a set of really long SQL Scripts as a part of the installation process. I have used SMO dlls to make calls to the .sql script files.These SMO dlls are however not a part of the .NET framework but they come bundled with SQL Server 2005 or 2008. Now, if the se...
To embed the SMO (SQL Server Management Objects) DLLs with your .NET Setup and Deployment project so that your setup does not depend on the presence of SQL Server on the target machine, you can follow these steps: ### Step 1: Include SMO DLLs in Your Project 1. **Locate SMO DLLs**: First, you need to locate the SMO a...
36,938
[ { "from": "human", "value": "I have a .NET Set and Deployment project which has to execute a set of really long SQL Scripts as a part of the installation process. I have used SMO dlls to make calls to the .sql script files.These SMO dlls are however not a part of the .NET framework but they come bundled wit...
Is hashing a password twice before storage any more or less secure than just hashing it once? What I'm talking about is doing this: $hashed_password = hash(hash($plaintext_password)); instead of just this: $hashed_password = hash($plaintext_password); If it is less secure, can you provide a good explanation (or a lin...
Hashing a password twice, as you described, is generally not considered a significant enhancement in security compared to hashing it once. In fact, there are some important considerations to keep in mind when examining the effectiveness of double hashing or mixing hash functions. ### Security of Double Hashing 1. **R...
41,594
[ { "from": "human", "value": "Is hashing a password twice before storage any more or less secure than just hashing it once?\nWhat I'm talking about is doing this:\n$hashed_password = hash(hash($plaintext_password));\n\ninstead of just this:\n$hashed_password = hash($plaintext_password);\n\nIf it is less secu...
Suppose I create a table in Postgresql with a comment on a column: create table t1 ( c1 varchar(10) ); comment on column t1.c1 is 'foo'; Some time later, I decide to add another column: alter table t1 add column c2 varchar(20); I want to look up the comment contents of the first column, and associate with the new ...
In PostgreSQL, you can retrieve comments on columns from the `pg_description` system catalog, which stores comments associated with various database objects. You'll also need to join this with `pg_catalog.pg_attribute` and `pg_catalog.pg_class` to get the specific comments for your table and columns. Here's how you ca...
42,902
[ { "from": "human", "value": "Suppose I create a table in Postgresql with a comment on a column:\ncreate table t1 (\n c1 varchar(10)\n);\ncomment on column t1.c1 is 'foo';\n\nSome time later, I decide to add another column:\nalter table t1 add column c2 varchar(20);\n\nI want to look up the comment content...
Some time ago I put together a time based library that could be used for working out relative times within a year for someone. I noted at the time, that it did the one hour shift in both directions for daylight savings. It just occurred to me that Congress changed the daylight savings time rules. I don't recall see...
Yes, the rules governing Daylight Saving Time (DST) in the United States have undergone changes, most notably with the implementation of the Energy Policy Act of 2005. This act extended DST, starting in 2007, to begin on the second Sunday in March and end on the first Sunday in November. This change had already been in...
43,044
[ { "from": "human", "value": "Some time ago I put together a time based library that could be used for working out relative times within a year for someone. I noted at the time, that it did the one hour shift in both directions for daylight savings. It just occurred to me that Congress changed the daylight...
How much data should be in a table so that reading is optimal? Assuming that I have 3 fields varchar(25). This is in MySQL.
The optimal amount of data in a table for reading in MySQL (or any database) doesn't have a one-size-fits-all answer, as it depends on various factors, including: 1. **Indexing**: Proper indexing can significantly improve read performance. Indexes allow the database to quickly locate rows without scanning the entire t...
40,948
[ { "from": "human", "value": "How much data should be in a table so that reading is optimal? Assuming that I have 3 fields varchar(25). This is in MySQL.\n" }, { "from": "gpt", "value": "The optimal amount of data in a table for reading in MySQL (or any database) doesn't have a one-size-fits-all ...
I have a status message box (div box) positioned at the bottom of a web page using position: fixed; and bottom: 0;. Its height is initially 11px. I want to allow users to double click it when there are more status messages than what can fit within the default hight, make it grow. If they double click it again or move t...
You can simplify your code by using a flag to manage the state of the status message box (whether it is expanded or collapsed). This way, you can eliminate the need to bind and unbind events repeatedly. Here’s how you can refactor your code: ```html <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <...
40,427
[ { "from": "human", "value": "I have a status message box (div box) positioned at the bottom of a web page using position: fixed; and bottom: 0;. Its height is initially 11px.\nI want to allow users to double click it when there are more status messages than what can fit within the default hight, make it gro...
When does script added to the page with Page.ClientScript.RegisterStartupScript() actually run? MSDN states "when the page finishes loading but before the page's OnLoad event is raised" but this isn't much detail. For example, can a script added with RegisterStartupScript assume the DOM tree has been built? Does the be...
When you use `Page.ClientScript.RegisterStartupScript()` in ASP.NET, the script that you register is sent to the client (the browser) and is executed after the page's HTML has been rendered, but before the page's `OnLoad` event is raised on the client side. This means that the script will run after the entire HTML for ...
42,531
[ { "from": "human", "value": "When does script added to the page with Page.ClientScript.RegisterStartupScript() actually run? MSDN states \"when the page finishes loading but before the page's OnLoad event is raised\" but this isn't much detail.\nFor example, can a script added with RegisterStartupScript ass...
Before I embark on writing my own solution to this issue, can anyone point me to a pre-built solution for managing standard user details when using the SqlMembershipProvider? The solutions I have found through Google seem to either be half baked 'example solutions' or unsuitable for every day usage. Regards Richard
Hi Richard, If you're looking for a robust solution for managing user details while using the `SqlMembershipProvider`, there are several options that you might find useful: 1. **ASP.NET Identity**: While this is a more modern approach compared to the `SqlMembershipProvider`, it offers a more flexible and comprehensiv...
41,223
[ { "from": "human", "value": "Before I embark on writing my own solution to this issue, can anyone point me to a pre-built solution for managing standard user details when using the SqlMembershipProvider? The solutions I have found through Google seem to either be half baked 'example solutions' or unsuitabl...
I have a scrolling div with Three linkbuttons and three differents divs. I need to apply CSS to active linkbutton as soon as button is clicked.The codes used by me are: protected void btnNetwork_Click(object sender, EventArgs e) { this.btnForecast.CssClass = "li_1"; this.btnBlog.CssClass = "li_2"; ...
To achieve the desired functionality of applying a CSS class to the active link button when clicked, you need to ensure that you update the styles for all the buttons, not just the clicked one. Additionally, you should also manage the visibility of the corresponding divs based on the clicked button. Here’s how you can...
37,573
[ { "from": "human", "value": "I have a scrolling div with Three linkbuttons and three differents divs. I need to apply CSS to active linkbutton as soon as button is clicked.The codes used by me are:\nprotected void btnNetwork_Click(object sender, EventArgs e)\n {\n this.btnForecast.CssClass = \"li...
I was looking at the source code of java.uti.concurrent.locks.AbstractQueuedSynchronizer and the acquire() method looks something like this - public final void acquire(int arg) { if (!tryAcquire(arg) && acquireQueued(addWaiter(Node.EXCLUSIVE), arg)) Thread.currentThread().interrupt(); } Why does i...
In the `acquire(int arg)` method of `AbstractQueuedSynchronizer`, the `Thread.currentThread().interrupt()` call is used to set the interrupt status of the thread if it has to wait in the queue to acquire the lock and is then interrupted. Here’s a breakdown of why this behavior exists and its significance. ### Understa...
37,961
[ { "from": "human", "value": "I was looking at the source code of java.uti.concurrent.locks.AbstractQueuedSynchronizer and the acquire() method looks something like this -\n public final void acquire(int arg) {\n if (!tryAcquire(arg) &&\n acquireQueued(addWaiter(Node.EXCLUSIVE), arg))\n Thre...
What would be the easiest way to view classes, methods, properties, etc. inside a jar file? I'm looking for something equivalent to the very useful Lutz Roeder .NET Reflector - for Java
To view the contents of a JAR (Java Archive) file, including classes, methods, properties, and other details, there are several tools available that can serve a purpose similar to Lutz Roeder's .NET Reflector. Here are some popular options: 1. **JD-GUI (Java Decompiler GUI)**: - JD-GUI is a standalone graphical uti...
38,608
[ { "from": "human", "value": "What would be the easiest way to view classes, methods, properties, etc. inside a jar file?\nI'm looking for something equivalent to the very useful Lutz Roeder .NET Reflector - for Java\n" }, { "from": "gpt", "value": "To view the contents of a JAR (Java Archive) ...
I am trying to install SQL server express 2008 on my machine. I get an error message that says that older version of VS 2008 in installed on the computer. Upgrade to VS2008 SP1 before installing Sql server 2008. I tried to install sp1 but I get an error message that a compatible version of vs2008 is not detected on th...
Installing SQL Server 2008 Express can sometimes be complicated, especially when dealing with older versions of Visual Studio and compatibility issues. Here are some steps you can follow to resolve the issue you're experiencing: ### 1. Verify Installed Visual Studio Version: - Make sure you have a compatible version o...
36,583
[ { "from": "human", "value": "I am trying to install SQL server express 2008 on my machine. I get an error message that says that older version of VS 2008 in installed on the computer. Upgrade to VS2008 SP1 before installing Sql server 2008. \nI tried to install sp1 but I get an error message that a compatib...
Does anyone know if there's a way to automatically expand a list in Python, separated by commas? I'm writing some Python code that uses the MySQLdb library, and I'm trying to dynamically update a list of rows in a MySQL database with certain key values. For instance, in the code below, I'd like to have the numeric val...
To automatically expand a list of values into a SQL "IN" clause in your SQL statement, you'll need to format the SQL string appropriately. The `MySQLdb` library allows you to pass parameters safely using placeholders, but you need to make sure that the number of placeholders corresponds to the number of items in your l...
40,545
[ { "from": "human", "value": "Does anyone know if there's a way to automatically expand a list in Python, separated by commas? I'm writing some Python code that uses the MySQLdb library, and I'm trying to dynamically update a list of rows in a MySQL database with certain key values.\nFor instance, in the co...
I'm new to Shark, and I was wondering if it's possible to narrow down a time sample to one specific method? Let's say I'd like to, just for the sake of it, know how much resources have been used on calls to the method 'count' for all NSArray (or subclasses) instances.
Yes, you can narrow down a time sample to a specific method in Shark, which is a performance analysis tool for macOS and iOS development. Shark allows you to profile your application and analyze the performance of various functions and methods. Here are the general steps to focus on a specific method, such as `count` ...
40,417
[ { "from": "human", "value": "I'm new to Shark, and I was wondering if it's possible to narrow down a time sample to one specific method?\nLet's say I'd like to, just for the sake of it, know how much resources have been used on calls to the method 'count' for all NSArray (or subclasses) instances.\n" }, ...
I have a web service which has a generic function that returns a dataset from results of stored procedures... Some of the stored procedures have optional parameters where the value can be null but not all the time. Anyhow I am trying to pass in a parameter which has a value of DBNull.Value and I get this There was an e...
The error message you are encountering, "There was an error generating the XML document," typically indicates that there is an issue when serializing the response from the web service, particularly when the data includes a `DBNull.Value`. This can happen for several reasons: ### Possible Causes: 1. **Serialization Iss...
41,129
[ { "from": "human", "value": "I have a web service which has a generic function that returns a dataset from results of stored procedures... Some of the stored procedures have optional parameters where the value can be null but not all the time.\nAnyhow I am trying to pass in a parameter which has a value of ...
If there is more than one way, please list them. I only know of one, but I'm wondering if there is a cleaner, in-Ruby way.
Certainly! To provide you with the best options, I'll need to know specifically what task or problem you're trying to solve in Ruby. However, since you haven't specified it, I'll give you a couple of general Ruby methods for common tasks as examples. If you have a specific task in mind, please let me know! ### Example...
41,620
[ { "from": "human", "value": "If there is more than one way, please list them. I only know of one, but I'm wondering if there is a cleaner, in-Ruby way.\n" }, { "from": "gpt", "value": "Certainly! To provide you with the best options, I'll need to know specifically what task or problem you're tr...
We have 3 applications using 3 different spring configuration files. But we have one database and one datasource, so one session factory.Hhow can we import the session factory bean into the 3 different spring config files?
To share a single `SessionFactory` bean across multiple Spring configuration files, you can use the concept of importing one configuration file into others. This can be achieved by leveraging the `import` feature in Spring configuration. Here's how to do this: ### Step 1: Create a Shared Configuration File Create a ...
38,124
[ { "from": "human", "value": "We have 3 applications using 3 different spring configuration files. But we have one database and one datasource, so one session factory.Hhow can we import the session factory bean into the 3 different spring config files?\n" }, { "from": "gpt", "value": "To share a ...
I have a delete statement that's going against one of my core application tables. The delete statement is using the table's primary key but is still taking around 30 seconds. As far as I can tell the execution plan needs to do about 12 checks in other tables where this table is a FK prior to doing the delete. I need...
Based on the provided execution plan for your `DELETE` statement against the `Clean` table, we can analyze the operations taking place and identify potential reasons for the slowness, as well as suggestions for optimization. ### Key Points from the Execution Plan: 1. **Primary Key Delete Operation**: - The `DELETE...
38,811
[ { "from": "human", "value": "I have a delete statement that's going against one of my core application tables. The delete statement is using the table's primary key but is still taking around 30 seconds. As far as I can tell the execution plan needs to do about 12 checks in other tables where this table i...
[Error] WARNING. Duplicate resource(s): [Error] Type 2 (BITMAP), ID TWWDBRICHEDITMSWORD: [Error] File C:\Borland\Delphi7\ip4000vcl7\LIB\wwrichsp.RES resource kept; file C:\Borland\Delphi7\ip4000vcl7\LIB\wwrichsp.RES resource discarded. I have searched the code for same named objects, like objects. Can anyo...
The error message you're encountering indicates that there are duplicate resources in your Delphi project, specifically bitmap resources with the same ID (`TWWDBRICHEDITMSWORD`). This often occurs in large projects where multiple resource files (e.g., `.RES` files) are being linked, and they contain resources with the ...
43,025
[ { "from": "human", "value": "[Error] WARNING. Duplicate resource(s):\n[Error] Type 2 (BITMAP), ID TWWDBRICHEDITMSWORD:\n[Error] File C:\\Borland\\Delphi7\\ip4000vcl7\\LIB\\wwrichsp.RES resource kept; \n file C:\\Borland\\Delphi7\\ip4000vcl7\\LIB\\wwrichsp.RES resource discarded.\nI have searched ...
create table person ( name varchar(15), attr1 varchar(15), attr2 varchar(1), attr3 char(1), attr4 int ) How I can use basic ORM in Perl by taking a simple table like the one above and mapping it to Perl objects? Next I'd like to perform basic operations like select results using some criteria sys...
To use a basic ORM (Object-Relational Mapping) in Perl for the given table schema, you'll need a Perl module for database interactions, such as `DBI` (Database Interface) along with an ORM layer like `DBIx::Class`. Below, I'll walk you through setting up a simple ORM for the `person` table and performing basic operatio...
38,239
[ { "from": "human", "value": "\ncreate table person\n(\n name varchar(15),\n attr1 varchar(15),\n attr2 varchar(1),\n attr3 char(1),\n attr4 int\n)\n\nHow I can use basic ORM in Perl by taking a simple table like the one above and mapping it to Perl objects? Next I'd like to perform basic ope...
I'm making a Java application with an application-logic-thread and a database-access-thread. Both of them persist for the entire lifetime of the application and both need to be running at the same time (one talks to the server, one talks to the user; when the app is fully started, I need both of them to work). However,...
To efficiently wait for the database access thread to be ready without consuming CPU cycles, you can use a condition variable or an equivalent synchronization mechanism. In Java, a common approach is to use the `wait()` and `notify()` methods of the `Object` class in conjunction with a shared lock object. Here's a si...
39,316
[ { "from": "human", "value": "I'm making a Java application with an application-logic-thread and a database-access-thread.\nBoth of them persist for the entire lifetime of the application and both need to be running at the same time (one talks to the server, one talks to the user; when the app is fully start...
I have a python module that defines a number of classes: class A(object): def __call__(self): print "ran a" class B(object): def __call__(self): print "ran b" class C(object): def __call__(self): print "ran c" From within the module, how might I add an attribute that gives me all ...
Within your module, you can access the classes you've defined using the built-in `globals()` function, which returns a dictionary representing the current global symbol table. This allows you to retrieve the classes by their names as strings. You can create a list or another attribute that holds all of the classes def...
41,664
[ { "from": "human", "value": "I have a python module that defines a number of classes:\nclass A(object):\n def __call__(self):\n print \"ran a\"\n\nclass B(object):\n def __call__(self):\n print \"ran b\"\n\nclass C(object):\n def __call__(self):\n print \"ran c\"\n\nFrom within...
I have a messy function that needs refactoring, it has too many nested IF's and it makes me nervous just to look at it! Please ignore what the functions are doing, I'm more concerned with the structure/flow and how it can be refactored so it has less nested IF statements The basic flow is as follows: public static void...
Refactoring code to reduce nested `if` statements can improve readability and maintainability. One way to achieve this is by using early returns to exit the function when a condition is not met. This approach avoids deep nesting and makes the flow of logic clearer. Here's a refactored version of your `HandleUploadedFi...
43,050
[ { "from": "human", "value": "I have a messy function that needs refactoring, it has too many nested IF's and it makes me nervous just to look at it!\nPlease ignore what the functions are doing, I'm more concerned with the structure/flow and how it can be refactored so it has less nested IF statements\nThe b...
Possible Duplicate: Split string in SQL I have seen a couple of questions related to string concatenation in SQL. I wonder how would you approach the opposite problem: splitting coma delimited string into rows of data: Lets say I have tables: userTypedTags(userID,commaSeparatedTags) 'one entry per user tags(tagID,na...
To split a comma-separated string into rows in SQL Server, you can use a common table expression (CTE) or a recursive method, particularly if you're using SQL Server 2005 or later. Below, I'll provide an example of both approaches. ### Using a Recursive CTE (SQL Server 2005 and above) You can create a recursive CTE t...
37,399
[ { "from": "human", "value": "\nPossible Duplicate:\nSplit string in SQL \n\nI have seen a couple of questions related to string concatenation in SQL.\nI wonder how would you approach the opposite problem: splitting coma delimited string into rows of data:\nLets say I have tables:\nuserTypedTags(userID,comma...
Background Lately I've become a fanatic that everything I type while working on a computer should be compatible with "DRY". If there's anything I have to type more than once in any context, I want some kind of user-aware auto-complete option to do some of the work for me -- always -- no exceptions. Having to work under...
Your quest for a simple, universal incremental autocomplete tool that can utilize CSV files for various text completions is indeed a common one among users who favor efficiency and streamlined workflows. While there may not be a specific tool that meets all of your requirements out-of-the-box, several applications and ...
39,863
[ { "from": "human", "value": "Background\nLately I've become a fanatic that everything I type while working on a computer should be compatible with \"DRY\". If there's anything I have to type more than once in any context, I want some kind of user-aware auto-complete option to do some of the work for me -- a...
I have a collection of HTML documents for which I need to parse the contents of the <meta> tags in the <head> section. These are the only HTML tags whose values I'm interested in, i.e. I don't need to parse anything in the <body> section. I've attempted to parse these values using the XPath support provided by JDom. Ho...
Hi Don, When dealing with HTML that may not be well-formed XML, a good approach is to use a library that is designed to handle HTML parsing gracefully. One popular choice for Java is **JSoup**, which can parse HTML and deal with common issues like malformed tags. Here's a step-by-step guide on how to use JSoup to ext...
41,110
[ { "from": "human", "value": "I have a collection of HTML documents for which I need to parse the contents of the <meta> tags in the <head> section. These are the only HTML tags whose values I'm interested in, i.e. I don't need to parse anything in the <body> section.\nI've attempted to parse these values us...
How to get to know DNS name of the server where ASP.NET application is run? I want to get string "www.somehost.com" if my application URL is http://www.somehost.com/somepath/application.aspx Is there some property of Server, Contex, Session or Request objects for this? Thanks!
In an ASP.NET application, you can retrieve the DNS name of the server (the host name) from the `Request` object. Specifically, you can use the `Request.Url` property, which provides access to the full URL of the incoming request. Here’s how you can get the host name: ```csharp string hostName = Request.Url.Host; ``` ...
43,515
[ { "from": "human", "value": "How to get to know DNS name of the server where ASP.NET application is run?\nI want to get string \"www.somehost.com\" if my application URL is http://www.somehost.com/somepath/application.aspx\nIs there some property of Server, Contex, Session or Request objects for this?\nThan...
what is the proper way to scale an SDL Surface? I found one explanation online but it required redrawing the Surface pixel by pixel. It seems like there should be some way of doing this natively through SDL rather than redrawing the image like that. I haven't been able to find anything in the SDL documentation that cov...
In SDL (Simple DirectMedia Layer), a surface itself does not inherently support resizing or scaling directly. When you manipulate the width and height of a surface, the resulting image is not automatically scaled or stretched, which is why you're experiencing clipping or unexpected results. To properly scale an SDL s...
38,859
[ { "from": "human", "value": "what is the proper way to scale an SDL Surface? I found one explanation online but it required redrawing the Surface pixel by pixel. It seems like there should be some way of doing this natively through SDL rather than redrawing the image like that. I haven't been able to find a...